diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/CHANGELOG.md b/sdk/migration/azure-resourcemanager-migration-assessment/CHANGELOG.md index e95e8853bae1..9a884f496871 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/CHANGELOG.md +++ b/sdk/migration/azure-resourcemanager-migration-assessment/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2025-04-11) + +- Azure Resource Manager Migration Assessment client library for Java. This package contains Microsoft Azure SDK for Migration Assessment Management SDK. Azure Migrate Resource Provider management API. Package tag package-preview-2024-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/README.md b/sdk/migration/azure-resourcemanager-migration-assessment/README.md index 11f0f69c57f1..66a4f366f14d 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/README.md +++ b/sdk/migration/azure-resourcemanager-migration-assessment/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Migration Assessment client library for Java. -This package contains Microsoft Azure SDK for Migration Assessment Management SDK. Azure Migrate Resource Provider management API. Package tag package-2023-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Migration Assessment Management SDK. Azure Migrate Resource Provider management API. Package tag package-preview-2024-03. 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 diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/SAMPLE.md b/sdk/migration/azure-resourcemanager-migration-assessment/SAMPLE.md index e3cbddb3ef31..a0b5747fa2cf 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/SAMPLE.md +++ b/sdk/migration/azure-resourcemanager-migration-assessment/SAMPLE.md @@ -1,40 +1,67 @@ # Code snippets and samples -## AssessedMachinesOperations +## AksAssessmentOperations -- [Get](#assessedmachinesoperations_get) -- [ListByAssessment](#assessedmachinesoperations_listbyassessment) +- [Create](#aksassessmentoperations_create) +- [Delete](#aksassessmentoperations_delete) +- [DownloadUrl](#aksassessmentoperations_downloadurl) +- [Get](#aksassessmentoperations_get) +- [ListByParent](#aksassessmentoperations_listbyparent) -## AssessedSqlDatabaseV2Operations +## AksClusterOperations -- [Get](#assessedsqldatabasev2operations_get) -- [ListBySqlAssessmentV2](#assessedsqldatabasev2operations_listbysqlassessmentv2) +- [Get](#aksclusteroperations_get) +- [ListByParent](#aksclusteroperations_listbyparent) -## AssessedSqlInstanceV2Operations +## AksCostDetailOperations -- [Get](#assessedsqlinstancev2operations_get) -- [ListBySqlAssessmentV2](#assessedsqlinstancev2operations_listbysqlassessmentv2) +- [ListByParent](#akscostdetailoperations_listbyparent) -## AssessedSqlMachinesOperations +## AksOptionsOperations -- [Get](#assessedsqlmachinesoperations_get) -- [ListBySqlAssessmentV2](#assessedsqlmachinesoperations_listbysqlassessmentv2) +- [Get](#aksoptionsoperations_get) +- [ListByParent](#aksoptionsoperations_listbyparent) -## AssessedSqlRecommendedEntityOperations +## AksSummaryOperations -- [Get](#assessedsqlrecommendedentityoperations_get) -- [ListBySqlAssessmentV2](#assessedsqlrecommendedentityoperations_listbysqlassessmentv2) +- [Get](#akssummaryoperations_get) +- [ListByParent](#akssummaryoperations_listbyparent) -## AssessmentOptionsOperations +## AssessedMachinesV2Operations -- [Get](#assessmentoptionsoperations_get) -- [ListByAssessmentProject](#assessmentoptionsoperations_listbyassessmentproject) +- [Get](#assessedmachinesv2operations_get) +- [ListByParent](#assessedmachinesv2operations_listbyparent) + +## AssessedSqlDatabaseV3Operations + +- [Get](#assessedsqldatabasev3operations_get) +- [ListByParent](#assessedsqldatabasev3operations_listbyparent) + +## AssessedSqlInstanceV3Operations + +- [Get](#assessedsqlinstancev3operations_get) +- [ListByParent](#assessedsqlinstancev3operations_listbyparent) + +## AssessedSqlMachinesV3Operations + +- [Get](#assessedsqlmachinesv3operations_get) +- [ListByParent](#assessedsqlmachinesv3operations_listbyparent) + +## AssessedWebApplicationOperations + +- [Get](#assessedwebapplicationoperations_get) +- [ListByParent](#assessedwebapplicationoperations_listbyparent) + +## AssessedWebAppsV3Operations + +- [Get](#assessedwebappsv3operations_get) +- [ListByParent](#assessedwebappsv3operations_listbyparent) ## AssessmentProjectSummaryOperations - [Get](#assessmentprojectsummaryoperations_get) -- [ListByAssessmentProject](#assessmentprojectsummaryoperations_listbyassessmentproject) +- [ListByParent](#assessmentprojectsummaryoperations_listbyparent) ## AssessmentProjectsOperations @@ -45,58 +72,141 @@ - [ListByResourceGroup](#assessmentprojectsoperations_listbyresourcegroup) - [Update](#assessmentprojectsoperations_update) -## AssessmentsOperations +## AvsAssessedMachinesV2Operations + +- [Get](#avsassessedmachinesv2operations_get) +- [ListByParent](#avsassessedmachinesv2operations_listbyparent) + +## AvsAssessmentV2SummaryOperations + +- [Get](#avsassessmentv2summaryoperations_get) +- [ListByParent](#avsassessmentv2summaryoperations_listbyparent) + +## AvsAssessmentsV2Operations + +- [Create](#avsassessmentsv2operations_create) +- [Delete](#avsassessmentsv2operations_delete) +- [DownloadUrl](#avsassessmentsv2operations_downloadurl) +- [Get](#avsassessmentsv2operations_get) +- [ListByParent](#avsassessmentsv2operations_listbyparent) + +## AvsGraphAssessmentOptionsOperations + +- [Get](#avsgraphassessmentoptionsoperations_get) +- [ListByParent](#avsgraphassessmentoptionsoperations_listbyparent) + +## BusinessCaseAvsSummaryOperations + +- [Get](#businesscaseavssummaryoperations_get) +- [ListByParent](#businesscaseavssummaryoperations_listbyparent) + +## BusinessCaseIaasSummaryOperations + +- [Get](#businesscaseiaassummaryoperations_get) +- [ListByParent](#businesscaseiaassummaryoperations_listbyparent) + +## BusinessCaseOperations + +- [CompareSummary](#businesscaseoperations_comparesummary) +- [Create](#businesscaseoperations_create) +- [Delete](#businesscaseoperations_delete) +- [Get](#businesscaseoperations_get) +- [GetReportDownloadUrl](#businesscaseoperations_getreportdownloadurl) +- [ListByParent](#businesscaseoperations_listbyparent) + +## BusinessCaseOverviewSummaryOperations + +- [Get](#businesscaseoverviewsummaryoperations_get) +- [ListByParent](#businesscaseoverviewsummaryoperations_listbyparent) + +## BusinessCasePaasSummaryOperations + +- [Get](#businesscasepaassummaryoperations_get) +- [ListByParent](#businesscasepaassummaryoperations_listbyparent) + +## CompoundAssessmentOperations + +- [Create](#compoundassessmentoperations_create) +- [Delete](#compoundassessmentoperations_delete) +- [DownloadUrl](#compoundassessmentoperations_downloadurl) +- [Get](#compoundassessmentoperations_get) +- [ListByParent](#compoundassessmentoperations_listbyparent) + +## CompoundAssessmentSummaryOperations + +- [Get](#compoundassessmentsummaryoperations_get) +- [ListByParent](#compoundassessmentsummaryoperations_listbyparent) + +## EvaluatedAvsMachinesOperations -- [Create](#assessmentsoperations_create) -- [Delete](#assessmentsoperations_delete) -- [DownloadUrl](#assessmentsoperations_downloadurl) -- [Get](#assessmentsoperations_get) -- [ListByGroup](#assessmentsoperations_listbygroup) +- [Get](#evaluatedavsmachinesoperations_get) +- [ListByParent](#evaluatedavsmachinesoperations_listbyparent) -## AvsAssessedMachinesOperations +## EvaluatedMachinesOperations -- [Get](#avsassessedmachinesoperations_get) -- [ListByAvsAssessment](#avsassessedmachinesoperations_listbyavsassessment) +- [Get](#evaluatedmachinesoperations_get) +- [ListByParent](#evaluatedmachinesoperations_listbyparent) -## AvsAssessmentOptionsOperations +## EvaluatedSqlEntitiesOperations -- [Get](#avsassessmentoptionsoperations_get) -- [ListByAssessmentProject](#avsassessmentoptionsoperations_listbyassessmentproject) +- [Get](#evaluatedsqlentitiesoperations_get) +- [ListByParent](#evaluatedsqlentitiesoperations_listbyparent) -## AvsAssessmentsOperations +## EvaluatedWebAppsOperations -- [Create](#avsassessmentsoperations_create) -- [Delete](#avsassessmentsoperations_delete) -- [DownloadUrl](#avsassessmentsoperations_downloadurl) -- [Get](#avsassessmentsoperations_get) -- [ListByGroup](#avsassessmentsoperations_listbygroup) +- [Get](#evaluatedwebappsoperations_get) +- [ListByParent](#evaluatedwebappsoperations_listbyparent) -## GroupsOperations +## HeterogeneousAssessmentOperations -- [Create](#groupsoperations_create) -- [Delete](#groupsoperations_delete) -- [Get](#groupsoperations_get) -- [ListByAssessmentProject](#groupsoperations_listbyassessmentproject) -- [UpdateMachines](#groupsoperations_updatemachines) +- [Create](#heterogeneousassessmentoperations_create) +- [Delete](#heterogeneousassessmentoperations_delete) +- [Get](#heterogeneousassessmentoperations_get) +- [ListByParent](#heterogeneousassessmentoperations_listbyparent) + +## HeterogeneousAssessmentSummaryOperations + +- [Get](#heterogeneousassessmentsummaryoperations_get) +- [ListByParent](#heterogeneousassessmentsummaryoperations_listbyparent) ## HypervCollectorsOperations - [Create](#hypervcollectorsoperations_create) - [Delete](#hypervcollectorsoperations_delete) - [Get](#hypervcollectorsoperations_get) -- [ListByAssessmentProject](#hypervcollectorsoperations_listbyassessmentproject) +- [ListByParent](#hypervcollectorsoperations_listbyparent) ## ImportCollectorsOperations - [Create](#importcollectorsoperations_create) - [Delete](#importcollectorsoperations_delete) - [Get](#importcollectorsoperations_get) -- [ListByAssessmentProject](#importcollectorsoperations_listbyassessmentproject) +- [ListByParent](#importcollectorsoperations_listbyparent) + +## ImportSqlCollectorOperations + +- [Create](#importsqlcollectoroperations_create) +- [Delete](#importsqlcollectoroperations_delete) +- [Get](#importsqlcollectoroperations_get) +- [ListByParent](#importsqlcollectoroperations_listbyparent) + +## MachineAssessmentV2SummaryOperations + +- [Get](#machineassessmentv2summaryoperations_get) +- [ListByParent](#machineassessmentv2summaryoperations_listbyparent) + +## MachineAssessmentsV2Operations + +- [Create](#machineassessmentsv2operations_create) +- [Delete](#machineassessmentsv2operations_delete) +- [DownloadUrl](#machineassessmentsv2operations_downloadurl) +- [Get](#machineassessmentsv2operations_get) +- [ListByParent](#machineassessmentsv2operations_listbyparent) -## MachinesOperations +## MachineGraphAssessmentOptionsOperations -- [Get](#machinesoperations_get) -- [ListByAssessmentProject](#machinesoperations_listbyassessmentproject) +- [Get](#machinegraphassessmentoptionsoperations_get) +- [ListByParent](#machinegraphassessmentoptionsoperations_listbyparent) ## Operations @@ -106,1949 +216,3956 @@ - [Delete](#privateendpointconnectionoperations_delete) - [Get](#privateendpointconnectionoperations_get) -- [ListByAssessmentProject](#privateendpointconnectionoperations_listbyassessmentproject) +- [ListByParent](#privateendpointconnectionoperations_listbyparent) - [Update](#privateendpointconnectionoperations_update) ## PrivateLinkResourceOperations - [Get](#privatelinkresourceoperations_get) -- [ListByAssessmentProject](#privatelinkresourceoperations_listbyassessmentproject) +- [ListByParent](#privatelinkresourceoperations_listbyparent) ## ServerCollectorsOperations - [Create](#servercollectorsoperations_create) - [Delete](#servercollectorsoperations_delete) - [Get](#servercollectorsoperations_get) -- [ListByAssessmentProject](#servercollectorsoperations_listbyassessmentproject) +- [ListByParent](#servercollectorsoperations_listbyparent) -## SqlAssessmentOptionsOperations +## SqlAssessmentV3Operations -- [Get](#sqlassessmentoptionsoperations_get) -- [ListByAssessmentProject](#sqlassessmentoptionsoperations_listbyassessmentproject) +- [Create](#sqlassessmentv3operations_create) +- [Delete](#sqlassessmentv3operations_delete) +- [DownloadUrl](#sqlassessmentv3operations_downloadurl) +- [Get](#sqlassessmentv3operations_get) +- [ListByParent](#sqlassessmentv3operations_listbyparent) -## SqlAssessmentV2Operations +## SqlAssessmentV3SummaryOperations -- [Create](#sqlassessmentv2operations_create) -- [Delete](#sqlassessmentv2operations_delete) -- [DownloadUrl](#sqlassessmentv2operations_downloadurl) -- [Get](#sqlassessmentv2operations_get) -- [ListByGroup](#sqlassessmentv2operations_listbygroup) - -## SqlAssessmentV2SummaryOperations - -- [Get](#sqlassessmentv2summaryoperations_get) -- [ListBySqlAssessmentV2](#sqlassessmentv2summaryoperations_listbysqlassessmentv2) +- [Get](#sqlassessmentv3summaryoperations_get) +- [ListByParent](#sqlassessmentv3summaryoperations_listbyparent) ## SqlCollectorOperations - [Create](#sqlcollectoroperations_create) - [Delete](#sqlcollectoroperations_delete) - [Get](#sqlcollectoroperations_get) -- [ListByAssessmentProject](#sqlcollectoroperations_listbyassessmentproject) +- [ListByParent](#sqlcollectoroperations_listbyparent) + +## SqlGraphAssessmentOptionsOperations + +- [Get](#sqlgraphassessmentoptionsoperations_get) +- [ListByParent](#sqlgraphassessmentoptionsoperations_listbyparent) ## VmwareCollectorsOperations - [Create](#vmwarecollectorsoperations_create) - [Delete](#vmwarecollectorsoperations_delete) - [Get](#vmwarecollectorsoperations_get) -- [ListByAssessmentProject](#vmwarecollectorsoperations_listbyassessmentproject) -### AssessedMachinesOperations_Get +- [ListByParent](#vmwarecollectorsoperations_listbyparent) + +## WebAppAssessmentV3Operations + +- [Create](#webappassessmentv3operations_create) +- [Delete](#webappassessmentv3operations_delete) +- [DownloadUrl](#webappassessmentv3operations_downloadurl) +- [Get](#webappassessmentv3operations_get) +- [ListByParent](#webappassessmentv3operations_listbyparent) + +## WebAppAssessmentV3SummaryOperations + +- [Get](#webappassessmentv3summaryoperations_get) +- [ListByParent](#webappassessmentv3summaryoperations_listbyparent) + +## WebAppCollectorOperations + +- [Create](#webappcollectoroperations_create) +- [Delete](#webappcollectoroperations_delete) +- [Get](#webappcollectoroperations_get) +- [ListByParent](#webappcollectoroperations_listbyparent) + +## WebAppGraphAssessmentOptionsOperations + +- [Get](#webappgraphassessmentoptionsoperations_get) +- [ListByParent](#webappgraphassessmentoptionsoperations_listbyparent) + +## WebAppServicePlansOperations + +- [Get](#webappserviceplansoperations_get) +- [ListByParent](#webappserviceplansoperations_listbyparent) +### AksAssessmentOperations_Create ```java +import com.azure.resourcemanager.migration.assessment.models.AksAssessmentProperties; +import com.azure.resourcemanager.migration.assessment.models.AksAssessmentSettings; +import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; +import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; +import com.azure.resourcemanager.migration.assessment.models.AzureOffer; +import com.azure.resourcemanager.migration.assessment.models.AzureVmCategory; +import com.azure.resourcemanager.migration.assessment.models.BillingSettings; +import com.azure.resourcemanager.migration.assessment.models.ConsolidationType; +import com.azure.resourcemanager.migration.assessment.models.EnvironmentType; +import com.azure.resourcemanager.migration.assessment.models.LicensingProgram; +import com.azure.resourcemanager.migration.assessment.models.Percentile; +import com.azure.resourcemanager.migration.assessment.models.PerformanceData; +import com.azure.resourcemanager.migration.assessment.models.PricingTier; +import com.azure.resourcemanager.migration.assessment.models.SavingsOptions; +import com.azure.resourcemanager.migration.assessment.models.SavingsSettings; +import com.azure.resourcemanager.migration.assessment.models.Scope; +import com.azure.resourcemanager.migration.assessment.models.ScopeType; +import com.azure.resourcemanager.migration.assessment.models.TimeRange; +import java.time.OffsetDateTime; + /** - * Samples for AssessedMachinesOperations Get. + * Samples for AksAssessmentOperations Create. */ -public final class AssessedMachinesOperationsGetSamples { +public final class AksAssessmentOperationsCreateSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedMachinesOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksAssessmentOperations_Create_MaximumSet_Gen.json */ /** - * Sample code: AssessedMachinesOperations_Get_MaximumSet_Gen. + * Sample code: AksAssessmentOperations_Create_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessedMachinesOperationsGetMaximumSetGen( + public static void aksAssessmentOperationsCreateMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedMachinesOperations() - .getWithResponse("rgopenapi", "pavqtntysjn", "smawqdmhfngray", "qjlumxyqsitd", "oqxjeheiipjmuo", - com.azure.core.util.Context.NONE); + manager.aksAssessmentOperations() + .define("testaksassessment") + .withExistingAssessmentProject("rgaksAssessments", "testProject") + .withProperties(new AksAssessmentProperties() + .withScope(new Scope().withScopeType(ScopeType.SERVER_GROUP_ID) + .withServerGroupId("this-will-be-a-valid-arm-id") + .withAzureResourceGraphQuery("zyhczkubwaqjqrmyithugmedmtdjxb")) + .withSettings(new AksAssessmentSettings().withAzureLocation("EastUS") + .withCurrency(AzureCurrency.USD) + .withScalingFactor(20.0F) + .withDiscountPercentage(14.0F) + .withSizingCriterion(AssessmentSizingCriterion.PERFORMANCE_BASED) + .withPerformanceData(new PerformanceData().withPercentile(Percentile.fromString("Unknown")) + .withTimeRange(TimeRange.DAY) + .withPerfDataStartTime(OffsetDateTime.parse("2025-02-14T07:09:09.242Z")) + .withPerfDataEndTime(OffsetDateTime.parse("2025-02-14T07:09:09.242Z"))) + .withSavingsSettings(new SavingsSettings().withSavingsOptions(SavingsOptions.NONE) + .withAzureOfferCode(AzureOffer.UNKNOWN)) + .withBillingSettings(new BillingSettings().withLicensingProgram(LicensingProgram.EA) + .withSubscriptionId("572C3D3F-425D-4AE8-A935-72631EADDE56")) + .withEnvironmentType(EnvironmentType.PRODUCTION) + .withCategory(AzureVmCategory.ALL) + .withConsolidation(ConsolidationType.FULL) + .withPricingTier(PricingTier.STANDARD))) + .create(); } } ``` -### AssessedMachinesOperations_ListByAssessment +### AksAssessmentOperations_Delete ```java /** - * Samples for AssessedMachinesOperations ListByAssessment. + * Samples for AksAssessmentOperations Delete. */ -public final class AssessedMachinesOperationsListByAssessmentSamples { +public final class AksAssessmentOperationsDeleteSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedMachinesOperations_ListByAssessment_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksAssessmentOperations_Delete_MaximumSet_Gen.json */ /** - * Sample code: AssessedMachinesOperations_ListByAssessment_MaximumSet_Gen. + * Sample code: AksAssessmentOperations_Delete_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessedMachinesOperationsListByAssessmentMaximumSetGen( + public static void aksAssessmentOperationsDeleteMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedMachinesOperations() - .listByAssessment("rgopenapi", "sloqixzfjk", "kjuepxerwseq", "rhzcmubwrrkhtocsibu", "sbkdovsfqldhdb", 10, - "hbyseetshbplfkjmpjhsiurqgt", 25, com.azure.core.util.Context.NONE); + manager.aksAssessmentOperations() + .deleteWithResponse("rgaksAssessments", "testProject", "testaksassessment", + com.azure.core.util.Context.NONE); } } ``` -### AssessedSqlDatabaseV2Operations_Get +### AksAssessmentOperations_DownloadUrl ```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + /** - * Samples for AssessedSqlDatabaseV2Operations Get. + * Samples for AksAssessmentOperations DownloadUrl. */ -public final class AssessedSqlDatabaseV2OperationsGetSamples { +public final class AksAssessmentOperationsDownloadUrlSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlDatabaseV2Operations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksAssessmentOperations_DownloadUrl_MaximumSet_Gen.json */ /** - * Sample code: AssessedSqlDatabaseV2Operations_Get_MaximumSet_Gen. + * Sample code: AksAssessmentOperations_DownloadUrl_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessedSqlDatabaseV2OperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlDatabaseV2Operations() - .getWithResponse("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "858eb860-9e07-417c-91b6-bca1bffb3bf5", com.azure.core.util.Context.NONE); + public static void aksAssessmentOperationsDownloadUrlMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { + manager.aksAssessmentOperations() + .downloadUrl("rgaksAssessments", "testProject", "testaksassessment", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); } } ``` -### AssessedSqlDatabaseV2Operations_ListBySqlAssessmentV2 +### AksAssessmentOperations_Get ```java /** - * Samples for AssessedSqlDatabaseV2Operations ListBySqlAssessmentV2. + * Samples for AksAssessmentOperations Get. */ -public final class AssessedSqlDatabaseV2OperationsListBySqlAssessmentV2Samples { +public final class AksAssessmentOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlDatabaseV2Operations_ListBySqlAssessmentV2_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksAssessmentOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: AssessedSqlDatabaseV2Operations_ListBySqlAssessmentV2_MaximumSet_Gen. + * Sample code: AksAssessmentOperations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessedSqlDatabaseV2OperationsListBySqlAssessmentV2MaximumSetGen( + public static void aksAssessmentOperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlDatabaseV2Operations() - .listBySqlAssessmentV2("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "(contains(Properties/DatabaseName,'adv130'))", 23, null, 1, com.azure.core.util.Context.NONE); + manager.aksAssessmentOperations() + .getWithResponse("rgaksAssessments", "testProject", "testaksassessment", com.azure.core.util.Context.NONE); } } ``` -### AssessedSqlInstanceV2Operations_Get +### AksAssessmentOperations_ListByParent ```java /** - * Samples for AssessedSqlInstanceV2Operations Get. + * Samples for AksAssessmentOperations ListByParent. */ -public final class AssessedSqlInstanceV2OperationsGetSamples { +public final class AksAssessmentOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlInstanceV2Operations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksAssessmentOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: AssessedSqlInstanceV2Operations_Get_MaximumSet_Gen. + * Sample code: AksAssessmentOperations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessedSqlInstanceV2OperationsGetMaximumSetGen( + public static void aksAssessmentOperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlInstanceV2Operations() - .getWithResponse("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "3c6574cf-b4e1-4fdc-93db-6bbcc570dda2", com.azure.core.util.Context.NONE); + manager.aksAssessmentOperations() + .listByParent("rgaksAssessments", "testProject", com.azure.core.util.Context.NONE); } } ``` -### AssessedSqlInstanceV2Operations_ListBySqlAssessmentV2 +### AksClusterOperations_Get ```java /** - * Samples for AssessedSqlInstanceV2Operations ListBySqlAssessmentV2. + * Samples for AksClusterOperations Get. */ -public final class AssessedSqlInstanceV2OperationsListBySqlAssessmentV2Samples { +public final class AksClusterOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlInstanceV2Operations_ListBySqlAssessmentV2_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksClusterOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: AssessedSqlInstanceV2Operations_ListBySqlAssessmentV2_MaximumSet_Gen. + * Sample code: AksClusterOperations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessedSqlInstanceV2OperationsListBySqlAssessmentV2MaximumSetGen( + public static void aksClusterOperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlInstanceV2Operations() - .listBySqlAssessmentV2("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "(contains(Properties/InstanceName,'MSSQLSERVER'))", 23, null, 1, com.azure.core.util.Context.NONE); + manager.aksClusterOperations() + .getWithResponse("rgaksAssessments", "testProject", "testaksassessment", "testaksassessment-cluster", + com.azure.core.util.Context.NONE); } } ``` -### AssessedSqlMachinesOperations_Get +### AksClusterOperations_ListByParent ```java /** - * Samples for AssessedSqlMachinesOperations Get. + * Samples for AksClusterOperations ListByParent. */ -public final class AssessedSqlMachinesOperationsGetSamples { +public final class AksClusterOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlMachinesOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksClusterOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: AssessedSqlMachinesOperations_Get_MaximumSet_Gen. + * Sample code: AksClusterOperations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessedSqlMachinesOperationsGetMaximumSetGen( + public static void aksClusterOperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlMachinesOperations() - .getWithResponse("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "cc64c9dc-b38e-435d-85ad-d509df5d92c6", com.azure.core.util.Context.NONE); + manager.aksClusterOperations() + .listByParent("rgaksAssessments", "testProject", "testaksassessment", com.azure.core.util.Context.NONE); } } ``` -### AssessedSqlMachinesOperations_ListBySqlAssessmentV2 +### AksCostDetailOperations_ListByParent ```java /** - * Samples for AssessedSqlMachinesOperations ListBySqlAssessmentV2. + * Samples for AksCostDetailOperations ListByParent. */ -public final class AssessedSqlMachinesOperationsListBySqlAssessmentV2Samples { +public final class AksCostDetailOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlMachinesOperations_ListBySqlAssessmentV2_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksCostDetailOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: AssessedSqlMachinesOperations_ListBySqlAssessmentV2_MaximumSet_Gen. + * Sample code: AksCostDetailOperations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessedSqlMachinesOperationsListBySqlAssessmentV2MaximumSetGen( + public static void aksCostDetailOperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlMachinesOperations() - .listBySqlAssessmentV2("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "(contains(Properties/DisplayName,'SQLHAVM17'))", 23, null, 1, com.azure.core.util.Context.NONE); + manager.aksCostDetailOperations() + .listByParent("rgaksAssessments", "testProject", "testaksassessment", com.azure.core.util.Context.NONE); } } ``` -### AssessedSqlRecommendedEntityOperations_Get +### AksOptionsOperations_Get ```java /** - * Samples for AssessedSqlRecommendedEntityOperations Get. + * Samples for AksOptionsOperations Get. */ -public final class AssessedSqlRecommendedEntityOperationsGetSamples { +public final class AksOptionsOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlRecommendedEntityOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksOptionsOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: AssessedSqlRecommendedEntityOperations_Get_MaximumSet_Gen. + * Sample code: AksOptionsOperations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessedSqlRecommendedEntityOperationsGetMaximumSetGen( + public static void aksOptionsOperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlRecommendedEntityOperations() - .getWithResponse("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "cc64c9dc-b38e-435d-85ad-d509df5d92c6", com.azure.core.util.Context.NONE); + manager.aksOptionsOperations() + .getWithResponse("rgaksAssessments", "testProject", "default", com.azure.core.util.Context.NONE); } } ``` -### AssessedSqlRecommendedEntityOperations_ListBySqlAssessmentV2 +### AksOptionsOperations_ListByParent ```java /** - * Samples for AssessedSqlRecommendedEntityOperations ListBySqlAssessmentV2. + * Samples for AksOptionsOperations ListByParent. */ -public final class AssessedSqlRecommendedEntityOperationsListBySqlAssessmentV2Samples { +public final class AksOptionsOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlRecommendedEntityOperations_ListBySqlAssessmentV2_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksOptionsOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: AssessedSqlRecommendedEntityOperations_ListBySqlAssessmentV2_MaximumSet_Gen. + * Sample code: AksOptionsOperations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessedSqlRecommendedEntityOperationsListBySqlAssessmentV2MaximumSetGen( + public static void aksOptionsOperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlRecommendedEntityOperations() - .listBySqlAssessmentV2("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "(contains(Properties/InstanceName,'MSSQLSERVER'))", 23, null, 1, com.azure.core.util.Context.NONE); + manager.aksOptionsOperations() + .listByParent("rgaksAssessments", "testProject", com.azure.core.util.Context.NONE); } } ``` -### AssessmentOptionsOperations_Get +### AksSummaryOperations_Get ```java /** - * Samples for AssessmentOptionsOperations Get. + * Samples for AksSummaryOperations Get. */ -public final class AssessmentOptionsOperationsGetSamples { +public final class AksSummaryOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentOptionsOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksSummaryOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: AssessmentOptionsOperations_Get_MaximumSet_Gen. + * Sample code: AksSummaryOperations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentOptionsOperationsGetMaximumSetGen( + public static void aksSummaryOperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentOptionsOperations() - .getWithResponse("ayagrawrg", "app18700project", "default", com.azure.core.util.Context.NONE); + manager.aksSummaryOperations() + .getWithResponse("rgaksAssessments", "testProject", "testaksassessment", "AKS", + com.azure.core.util.Context.NONE); } } ``` -### AssessmentOptionsOperations_ListByAssessmentProject +### AksSummaryOperations_ListByParent ```java /** - * Samples for AssessmentOptionsOperations ListByAssessmentProject. + * Samples for AksSummaryOperations ListByParent. */ -public final class AssessmentOptionsOperationsListByAssessmentProjectSamples { +public final class AksSummaryOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentOptionsOperations_ListByAssessmentProject_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksSummaryOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: AssessmentOptionsOperations_ListByAssessmentProject_MaximumSet_Gen. + * Sample code: AksSummaryOperations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentOptionsOperationsListByAssessmentProjectMaximumSetGen( + public static void aksSummaryOperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentOptionsOperations() - .listByAssessmentProject("rgmigrate", "fhodvffhuoqwbysrrqbizete", com.azure.core.util.Context.NONE); + manager.aksSummaryOperations() + .listByParent("rgaksAssessments", "testProject", "testaksassessment", com.azure.core.util.Context.NONE); } } ``` -### AssessmentProjectSummaryOperations_Get +### AssessedMachinesV2Operations_Get ```java /** - * Samples for AssessmentProjectSummaryOperations Get. + * Samples for AssessedMachinesV2Operations Get. */ -public final class AssessmentProjectSummaryOperationsGetSamples { +public final class AssessedMachinesV2OperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentProjectSummaryOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedMachinesV2Operations_Get_MaximumSet_Gen.json */ /** - * Sample code: AssessmentProjectSummaryOperations_Get_MaximumSet_Gen. + * Sample code: AssessedMachinesV2Operations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentProjectSummaryOperationsGetMaximumSetGen( + public static void assessedMachinesV2OperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentProjectSummaryOperations() - .getWithResponse("piyushapp1", "PiyushApp15328project", "default", com.azure.core.util.Context.NONE); + manager.assessedMachinesV2Operations() + .getWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", "machine1", + com.azure.core.util.Context.NONE); } } ``` -### AssessmentProjectSummaryOperations_ListByAssessmentProject +### AssessedMachinesV2Operations_ListByParent ```java /** - * Samples for AssessmentProjectSummaryOperations ListByAssessmentProject. + * Samples for AssessedMachinesV2Operations ListByParent. */ -public final class AssessmentProjectSummaryOperationsListByAssessmentProjectSamples { +public final class AssessedMachinesV2OperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentProjectSummaryOperations_ListByAssessmentProject_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedMachinesV2Operations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: AssessmentProjectSummaryOperations_ListByAssessmentProject_MaximumSet_Gen. + * Sample code: AssessedMachinesV2Operations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentProjectSummaryOperationsListByAssessmentProjectMaximumSetGen( + public static void assessedMachinesV2OperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentProjectSummaryOperations() - .listByAssessmentProject("piyushapp1", "PiyushApp15328project", com.azure.core.util.Context.NONE); + manager.assessedMachinesV2Operations() + .listByParent("rgmachineAssessments", "contosoProject", "assessmentName", "eabpcsewhenpdfcsjck", 13, + "lsuhpxtnundds", 28, com.azure.core.util.Context.NONE); } } ``` -### AssessmentProjectsOperations_Create +### AssessedSqlDatabaseV3Operations_Get ```java -import com.azure.resourcemanager.migration.assessment.models.ProjectProperties; -import com.azure.resourcemanager.migration.assessment.models.ProjectStatus; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for AssessmentProjectsOperations Create. + * Samples for AssessedSqlDatabaseV3Operations Get. */ -public final class AssessmentProjectsOperationsCreateSamples { +public final class AssessedSqlDatabaseV3OperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentProjectsOperations_Create_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedSqlDatabaseV3Operations_Get_MaximumSet_Gen.json */ /** - * Sample code: AssessmentProjectsOperations_Create_MaximumSet_Gen. + * Sample code: AssessedSqlDatabaseV3Operations_Get. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentProjectsOperationsCreateMaximumSetGen( + public static void assessedSqlDatabaseV3OperationsGet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentProjectsOperations() - .define("sakanwar1204project") - .withRegion("southeastasia") - .withExistingResourceGroup("sakanwar") - .withTags(mapOf("Migrate Project", "sakanwar-PE-SEA")) - .withProperties(new ProjectProperties().withProvisioningState(ProvisioningState.SUCCEEDED) - .withAssessmentSolutionId( - "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa") - .withProjectStatus(ProjectStatus.ACTIVE) - .withPublicNetworkAccess("Disabled") - .withCustomerStorageAccountArmId( - "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa")) - .create(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + manager.assessedSqlDatabaseV3Operations() + .getWithResponse("rgsqlAssessments", "contosoProject", "assessmentName", "db1", + com.azure.core.util.Context.NONE); } } ``` -### AssessmentProjectsOperations_Delete +### AssessedSqlDatabaseV3Operations_ListByParent ```java /** - * Samples for AssessmentProjectsOperations Delete. + * Samples for AssessedSqlDatabaseV3Operations ListByParent. */ -public final class AssessmentProjectsOperationsDeleteSamples { +public final class AssessedSqlDatabaseV3OperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentProjectsOperations_Delete_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedSqlDatabaseV3Operations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: AssessmentProjectsOperations_Delete_MaximumSet_Gen. + * Sample code: AssessedSqlDatabaseV3Operations_ListByParent. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentProjectsOperationsDeleteMaximumSetGen( + public static void assessedSqlDatabaseV3OperationsListByParent( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentProjectsOperations() - .deleteByResourceGroupWithResponse("rgmigrate", "zqrsyncwahgydqvwuchkfd", com.azure.core.util.Context.NONE); + manager.assessedSqlDatabaseV3Operations() + .listByParent("rgsqlAssessments", "contosoProject", "assessmentName", "cbywgnphlxhqdkrnzgylmumtbtbocx", 11, + "ahjkwi", 11, com.azure.core.util.Context.NONE); } } ``` -### AssessmentProjectsOperations_GetByResourceGroup +### AssessedSqlInstanceV3Operations_Get ```java /** - * Samples for AssessmentProjectsOperations GetByResourceGroup. + * Samples for AssessedSqlInstanceV3Operations Get. */ -public final class AssessmentProjectsOperationsGetByResourceGroupSamples { +public final class AssessedSqlInstanceV3OperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentProjectsOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedSqlInstanceV3Operations_Get_MaximumSet_Gen.json */ /** - * Sample code: AssessmentProjectsOperations_Get_MaximumSet_Gen. + * Sample code: AssessedSqlInstanceV3Operations_Get. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentProjectsOperationsGetMaximumSetGen( + public static void assessedSqlInstanceV3OperationsGet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentProjectsOperations() - .getByResourceGroupWithResponse("sakanwar", "sakanwar1204project", com.azure.core.util.Context.NONE); + manager.assessedSqlInstanceV3Operations() + .getWithResponse("rgsqlAssessments", "contosoProject", "assessmentName", "sql1", + com.azure.core.util.Context.NONE); } } ``` -### AssessmentProjectsOperations_List +### AssessedSqlInstanceV3Operations_ListByParent ```java /** - * Samples for AssessmentProjectsOperations List. + * Samples for AssessedSqlInstanceV3Operations ListByParent. */ -public final class AssessmentProjectsOperationsListSamples { +public final class AssessedSqlInstanceV3OperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentProjectsOperations_ListBySubscription_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedSqlInstanceV3Operations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: AssessmentProjectsOperations_ListBySubscription_MaximumSet_Gen. + * Sample code: AssessedSqlInstanceV3Operations_ListByParent. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentProjectsOperationsListBySubscriptionMaximumSetGen( + public static void assessedSqlInstanceV3OperationsListByParent( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentProjectsOperations().list(com.azure.core.util.Context.NONE); + manager.assessedSqlInstanceV3Operations() + .listByParent("rgsqlAssessments", "contosoProject", "assessmentName", "tbkvgswkchdzuwegejuas", 30, + "tvblslp", 29, com.azure.core.util.Context.NONE); } } ``` -### AssessmentProjectsOperations_ListByResourceGroup +### AssessedSqlMachinesV3Operations_Get ```java /** - * Samples for AssessmentProjectsOperations ListByResourceGroup. + * Samples for AssessedSqlMachinesV3Operations Get. */ -public final class AssessmentProjectsOperationsListByResourceGroupSamples { +public final class AssessedSqlMachinesV3OperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentProjectsOperations_ListByResourceGroup_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedSqlMachinesV3Operations_Get_MaximumSet_Gen.json */ /** - * Sample code: AssessmentProjectsOperations_ListByResourceGroup_MaximumSet_Gen. + * Sample code: AssessedSqlMachinesV3Operations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentProjectsOperationsListByResourceGroupMaximumSetGen( + public static void assessedSqlMachinesV3OperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentProjectsOperations().listByResourceGroup("sakanwar", com.azure.core.util.Context.NONE); + manager.assessedSqlMachinesV3Operations() + .getWithResponse("rgsqlAssessments", "contosoProject", "assessmentName", "machine1", + com.azure.core.util.Context.NONE); } } ``` -### AssessmentProjectsOperations_Update +### AssessedSqlMachinesV3Operations_ListByParent ```java -import com.azure.resourcemanager.migration.assessment.models.AssessmentProject; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectUpdateProperties; -import com.azure.resourcemanager.migration.assessment.models.ProjectStatus; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for AssessmentProjectsOperations Update. + * Samples for AssessedSqlMachinesV3Operations ListByParent. */ -public final class AssessmentProjectsOperationsUpdateSamples { +public final class AssessedSqlMachinesV3OperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentProjectsOperations_Update_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedSqlMachinesV3Operations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: AssessmentProjectsOperations_Update_MaximumSet_Gen. + * Sample code: AssessedSqlMachinesV3Operations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentProjectsOperationsUpdateMaximumSetGen( + public static void assessedSqlMachinesV3OperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - AssessmentProject resource = manager.assessmentProjectsOperations() - .getByResourceGroupWithResponse("sakanwar", "sakanwar1204project", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("Migrate Project", "sakanwar-PE-SEA")) - .withProperties(new AssessmentProjectUpdateProperties().withAssessmentSolutionId( - "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa") - .withProjectStatus(ProjectStatus.ACTIVE) - .withPublicNetworkAccess("Disabled") - .withCustomerStorageAccountArmId( - "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa") - .withProvisioningState(ProvisioningState.SUCCEEDED)) - .apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + manager.assessedSqlMachinesV3Operations() + .listByParent("rgsqlAssessments", "contosoProject", "assessmentName", "xzirrhfzrsgksfgxerscseqkggcess", 27, + "vzjkdmjvvkeuvm", 30, com.azure.core.util.Context.NONE); } } ``` -### AssessmentsOperations_Create +### AssessedWebApplicationOperations_Get ```java -import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; -import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureDiskType; -import com.azure.resourcemanager.migration.assessment.models.AzureHybridUseBenefit; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.AzurePricingTier; -import com.azure.resourcemanager.migration.assessment.models.AzureReservedInstance; -import com.azure.resourcemanager.migration.assessment.models.AzureStorageRedundancy; -import com.azure.resourcemanager.migration.assessment.models.AzureVmFamily; -import com.azure.resourcemanager.migration.assessment.models.MachineAssessmentProperties; -import com.azure.resourcemanager.migration.assessment.models.Percentile; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.TimeRange; -import com.azure.resourcemanager.migration.assessment.models.VmUptime; -import java.time.OffsetDateTime; -import java.util.Arrays; - /** - * Samples for AssessmentsOperations Create. + * Samples for AssessedWebApplicationOperations Get. */ -public final class AssessmentsOperationsCreateSamples { +public final class AssessedWebApplicationOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentsOperations_Create_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedWebApplicationOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: AssessmentsOperations_Create_MaximumSet_Gen. + * Sample code: AssessedWebApplicationOperations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentsOperationsCreateMaximumSetGen( + public static void assessedWebApplicationOperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentsOperations() - .define("asm1") - .withExistingGroup("ayagrawrg", "app18700project", "kuchatur-test") - .withProperties(new MachineAssessmentProperties().withProvisioningState(ProvisioningState.SUCCEEDED) - .withEaSubscriptionId("kwsu") - .withAzurePricingTier(AzurePricingTier.STANDARD) - .withAzureStorageRedundancy(AzureStorageRedundancy.UNKNOWN) - .withReservedInstance(AzureReservedInstance.NONE) - .withAzureHybridUseBenefit(AzureHybridUseBenefit.UNKNOWN) - .withAzureDiskTypes(Arrays.asList(AzureDiskType.PREMIUM, AzureDiskType.STANDARD_SSD)) - .withAzureVmFamilies( - Arrays.asList(AzureVmFamily.D_SERIES, AzureVmFamily.LSV2_SERIES, AzureVmFamily.M_SERIES, - AzureVmFamily.MDSV2_SERIES, AzureVmFamily.MSV2_SERIES, AzureVmFamily.MV2_SERIES)) - .withVmUptime(new VmUptime().withDaysPerMonth(13).withHoursPerDay(26)) - .withAzureLocation("njxbwdtsxzhichsnk") - .withAzureOfferCode(AzureOfferCode.UNKNOWN) - .withCurrency(AzureCurrency.UNKNOWN) - .withScalingFactor(24.0F) - .withPercentile(Percentile.PERCENTILE50) - .withTimeRange(TimeRange.DAY) - .withPerfDataStartTime(OffsetDateTime.parse("2023-09-26T09:36:48.491Z")) - .withPerfDataEndTime(OffsetDateTime.parse("2023-09-26T09:36:48.491Z")) - .withDiscountPercentage(6.0F) - .withSizingCriterion(AssessmentSizingCriterion.PERFORMANCE_BASED)) - .create(); + manager.assessedWebApplicationOperations() + .getWithResponse("rgaksAssessments", "testProject", "testaksassessment", "webapp", + com.azure.core.util.Context.NONE); } } ``` -### AssessmentsOperations_Delete +### AssessedWebApplicationOperations_ListByParent ```java /** - * Samples for AssessmentsOperations Delete. + * Samples for AssessedWebApplicationOperations ListByParent. */ -public final class AssessmentsOperationsDeleteSamples { +public final class AssessedWebApplicationOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentsOperations_Delete_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedWebApplicationOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: AssessmentsOperations_Delete_MaximumSet_Gen. + * Sample code: AssessedWebApplicationOperations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentsOperationsDeleteMaximumSetGen( + public static void assessedWebApplicationOperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentsOperations() - .deleteWithResponse("ayagrawrg", "app18700project", "kuchatur-test", "asm1", - com.azure.core.util.Context.NONE); + manager.assessedWebApplicationOperations() + .listByParent("rgaksAssessments", "testProject", "testaksassessment", com.azure.core.util.Context.NONE); } } ``` -### AssessmentsOperations_DownloadUrl +### AssessedWebAppsV3Operations_Get ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; - /** - * Samples for AssessmentsOperations DownloadUrl. + * Samples for AssessedWebAppsV3Operations Get. */ -public final class AssessmentsOperationsDownloadUrlSamples { +public final class AssessedWebAppsV3OperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentsOperations_DownloadUrl_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedWebAppsV3Operations_Get_MaximumSet_Gen.json */ /** - * Sample code: AssessmentsOperations_DownloadUrl_MaximumSet_Gen. + * Sample code: AssessedWebAppsV3Operations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentsOperationsDownloadUrlMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { - manager.assessmentsOperations() - .downloadUrl("ayagrawrg", "app18700project", "kuchatur-test", "asm1", - SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON), + public static void assessedWebAppsV3OperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.assessedWebAppsV3Operations() + .getWithResponse("rgwebAppAssessments", "contosoProject", "assessmentName", "webapp1", com.azure.core.util.Context.NONE); } } ``` -### AssessmentsOperations_Get +### AssessedWebAppsV3Operations_ListByParent ```java /** - * Samples for AssessmentsOperations Get. + * Samples for AssessedWebAppsV3Operations ListByParent. */ -public final class AssessmentsOperationsGetSamples { +public final class AssessedWebAppsV3OperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentsOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedWebAppsV3Operations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: AssessmentsOperations_Get_MaximumSet_Gen. + * Sample code: AssessedWebAppsV3Operations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentsOperationsGetMaximumSetGen( + public static void assessedWebAppsV3OperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentsOperations() - .getWithResponse("ayagrawrg", "app18700project", "kuchatur-test", "asm1", com.azure.core.util.Context.NONE); + manager.assessedWebAppsV3Operations() + .listByParent("rgwebAppAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); } } ``` -### AssessmentsOperations_ListByGroup +### AssessmentProjectSummaryOperations_Get ```java /** - * Samples for AssessmentsOperations ListByGroup. + * Samples for AssessmentProjectSummaryOperations Get. */ -public final class AssessmentsOperationsListByGroupSamples { +public final class AssessmentProjectSummaryOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentsOperations_ListByGroup_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessmentProjectSummaryOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: AssessmentsOperations_ListByGroup_MaximumSet_Gen. + * Sample code: AssessmentProjectSummaryOperations_Get. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentsOperationsListByGroupMaximumSetGen( + public static void assessmentProjectSummaryOperationsGet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentsOperations() - .listByGroup("ayagrawrg", "app18700project", "kuchatur-test", com.azure.core.util.Context.NONE); + manager.assessmentProjectSummaryOperations() + .getWithResponse("piyushapp1", "PiyushApp15328project", "default", com.azure.core.util.Context.NONE); } } ``` -### AvsAssessedMachinesOperations_Get +### AssessmentProjectSummaryOperations_ListByParent ```java /** - * Samples for AvsAssessedMachinesOperations Get. + * Samples for AssessmentProjectSummaryOperations ListByParent. */ -public final class AvsAssessedMachinesOperationsGetSamples { +public final class AssessmentProjectSummaryOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessedMachinesOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessmentProjectSummaryOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: AvsAssessedMachinesOperations_Get_MaximumSet_Gen. + * Sample code: AssessmentProjectSummaryOperations_ListByParent. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void avsAssessedMachinesOperationsGetMaximumSetGen( + public static void assessmentProjectSummaryOperationsListByParent( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessedMachinesOperations() - .getWithResponse("ayagrawrg", "app18700project", "kuchatur-test", "asm2", - "b6d6fc6f-796f-4c16-96af-a6d22e0f12f7", com.azure.core.util.Context.NONE); + manager.assessmentProjectSummaryOperations() + .listByParent("piyushapp1", "PiyushApp15328project", com.azure.core.util.Context.NONE); } } ``` -### AvsAssessedMachinesOperations_ListByAvsAssessment +### AssessmentProjectsOperations_Create ```java +import com.azure.resourcemanager.migration.assessment.models.ProjectProperties; +import com.azure.resourcemanager.migration.assessment.models.ProjectStatus; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for AvsAssessedMachinesOperations ListByAvsAssessment. + * Samples for AssessmentProjectsOperations Create. */ -public final class AvsAssessedMachinesOperationsListByAvsAssessmentSamples { +public final class AssessmentProjectsOperationsCreateSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessedMachinesOperations_ListByAvsAssessment_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessmentProjectsOperations_Create_MaximumSet_Gen.json */ /** - * Sample code: AvsAssessedMachinesOperations_ListByAvsAssessment_MaximumSet_Gen. + * Sample code: AssessmentProjectsOperations_Create. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void avsAssessedMachinesOperationsListByAvsAssessmentMaximumSetGen( + public static void assessmentProjectsOperationsCreate( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessedMachinesOperations() - .listByAvsAssessment("ayagrawrg", "app18700project", "kuchatur-test", "asm2", "ujmwhhuloficljxcjyc", 6, - "qwrjeiukbcicfrkqlqsfukfc", 19, com.azure.core.util.Context.NONE); + manager.assessmentProjectsOperations() + .define("sakanwar1204project") + .withRegion("southeastasia") + .withExistingResourceGroup("sakanwar") + .withTags(mapOf("Migrate Project", "sakanwar-PE-SEA")) + .withProperties(new ProjectProperties().withAssessmentSolutionId( + "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa") + .withProjectStatus(ProjectStatus.ACTIVE) + .withPublicNetworkAccess("Disabled") + .withCustomerStorageAccountArmId( + "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### AvsAssessmentOptionsOperations_Get +### AssessmentProjectsOperations_Delete ```java /** - * Samples for AvsAssessmentOptionsOperations Get. + * Samples for AssessmentProjectsOperations Delete. */ -public final class AvsAssessmentOptionsOperationsGetSamples { +public final class AssessmentProjectsOperationsDeleteSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessmentOptionsOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessmentProjectsOperations_Delete_MaximumSet_Gen.json */ /** - * Sample code: AvsAssessmentOptionsOperations_Get_MaximumSet_Gen. + * Sample code: AssessmentProjectsOperations_Delete. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void avsAssessmentOptionsOperationsGetMaximumSetGen( + public static void assessmentProjectsOperationsDelete( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessmentOptionsOperations() - .getWithResponse("ayagrawrg", "app18700project", "default", com.azure.core.util.Context.NONE); + manager.assessmentProjectsOperations() + .deleteByResourceGroupWithResponse("rgmigrate", "zqrsyncwahgydqvwuchkfd", com.azure.core.util.Context.NONE); } } ``` -### AvsAssessmentOptionsOperations_ListByAssessmentProject +### AssessmentProjectsOperations_GetByResourceGroup ```java /** - * Samples for AvsAssessmentOptionsOperations ListByAssessmentProject. + * Samples for AssessmentProjectsOperations GetByResourceGroup. */ -public final class AvsAssessmentOptionsOperationsListByAssessmentProjectSamples { +public final class AssessmentProjectsOperationsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessmentOptionsOperations_ListByAssessmentProject_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessmentProjectsOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: AvsAssessmentOptionsOperations_ListByAssessmentProject_MaximumSet_Gen. + * Sample code: AssessmentProjectsOperations_Get. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void avsAssessmentOptionsOperationsListByAssessmentProjectMaximumSetGen( + public static void assessmentProjectsOperationsGet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessmentOptionsOperations() - .listByAssessmentProject("ayagrawrg", "app18700project", com.azure.core.util.Context.NONE); + manager.assessmentProjectsOperations() + .getByResourceGroupWithResponse("sakanwar", "sakanwar1204project", com.azure.core.util.Context.NONE); } } ``` -### AvsAssessmentsOperations_Create +### AssessmentProjectsOperations_List ```java -import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentProperties; -import com.azure.resourcemanager.migration.assessment.models.AzureAvsNodeType; -import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.AzureReservedInstance; -import com.azure.resourcemanager.migration.assessment.models.FttAndRaidLevel; -import com.azure.resourcemanager.migration.assessment.models.Percentile; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.TimeRange; -import java.time.OffsetDateTime; - /** - * Samples for AvsAssessmentsOperations Create. + * Samples for AssessmentProjectsOperations List. */ -public final class AvsAssessmentsOperationsCreateSamples { +public final class AssessmentProjectsOperationsListSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessmentsOperations_Create_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessmentProjectsOperations_ListBySubscription_MaximumSet_Gen.json */ /** - * Sample code: AvsAssessmentsOperations_Create_MaximumSet_Gen. + * Sample code: AssessmentProjectsOperations_ListBySubscription. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void avsAssessmentsOperationsCreateMaximumSetGen( + public static void assessmentProjectsOperationsListBySubscription( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessmentsOperations() - .define("asm2") - .withExistingGroup("ayagrawrg", "app18700project", "kuchatur-test") - .withProperties(new AvsAssessmentProperties().withProvisioningState(ProvisioningState.SUCCEEDED) - .withFailuresToTolerateAndRaidLevel(FttAndRaidLevel.FTT1RAID1) - .withVcpuOversubscription(4.0F) - .withNodeType(AzureAvsNodeType.AV36) - .withReservedInstance(AzureReservedInstance.RI3YEAR) - .withMemOvercommit(1.0F) - .withDedupeCompression(1.5F) - .withIsStretchClusterEnabled(true) - .withAzureLocation(AzureLocation.EAST_US) - .withAzureOfferCode(AzureOfferCode.MSAZR0003P) - .withCurrency(AzureCurrency.USD) - .withScalingFactor(1.0F) - .withPercentile(Percentile.PERCENTILE95) - .withTimeRange(TimeRange.DAY) - .withPerfDataStartTime(OffsetDateTime.parse("2023-09-25T13:35:56.5671462Z")) - .withPerfDataEndTime(OffsetDateTime.parse("2023-09-26T13:35:56.5671462Z")) - .withDiscountPercentage(0.0F) - .withSizingCriterion(AssessmentSizingCriterion.AS_ON_PREMISES)) - .create(); + manager.assessmentProjectsOperations().list(com.azure.core.util.Context.NONE); } } ``` -### AvsAssessmentsOperations_Delete +### AssessmentProjectsOperations_ListByResourceGroup ```java /** - * Samples for AvsAssessmentsOperations Delete. + * Samples for AssessmentProjectsOperations ListByResourceGroup. */ -public final class AvsAssessmentsOperationsDeleteSamples { +public final class AssessmentProjectsOperationsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessmentsOperations_Delete_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessmentProjectsOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: AvsAssessmentsOperations_Delete_MaximumSet_Gen. + * Sample code: AssessmentProjectsOperations_ListByParent. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void avsAssessmentsOperationsDeleteMaximumSetGen( + public static void assessmentProjectsOperationsListByParent( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessmentsOperations() - .deleteWithResponse("ayagrawrg", "app18700project", "kuchatur-test", "asm2", - com.azure.core.util.Context.NONE); + manager.assessmentProjectsOperations().listByResourceGroup("sakanwar", com.azure.core.util.Context.NONE); } } ``` -### AvsAssessmentsOperations_DownloadUrl +### AssessmentProjectsOperations_Update ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; +import com.azure.resourcemanager.migration.assessment.models.AssessmentProject; +import com.azure.resourcemanager.migration.assessment.models.ProjectProperties; +import com.azure.resourcemanager.migration.assessment.models.ProjectStatus; +import java.util.HashMap; +import java.util.Map; /** - * Samples for AvsAssessmentsOperations DownloadUrl. + * Samples for AssessmentProjectsOperations Update. */ -public final class AvsAssessmentsOperationsDownloadUrlSamples { +public final class AssessmentProjectsOperationsUpdateSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessmentsOperations_DownloadUrl_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessmentProjectsOperations_Update_MaximumSet_Gen.json */ /** - * Sample code: AvsAssessmentsOperations_DownloadUrl_MaximumSet_Gen. + * Sample code: AssessmentProjectsOperations_Update. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void avsAssessmentsOperationsDownloadUrlMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { - manager.avsAssessmentsOperations() - .downloadUrl("ayagrawrg", "app18700project", "kuchatur-test", "asm2", - SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON), - com.azure.core.util.Context.NONE); + public static void assessmentProjectsOperationsUpdate( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + AssessmentProject resource = manager.assessmentProjectsOperations() + .getByResourceGroupWithResponse("sakanwar", "sakanwar1204project", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("Migrate Project", "sakanwar-PE-SEA")) + .withProperties(new ProjectProperties().withAssessmentSolutionId( + "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa") + .withProjectStatus(ProjectStatus.ACTIVE) + .withPublicNetworkAccess("Disabled") + .withCustomerStorageAccountArmId( + "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa")) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### AvsAssessmentsOperations_Get +### AvsAssessedMachinesV2Operations_Get ```java /** - * Samples for AvsAssessmentsOperations Get. + * Samples for AvsAssessedMachinesV2Operations Get. */ -public final class AvsAssessmentsOperationsGetSamples { +public final class AvsAssessedMachinesV2OperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessmentsOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessedMachinesV2Operations_Get_MaximumSet_Gen.json */ /** - * Sample code: AvsAssessmentsOperations_Get_MaximumSet_Gen. + * Sample code: AvsAssessedMachinesV2Operations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void avsAssessmentsOperationsGetMaximumSetGen( + public static void avsAssessedMachinesV2OperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessmentsOperations() - .getWithResponse("ayagrawrg", "app18700project", "kuchatur-test", "asm2", com.azure.core.util.Context.NONE); + manager.avsAssessedMachinesV2Operations() + .getWithResponse("rgavsAssessments", "contosoProject", "assessmentName", "machine1", + com.azure.core.util.Context.NONE); } } ``` -### AvsAssessmentsOperations_ListByGroup +### AvsAssessedMachinesV2Operations_ListByParent ```java /** - * Samples for AvsAssessmentsOperations ListByGroup. + * Samples for AvsAssessedMachinesV2Operations ListByParent. */ -public final class AvsAssessmentsOperationsListByGroupSamples { +public final class AvsAssessedMachinesV2OperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessmentsOperations_ListByGroup_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessedMachinesV2Operations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: AvsAssessmentsOperations_ListByGroup_MaximumSet_Gen. + * Sample code: AvsAssessedMachinesV2Operations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void avsAssessmentsOperationsListByGroupMaximumSetGen( + public static void avsAssessedMachinesV2OperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessmentsOperations() - .listByGroup("ayagrawrg", "app18700project", "kuchatur-test", com.azure.core.util.Context.NONE); + manager.avsAssessedMachinesV2Operations() + .listByParent("rgavsAssessments", "contosoProject", "assessmentName", "ozyotnnfedxreohjtgfqxmefn", 26, + "vhdrqptyyromhgz", 7, com.azure.core.util.Context.NONE); } } ``` -### GroupsOperations_Create +### AvsAssessmentV2SummaryOperations_Get ```java -import com.azure.resourcemanager.migration.assessment.models.GroupProperties; -import com.azure.resourcemanager.migration.assessment.models.GroupType; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; - /** - * Samples for GroupsOperations Create. + * Samples for AvsAssessmentV2SummaryOperations Get. */ -public final class GroupsOperationsCreateSamples { +public final class AvsAssessmentV2SummaryOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * GroupsOperations_Create_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: GroupsOperations_Create_MaximumSet_Gen. + * Sample code: AvsAssessmentV2SummaryOperations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void groupsOperationsCreateMaximumSetGen( + public static void avsAssessmentV2SummaryOperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.groupsOperations() - .define("kuchatur-test") - .withExistingAssessmentProject("ayagrawrg", "app18700project") - .withProperties(new GroupProperties().withProvisioningState(ProvisioningState.SUCCEEDED) - .withGroupType(GroupType.DEFAULT)) - .create(); + manager.avsAssessmentV2SummaryOperations() + .getWithResponse("rgavsAssessments", "contosoProject", "assessmentName", "PaaSPreferred", + com.azure.core.util.Context.NONE); } } ``` -### GroupsOperations_Delete +### AvsAssessmentV2SummaryOperations_ListByParent ```java /** - * Samples for GroupsOperations Delete. + * Samples for AvsAssessmentV2SummaryOperations ListByParent. */ -public final class GroupsOperationsDeleteSamples { +public final class AvsAssessmentV2SummaryOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * GroupsOperations_Delete_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessmentV2SummaryOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: GroupsOperations_Delete_MaximumSet_Gen. + * Sample code: AvsAssessmentV2SummaryOperations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void groupsOperationsDeleteMaximumSetGen( + public static void avsAssessmentV2SummaryOperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.groupsOperations() - .deleteWithResponse("ayagrawrg", "app18700project", "kuchatur-test", com.azure.core.util.Context.NONE); + manager.avsAssessmentV2SummaryOperations() + .listByParent("rgavsAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); } } ``` -### GroupsOperations_Get +### AvsAssessmentsV2Operations_Create ```java +import com.azure.resourcemanager.migration.assessment.models.AssessmentDetails; +import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentPropertiesV2; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentScenario; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentSettings; +import com.azure.resourcemanager.migration.assessment.models.AzureAvsNodeType; +import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; +import com.azure.resourcemanager.migration.assessment.models.AzureOffer; +import com.azure.resourcemanager.migration.assessment.models.BillingSettings; +import com.azure.resourcemanager.migration.assessment.models.EnvironmentType; +import com.azure.resourcemanager.migration.assessment.models.ExternalStorageType; +import com.azure.resourcemanager.migration.assessment.models.FttAndRaidLevel; +import com.azure.resourcemanager.migration.assessment.models.LicensingProgram; +import com.azure.resourcemanager.migration.assessment.models.Percentile; +import com.azure.resourcemanager.migration.assessment.models.PerformanceData; +import com.azure.resourcemanager.migration.assessment.models.SavingsOptions; +import com.azure.resourcemanager.migration.assessment.models.SavingsSettings; +import com.azure.resourcemanager.migration.assessment.models.Scope; +import com.azure.resourcemanager.migration.assessment.models.ScopeType; +import com.azure.resourcemanager.migration.assessment.models.TimeRange; +import java.time.OffsetDateTime; +import java.util.Arrays; + /** - * Samples for GroupsOperations Get. + * Samples for AvsAssessmentsV2Operations Create. */ -public final class GroupsOperationsGetSamples { +public final class AvsAssessmentsV2OperationsCreateSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * GroupsOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessmentsV2Operations_Create_MaximumSet_Gen.json */ /** - * Sample code: GroupsOperations_Get_MaximumSet_Gen. + * Sample code: AvsAssessmentsV2Operations_Create_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void groupsOperationsGetMaximumSetGen( + public static void avsAssessmentsV2OperationsCreateMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.groupsOperations() - .getWithResponse("ayagrawrg", "app18700project", "kuchatur-test", com.azure.core.util.Context.NONE); + manager.avsAssessmentsV2Operations() + .define("assessmentName") + .withExistingAssessmentProject("rgavsAssessments", "contosoProject") + .withProperties(new AvsAssessmentPropertiesV2() + .withScope(new Scope().withScopeType(ScopeType.SERVER_GROUP_ID) + .withServerGroupId("fxonspfmzfuiaepr") + .withAzureResourceGraphQuery("ylnfwgptlyzwzkotmunbx")) + .withSettings(new AvsAssessmentSettings().withAzureLocation("actuloeieva") + .withCurrency(AzureCurrency.UNKNOWN) + .withScalingFactor(28.0F) + .withDiscountPercentage(27.0F) + .withSizingCriterion(AssessmentSizingCriterion.PERFORMANCE_BASED) + .withPerformanceData(new PerformanceData().withPercentile(Percentile.fromString("Unknown")) + .withTimeRange(TimeRange.DAY) + .withPerfDataStartTime(OffsetDateTime.parse("2025-02-21T05:36:34.751Z")) + .withPerfDataEndTime(OffsetDateTime.parse("2025-02-21T05:36:34.751Z"))) + .withSavingsSettings(new SavingsSettings().withSavingsOptions(SavingsOptions.NONE) + .withAzureOfferCode(AzureOffer.UNKNOWN)) + .withBillingSettings(new BillingSettings().withLicensingProgram(LicensingProgram.RETAIL) + .withSubscriptionId("xvtuenxmmjuqlhgmvev")) + .withEnvironmentType(EnvironmentType.PRODUCTION) + .withFailuresToTolerateAndRaidLevelList(Arrays.asList(FttAndRaidLevel.UNKNOWN)) + .withVcpuOversubscription(25.0F) + .withNodeTypes(Arrays.asList(AzureAvsNodeType.UNKNOWN)) + .withAvsAssessmentScenario(AvsAssessmentScenario.UNKNOWN) + .withExternalStorageTypes(Arrays.asList(ExternalStorageType.UNKNOWN)) + .withCpuHeadroom(27.0F) + .withIsVcfByolEnabled(true) + .withMemOvercommit(11.0F) + .withDedupeCompression(26.0F) + .withIsStretchClusterEnabled(true)) + .withDetails(new AssessmentDetails()) + .withFallbackMachineAssessmentArmId("tpjvxfcyxsgngqdxyrrfh")) + .create(); } } ``` -### GroupsOperations_ListByAssessmentProject +### AvsAssessmentsV2Operations_Delete ```java /** - * Samples for GroupsOperations ListByAssessmentProject. + * Samples for AvsAssessmentsV2Operations Delete. */ -public final class GroupsOperationsListByAssessmentProjectSamples { +public final class AvsAssessmentsV2OperationsDeleteSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * GroupsOperations_ListByAssessmentProject_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessmentsV2Operations_Delete_MaximumSet_Gen.json */ /** - * Sample code: GroupsOperations_ListByAssessmentProject_MaximumSet_Gen. + * Sample code: AvsAssessmentsV2Operations_Delete_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void groupsOperationsListByAssessmentProjectMaximumSetGen( + public static void avsAssessmentsV2OperationsDeleteMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.groupsOperations() - .listByAssessmentProject("ayagrawrg", "app18700project", com.azure.core.util.Context.NONE); + manager.avsAssessmentsV2Operations() + .deleteWithResponse("rgavsAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); } } ``` -### GroupsOperations_UpdateMachines +### AvsAssessmentsV2Operations_DownloadUrl ```java -import com.azure.resourcemanager.migration.assessment.models.GroupBodyProperties; -import com.azure.resourcemanager.migration.assessment.models.GroupUpdateOperation; -import com.azure.resourcemanager.migration.assessment.models.UpdateGroupBody; -import java.util.Arrays; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; /** - * Samples for GroupsOperations UpdateMachines. + * Samples for AvsAssessmentsV2Operations DownloadUrl. */ -public final class GroupsOperationsUpdateMachinesSamples { +public final class AvsAssessmentsV2OperationsDownloadUrlSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * GroupsOperations_UpdateMachines_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessmentsV2Operations_DownloadUrl_MaximumSet_Gen.json */ /** - * Sample code: GroupsOperations_UpdateMachines_MaximumSet_Gen. + * Sample code: Get download URL for the assessment report. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void groupsOperationsUpdateMachinesMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.groupsOperations() - .updateMachines("ayagrawrg", "app18700project", "kuchatur-test", new UpdateGroupBody().withEtag("*") - .withProperties(new GroupBodyProperties().withOperationType(GroupUpdateOperation.ADD) - .withMachines(Arrays.asList( - "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawrg/providers/Microsoft.Migrate/assessmentprojects/app18700project/machines/18895660-c5e5-4247-8cfc-cd24e1fe57f3"))), + public static void getDownloadURLForTheAssessmentReport( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { + manager.avsAssessmentsV2Operations() + .downloadUrl("rgavsAssessments", "contosoProject", "assessmentName", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), com.azure.core.util.Context.NONE); } } ``` -### HypervCollectorsOperations_Create +### AvsAssessmentsV2Operations_Get ```java -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.time.OffsetDateTime; - /** - * Samples for HypervCollectorsOperations Create. + * Samples for AvsAssessmentsV2Operations Get. */ -public final class HypervCollectorsOperationsCreateSamples { +public final class AvsAssessmentsV2OperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * HypervCollectorsOperations_Create_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessmentsV2Operations_Get_MaximumSet_Gen.json */ /** - * Sample code: HypervCollectorsOperations_Create_MaximumSet_Gen. + * Sample code: AvsAssessmentsV2Operations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void hypervCollectorsOperationsCreateMaximumSetGen( + public static void avsAssessmentsV2OperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.hypervCollectorsOperations() - .define("test-697cecollector") - .withExistingAssessmentProject("ayagrawRG", "app18700project") - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.SUCCEEDED) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("12f1d90f-b3fa-4926-8893-e56803a09af0") - .withVersion("2.0.1993.19") - .withLastHeartbeatUtc(OffsetDateTime.parse("2022-07-07T14:25:35.708325Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase() - .withAuthority("https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47") - .withApplicationId("e3bd6eaa-980b-40ae-a30e-2a5069ba097c") - .withAudience("e3bd6eaa-980b-40ae-a30e-2a5069ba097c") - .withObjectId("01b9f9e2-2d82-414c-adaa-09ce259b6b44") - .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47"))) - .withDiscoverySiteId( - "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/HyperVSites/test-60527site")) - .create(); + manager.avsAssessmentsV2Operations() + .getWithResponse("rgavsAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); } } ``` -### HypervCollectorsOperations_Delete +### AvsAssessmentsV2Operations_ListByParent ```java /** - * Samples for HypervCollectorsOperations Delete. + * Samples for AvsAssessmentsV2Operations ListByParent. */ -public final class HypervCollectorsOperationsDeleteSamples { +public final class AvsAssessmentsV2OperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * HypervCollectorsOperations_Delete_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessmentsV2Operations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: HypervCollectorsOperations_Delete_MaximumSet_Gen. + * Sample code: AvsAssessmentsV2Operations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void hypervCollectorsOperationsDeleteMaximumSetGen( + public static void avsAssessmentsV2OperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.hypervCollectorsOperations() - .deleteWithResponse("ayagrawRG", "app18700project", "test-697cecollector", - com.azure.core.util.Context.NONE); + manager.avsAssessmentsV2Operations() + .listByParent("rgavsAssessments", "contosoProject", com.azure.core.util.Context.NONE); } } ``` -### HypervCollectorsOperations_Get +### AvsGraphAssessmentOptionsOperations_Get ```java /** - * Samples for HypervCollectorsOperations Get. + * Samples for AvsGraphAssessmentOptionsOperations Get. */ -public final class HypervCollectorsOperationsGetSamples { +public final class AvsGraphAssessmentOptionsOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * HypervCollectorsOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: HypervCollectorsOperations_Get_MaximumSet_Gen. + * Sample code: AvsGraphAssessmentOptionsOperations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void hypervCollectorsOperationsGetMaximumSetGen( + public static void avsGraphAssessmentOptionsOperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.hypervCollectorsOperations() - .getWithResponse("ayagrawRG", "app18700project", "test-697cecollector", com.azure.core.util.Context.NONE); + manager.avsGraphAssessmentOptionsOperations() + .getWithResponse("rgavsAssessments", "contosoProject", com.azure.core.util.Context.NONE); } } ``` -### HypervCollectorsOperations_ListByAssessmentProject +### AvsGraphAssessmentOptionsOperations_ListByParent ```java /** - * Samples for HypervCollectorsOperations ListByAssessmentProject. + * Samples for AvsGraphAssessmentOptionsOperations ListByParent. */ -public final class HypervCollectorsOperationsListByAssessmentProjectSamples { +public final class AvsGraphAssessmentOptionsOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * HypervCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: HypervCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen. + * Sample code: AvsGraphAssessmentOptionsOperations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void hypervCollectorsOperationsListByAssessmentProjectMaximumSetGen( + public static void avsGraphAssessmentOptionsOperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.hypervCollectorsOperations() - .listByAssessmentProject("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); + manager.avsGraphAssessmentOptionsOperations() + .listByParent("rgavsAssessments", "contosoProject", com.azure.core.util.Context.NONE); } } ``` -### ImportCollectorsOperations_Create +### BusinessCaseAvsSummaryOperations_Get ```java -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; - /** - * Samples for ImportCollectorsOperations Create. + * Samples for BusinessCaseAvsSummaryOperations Get. */ -public final class ImportCollectorsOperationsCreateSamples { +public final class BusinessCaseAvsSummaryOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * ImportCollectorsOperations_Create_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseAvsSummaryOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: ImportCollectorsOperations_Create_MaximumSet_Gen. + * Sample code: BusinessCaseAvsSummaryOperations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void importCollectorsOperationsCreateMaximumSetGen( + public static void businessCaseAvsSummaryOperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.importCollectorsOperations() - .define("importCollectore7d5") - .withExistingAssessmentProject("ayagrawRG", "app18700project") - .withProperties(new CollectorPropertiesBase().withProvisioningState(ProvisioningState.SUCCEEDED) - .withDiscoverySiteId( - "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourcegroups/ayagrawRG/providers/microsoft.offazure/importsites/actualSEA37d4importSite")) - .create(); + manager.businessCaseAvsSummaryOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MySummary", + com.azure.core.util.Context.NONE); } } ``` -### ImportCollectorsOperations_Delete +### BusinessCaseAvsSummaryOperations_ListByParent ```java /** - * Samples for ImportCollectorsOperations Delete. + * Samples for BusinessCaseAvsSummaryOperations ListByParent. */ -public final class ImportCollectorsOperationsDeleteSamples { +public final class BusinessCaseAvsSummaryOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * ImportCollectorsOperations_Delete_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseAvsSummaryOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: ImportCollectorsOperations_Delete_MaximumSet_Gen. + * Sample code: BusinessCaseAvsSummaryOperations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void importCollectorsOperationsDeleteMaximumSetGen( + public static void businessCaseAvsSummaryOperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.importCollectorsOperations() - .deleteWithResponse("ayagrawRG", "app18700project", "importCollectore7d5", - com.azure.core.util.Context.NONE); + manager.businessCaseAvsSummaryOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", com.azure.core.util.Context.NONE); } } ``` -### ImportCollectorsOperations_Get +### BusinessCaseIaasSummaryOperations_Get ```java /** - * Samples for ImportCollectorsOperations Get. + * Samples for BusinessCaseIaasSummaryOperations Get. */ -public final class ImportCollectorsOperationsGetSamples { +public final class BusinessCaseIaasSummaryOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * ImportCollectorsOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseIaasSummaryOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: ImportCollectorsOperations_Get_MaximumSet_Gen. + * Sample code: BusinessCaseIaasSummaryOperations_Get_MaximumSet - generated by [MaximumSet] rule. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void importCollectorsOperationsGetMaximumSetGen( + public static void businessCaseIaasSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.importCollectorsOperations() - .getWithResponse("ayagrawRG", "app18700project", "importCollectore7d5", com.azure.core.util.Context.NONE); + manager.businessCaseIaasSummaryOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MySummary", + com.azure.core.util.Context.NONE); } } ``` -### ImportCollectorsOperations_ListByAssessmentProject +### BusinessCaseIaasSummaryOperations_ListByParent ```java /** - * Samples for ImportCollectorsOperations ListByAssessmentProject. + * Samples for BusinessCaseIaasSummaryOperations ListByParent. */ -public final class ImportCollectorsOperationsListByAssessmentProjectSamples { +public final class BusinessCaseIaasSummaryOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * ImportCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseIaasSummaryOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: ImportCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen. + * Sample code: BusinessCaseIaasSummaryOperations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void importCollectorsOperationsListByAssessmentProjectMaximumSetGen( + public static void businessCaseIaasSummaryOperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.importCollectorsOperations() - .listByAssessmentProject("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); + manager.businessCaseIaasSummaryOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", com.azure.core.util.Context.NONE); } } ``` -### MachinesOperations_Get +### BusinessCaseOperations_CompareSummary ```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + /** - * Samples for MachinesOperations Get. + * Samples for BusinessCaseOperations CompareSummary. */ -public final class MachinesOperationsGetSamples { +public final class BusinessCaseOperationsCompareSummarySamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * MachinesOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOperations_CompareSummary_MaximumSet_Gen.json */ /** - * Sample code: MachinesOperations_Get_MaximumSet_Gen. + * Sample code: Get Compare summary report for Business case. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void machinesOperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.machinesOperations() - .getWithResponse("ayagrawrg", "app18700project", "55082b89-99e2-4c40-b63f-d4f4d6ba961d", + public static void getCompareSummaryReportForBusinessCase( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { + manager.businessCaseOperations() + .compareSummary("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), com.azure.core.util.Context.NONE); } } ``` -### MachinesOperations_ListByAssessmentProject +### BusinessCaseOperations_Create ```java +import com.azure.resourcemanager.migration.assessment.models.AzureArcManagementSettings; +import com.azure.resourcemanager.migration.assessment.models.AzureArcMonitoringSettings; +import com.azure.resourcemanager.migration.assessment.models.AzureArcSettings; +import com.azure.resourcemanager.migration.assessment.models.AzureArcState; +import com.azure.resourcemanager.migration.assessment.models.AzureSettings; +import com.azure.resourcemanager.migration.assessment.models.AzureSettingsPerYearMigrationCompletionPercentageItem; +import com.azure.resourcemanager.migration.assessment.models.BusinessCaseCurrency; +import com.azure.resourcemanager.migration.assessment.models.BusinessCaseProperties; +import com.azure.resourcemanager.migration.assessment.models.ComputeSettings; +import com.azure.resourcemanager.migration.assessment.models.DiscoverySource; +import com.azure.resourcemanager.migration.assessment.models.FacilitySettings; +import com.azure.resourcemanager.migration.assessment.models.HyperVLicenseType; +import com.azure.resourcemanager.migration.assessment.models.HypervLicense; +import com.azure.resourcemanager.migration.assessment.models.HypervVirtualizationManagementSettings; +import com.azure.resourcemanager.migration.assessment.models.LaborSettings; +import com.azure.resourcemanager.migration.assessment.models.LinuxServerLicensingSettings; +import com.azure.resourcemanager.migration.assessment.models.ManagementSettings; +import com.azure.resourcemanager.migration.assessment.models.MigrationStrategy; +import com.azure.resourcemanager.migration.assessment.models.NetworkSettings; +import com.azure.resourcemanager.migration.assessment.models.OnPremiseSettings; +import com.azure.resourcemanager.migration.assessment.models.OtherManagementCostsSettings; +import com.azure.resourcemanager.migration.assessment.models.SavingsOption; +import com.azure.resourcemanager.migration.assessment.models.SecuritySettings; +import com.azure.resourcemanager.migration.assessment.models.Settings; +import com.azure.resourcemanager.migration.assessment.models.SqlServerLicenseType; +import com.azure.resourcemanager.migration.assessment.models.SqlServerLicensingSettings; +import com.azure.resourcemanager.migration.assessment.models.StorageSettings; +import com.azure.resourcemanager.migration.assessment.models.ThirdPartyManagementSettings; +import com.azure.resourcemanager.migration.assessment.models.VirtualizationSoftwareSettings; +import com.azure.resourcemanager.migration.assessment.models.WindowsServerLicensingSettings; +import java.time.OffsetDateTime; +import java.util.Arrays; + /** - * Samples for MachinesOperations ListByAssessmentProject. + * Samples for BusinessCaseOperations Create. */ -public final class MachinesOperationsListByAssessmentProjectSamples { +public final class BusinessCaseOperationsCreateSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * MachinesOperations_ListByAssessmentProject_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOperations_Create_MaximumSet_Gen.json */ /** - * Sample code: MachinesOperations_ListByAssessmentProject_MaximumSet_Gen. + * Sample code: BusinessCaseOperations_Create_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void machinesOperationsListByAssessmentProjectMaximumSetGen( + public static void businessCaseOperationsCreateMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.machinesOperations() - .listByAssessmentProject("ayagrawrg", "app18700project", null, 1, null, 1, - com.azure.core.util.Context.NONE); + manager.businessCaseOperations() + .define("MyBusinessCase") + .withExistingAssessmentProject("rgbusinessCases", "MyMigrateProject") + .withProperties(new BusinessCaseProperties().withSettings(new Settings() + .withAzureSettings(new AzureSettings().withTargetLocation("hpocokeckktxpzilk") + .withDiscountPercentage(48.0F) + .withCurrency(BusinessCaseCurrency.UNKNOWN) + .withBusinessCaseType(MigrationStrategy.UNKNOWN) + .withWorkloadDiscoverySource(DiscoverySource.UNKNOWN) + .withPerformanceDataStartTime(OffsetDateTime.parse("2024-11-14T10:27:58.436Z")) + .withPerformanceDataEndTime(OffsetDateTime.parse("2024-11-14T10:27:58.436Z")) + .withComfortFactor(19.0F) + .withPerformanceUtilizationPercentile(93.0F) + .withPerYearMigrationCompletionPercentage(Arrays.asList( + new AzureSettingsPerYearMigrationCompletionPercentageItem().withName("cthxvjhedpsnbddvyghswtgp") + .withValue(13.0F))) + .withInfrastructureGrowthRate(79.0F) + .withWacc(43.0F) + .withNetworkCostPercentage(81.0F) + .withIaasLaborCostPercentage(51.0F) + .withPaasLaborCostPercentage(13.0F) + .withAvsLaborCostPercentage(2.0F) + .withSavingsOption(SavingsOption.UNKNOWN)) + .withOnPremiseSettings(new OnPremiseSettings() + .withComputeSettings(new ComputeSettings().withHyperthreadCoreToMemoryRatio(26f) + .withPrice(8f) + .withComputeHardwareMaintenanceCost(1f) + .withVmOversubscriptionRatio(10f) + .withCpuOversubscriptionRatio(10f) + .withSqlServerLicensing( + Arrays.asList(new SqlServerLicensingSettings().withVersion(SqlServerLicenseType.UNKNOWN) + .withLicenseCost(28f) + .withSoftwareAssuranceCost(27f))) + .withWindowsServerLicensing(new WindowsServerLicensingSettings().withLicenseCost(2f) + .withSoftwareAssuranceCost(6f) + .withLicensesPerCore(21)) + .withRhelLinuxServerLicensing(new LinuxServerLicensingSettings().withLicenseCost(7f)) + .withSuseLinuxServerLicensing(new LinuxServerLicensingSettings().withLicenseCost(7f)) + .withVirtualizationSoftwareSettings( + new VirtualizationSoftwareSettings().withVMwareCloudFoundationLicenseCost(23f))) + .withStorageSettings(new StorageSettings().withCostPerGbPerYear(12f) + .withMaintainanceCostPercentageToAcquisitionCost(5f)) + .withNetworkSettings(new NetworkSettings().withMaintenanceCostPercentage(84f) + .withPhysicalServersPerCabinet(18) + .withAverageCostPerCabinet(27f)) + .withFacilitySettings( + new FacilitySettings().withFacilitiesCostPerKwh(1.0F).withPowerUtilizationEfficiency(25f)) + .withLaborSettings(new LaborSettings().withPhysicalServersPerAdmin(16) + .withVirtualMachinesPerAdmin(18) + .withHourlyAdminCost(22f)) + .withSecuritySettings(new SecuritySettings().withServerSecurityCostPerServerPerYear(6f) + .withSqlServerSecurityCostPerServerPerYear(10f)) + .withManagementSettings( + new ManagementSettings() + .withHypervVirtualizationManagementSettings( + new HypervVirtualizationManagementSettings().withNumberOfPhysicalCoresPerLicense(8) + .withSoftwareAssuranceCost(15f) + .withLicenseAndSupportList(Arrays.asList(new HypervLicense().withLicenseCost(1f) + .withLicenseType(HyperVLicenseType.UNKNOWN)))) + .withThirdPartyManagementSettings( + new ThirdPartyManagementSettings().withLicenseCost(1f).withSupportCost(13f)) + .withOtherManagementCostsSettings( + new OtherManagementCostsSettings().withMonitoringCostPerServerPerYear(2f) + .withPatchingCostPerServerPerYear(28f) + .withDataProtectionCostPerServerPerYear(4f)))) + .withAzureArcSettings(new AzureArcSettings().withAzureArcState(AzureArcState.DISABLED) + .withLaborCostPercentage(46.0F) + .withManagementSettings(new AzureArcManagementSettings().withMonitoringSettings( + new AzureArcMonitoringSettings().withLogsVolumeInGB(17f).withAlertRulesCount(19)))))) + .create(); } } ``` -### Operations_List +### BusinessCaseOperations_Delete ```java /** - * Samples for Operations List. + * Samples for BusinessCaseOperations Delete. */ -public final class OperationsListSamples { +public final class BusinessCaseOperationsDeleteSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * Operations_List_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOperations_Delete_MaximumSet_Gen.json */ /** - * Sample code: Operations_List_MaximumSet_Gen. + * Sample code: BusinessCaseOperations_Delete_MaximumSet - generated by [MaximumSet] rule. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void - operationsListMaximumSetGen(com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void businessCaseOperationsDeleteMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.businessCaseOperations() + .deleteWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", + com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnectionOperations_Delete +### BusinessCaseOperations_Get ```java /** - * Samples for PrivateEndpointConnectionOperations Delete. + * Samples for BusinessCaseOperations Get. */ -public final class PrivateEndpointConnectionOperationsDeleteSamples { +public final class BusinessCaseOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * PrivateEndpointConnectionOperations_Delete_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: PrivateEndpointConnectionOperations_Delete_MaximumSet_Gen. + * Sample code: BusinessCaseOperations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void privateEndpointConnectionOperationsDeleteMaximumSetGen( + public static void businessCaseOperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.privateEndpointConnectionOperations() - .deleteWithResponse("sakanwar", "sakanwar1204project", - "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7", com.azure.core.util.Context.NONE); + manager.businessCaseOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnectionOperations_Get +### BusinessCaseOperations_GetReportDownloadUrl ```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + /** - * Samples for PrivateEndpointConnectionOperations Get. + * Samples for BusinessCaseOperations GetReportDownloadUrl. */ -public final class PrivateEndpointConnectionOperationsGetSamples { +public final class BusinessCaseOperationsGetReportDownloadUrlSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * PrivateEndpointConnectionOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOperations_GetReportDownloadUrl_MaximumSet_Gen.json */ /** - * Sample code: PrivateEndpointConnectionOperations_Get_MaximumSet_Gen. + * Sample code: Get download URL for the business case report. - generated by [MaximumSet] rule. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void privateEndpointConnectionOperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.privateEndpointConnectionOperations() - .getWithResponse("sakanwar", "sakanwar1204project", - "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7", com.azure.core.util.Context.NONE); + public static void getDownloadURLForTheBusinessCaseReportGeneratedByMaximumSetRule( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { + manager.businessCaseOperations() + .getReportDownloadUrl("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnectionOperations_ListByAssessmentProject +### BusinessCaseOperations_ListByParent ```java /** - * Samples for PrivateEndpointConnectionOperations ListByAssessmentProject. + * Samples for BusinessCaseOperations ListByParent. */ -public final class PrivateEndpointConnectionOperationsListByAssessmentProjectSamples { +public final class BusinessCaseOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * PrivateEndpointConnectionOperations_ListByAssessmentProject_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: PrivateEndpointConnectionOperations_ListByAssessmentProject_MaximumSet_Gen. + * Sample code: BusinessCaseOperations_ListByParent_MaximumSet - generated by [MaximumSet] rule. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void privateEndpointConnectionOperationsListByAssessmentProjectMaximumSetGen( + public static void businessCaseOperationsListByParentMaximumSetGeneratedByMaximumSetRule( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.privateEndpointConnectionOperations() - .listByAssessmentProject("sakanwar", "sakanwar1204project", com.azure.core.util.Context.NONE); + manager.businessCaseOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnectionOperations_Update +### BusinessCaseOverviewSummaryOperations_Get ```java -import com.azure.resourcemanager.migration.assessment.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpoint; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.migration.assessment.models.PrivateLinkServiceConnectionState; - /** - * Samples for PrivateEndpointConnectionOperations Update. + * Samples for BusinessCaseOverviewSummaryOperations Get. */ -public final class PrivateEndpointConnectionOperationsUpdateSamples { +public final class BusinessCaseOverviewSummaryOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * PrivateEndpointConnectionOperations_Update_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOverviewSummaryOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: PrivateEndpointConnectionOperations_Update_MaximumSet_Gen. + * Sample code: BusinessCaseOverviewSummaryOperations_Get_MaximumSet - generated by [MaximumSet] rule. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void privateEndpointConnectionOperationsUpdateMaximumSetGen( + public static void businessCaseOverviewSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.privateEndpointConnectionOperations() - .update("sakanwar", "sakanwar1204project", "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7", - new PrivateEndpointConnectionInner() - .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withActionsRequired(""))), + manager.businessCaseOverviewSummaryOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MySummary", com.azure.core.util.Context.NONE); } } ``` -### PrivateLinkResourceOperations_Get +### BusinessCaseOverviewSummaryOperations_ListByParent ```java /** - * Samples for PrivateLinkResourceOperations Get. + * Samples for BusinessCaseOverviewSummaryOperations ListByParent. */ -public final class PrivateLinkResourceOperationsGetSamples { +public final class BusinessCaseOverviewSummaryOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * PrivateLinkResourceOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOverviewSummaryOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: PrivateLinkResourceOperations_Get_MaximumSet_Gen. + * Sample code: BusinessCaseOverviewSummaryOperations_ListByParent_MaximumSet - generated by [MaximumSet] rule. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void privateLinkResourceOperationsGetMaximumSetGen( + public static void businessCaseOverviewSummaryOperationsListByParentMaximumSetGeneratedByMaximumSetRule( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.privateLinkResourceOperations() - .getWithResponse("sakanwar", "sakanwar1204project", "Default", com.azure.core.util.Context.NONE); + manager.businessCaseOverviewSummaryOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", com.azure.core.util.Context.NONE); } } ``` -### PrivateLinkResourceOperations_ListByAssessmentProject +### BusinessCasePaasSummaryOperations_Get ```java /** - * Samples for PrivateLinkResourceOperations ListByAssessmentProject. + * Samples for BusinessCasePaasSummaryOperations Get. */ -public final class PrivateLinkResourceOperationsListByAssessmentProjectSamples { +public final class BusinessCasePaasSummaryOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * PrivateLinkResourceOperations_ListByAssessmentProject_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCasePaasSummaryOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: PrivateLinkResourceOperations_ListByAssessmentProject_MaximumSet_Gen. + * Sample code: BusinessCasePaasSummaryOperations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void privateLinkResourceOperationsListByAssessmentProjectMaximumSetGen( + public static void businessCasePaasSummaryOperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.privateLinkResourceOperations() - .listByAssessmentProject("sakanwar", "sakanwar1204project", com.azure.core.util.Context.NONE); + manager.businessCasePaasSummaryOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MySummary", + com.azure.core.util.Context.NONE); } } ``` -### ServerCollectorsOperations_Create +### BusinessCasePaasSummaryOperations_ListByParent ```java -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; - /** - * Samples for ServerCollectorsOperations Create. + * Samples for BusinessCasePaasSummaryOperations ListByParent. */ -public final class ServerCollectorsOperationsCreateSamples { +public final class BusinessCasePaasSummaryOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * ServerCollectorsOperations_Create_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCasePaasSummaryOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: ServerCollectorsOperations_Create_MaximumSet_Gen. + * Sample code: BusinessCasePaasSummaryOperations_ListByParent_MaximumSet - generated by [MaximumSet] rule. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void serverCollectorsOperationsCreateMaximumSetGen( + public static void businessCasePaasSummaryOperationsListByParentMaximumSetGeneratedByMaximumSetRule( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.serverCollectorsOperations() - .define("walter389fcollector") - .withExistingAssessmentProject("ayagrawRG", "app18700project") - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.SUCCEEDED) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("498e4965-bbb1-47c2-8613-345baff9c509") - .withSpnDetails(new CollectorAgentSpnPropertiesBase() - .withAuthority("https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47") - .withApplicationId("65153d2f-9afb-44e8-b3ca-1369150b7354") - .withAudience("65153d2f-9afb-44e8-b3ca-1369150b7354") - .withObjectId("ddde6f96-87c8-420b-9d4d-f16a5090519e") - .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47"))) - .withDiscoverySiteId( - "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/ServerSites/walter7155site")) - .create(); + manager.businessCasePaasSummaryOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", com.azure.core.util.Context.NONE); } } ``` -### ServerCollectorsOperations_Delete +### CompoundAssessmentOperations_Create ```java +import com.azure.resourcemanager.migration.assessment.models.CompoundAssessmentProperties; +import com.azure.resourcemanager.migration.assessment.models.TargetAssessmentArmIds; + /** - * Samples for ServerCollectorsOperations Delete. + * Samples for CompoundAssessmentOperations Create. */ -public final class ServerCollectorsOperationsDeleteSamples { +public final class CompoundAssessmentOperationsCreateSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * ServerCollectorsOperations_Delete_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * CompoundAssessmentOperations_Create_MaximumSet_Gen.json */ /** - * Sample code: ServerCollectorsOperations_Delete_MaximumSet_Gen. + * Sample code: CompoundAssessmentOperations_Create. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void serverCollectorsOperationsDeleteMaximumSetGen( + public static void compoundAssessmentOperationsCreate( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.serverCollectorsOperations() - .deleteWithResponse("ayagrawRG", "app18700project", "walter389fcollector", - com.azure.core.util.Context.NONE); + manager.compoundAssessmentOperations() + .define("assessmentName") + .withExistingAssessmentProject("rgwebAppCompoundAssessments", "contosoProject") + .withProperties(new CompoundAssessmentProperties().withTargetAssessmentArmIds(new TargetAssessmentArmIds() + .withAks( + "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/aksAssessments/nameOfAssessment") + .withAzureAppService( + "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/webAppAssessments/nameOfAssessment") + .withAzureAppServiceContainer( + "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/webAppAssessments/nameOfAssessment")) + .withFallbackMachineAssessmentArmId( + "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/assessments/nameOfAssessment")) + .create(); } } ``` -### ServerCollectorsOperations_Get +### CompoundAssessmentOperations_Delete ```java /** - * Samples for ServerCollectorsOperations Get. + * Samples for CompoundAssessmentOperations Delete. */ -public final class ServerCollectorsOperationsGetSamples { +public final class CompoundAssessmentOperationsDeleteSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * ServerCollectorsOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * CompoundAssessmentOperations_Delete_MaximumSet_Gen.json */ /** - * Sample code: ServerCollectorsOperations_Get_MaximumSet_Gen. + * Sample code: CompoundAssessmentOperations_Delete. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void serverCollectorsOperationsGetMaximumSetGen( + public static void compoundAssessmentOperationsDelete( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.serverCollectorsOperations() - .getWithResponse("ayagrawRG", "app18700project", "walter389fcollector", com.azure.core.util.Context.NONE); + manager.compoundAssessmentOperations() + .deleteWithResponse("rgwebAppCompoundAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); } } ``` -### ServerCollectorsOperations_ListByAssessmentProject +### CompoundAssessmentOperations_DownloadUrl ```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + /** - * Samples for ServerCollectorsOperations ListByAssessmentProject. + * Samples for CompoundAssessmentOperations DownloadUrl. */ -public final class ServerCollectorsOperationsListByAssessmentProjectSamples { +public final class CompoundAssessmentOperationsDownloadUrlSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * ServerCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * CompoundAssessmentOperations_DownloadUrl_MaximumSet_Gen.json */ /** - * Sample code: ServerCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen. + * Sample code: CompoundAssessmentOperations_DownloadUrl. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void serverCollectorsOperationsListByAssessmentProjectMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.serverCollectorsOperations() - .listByAssessmentProject("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); + public static void compoundAssessmentOperationsDownloadUrl( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { + manager.compoundAssessmentOperations() + .downloadUrl("rgwebAppCompoundAssessments", "contosoProject", "assessmentName", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); } } ``` -### SqlAssessmentOptionsOperations_Get +### CompoundAssessmentOperations_Get ```java /** - * Samples for SqlAssessmentOptionsOperations Get. + * Samples for CompoundAssessmentOperations Get. */ -public final class SqlAssessmentOptionsOperationsGetSamples { +public final class CompoundAssessmentOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentOptionsOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * CompoundAssessmentOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: SqlAssessmentOptionsOperations_Get_MaximumSet_Gen. + * Sample code: CompoundAssessmentOperations_Get. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void sqlAssessmentOptionsOperationsGetMaximumSetGen( + public static void compoundAssessmentOperationsGet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentOptionsOperations() - .getWithResponse("rgmigrate", "fci-test6904project", "default", com.azure.core.util.Context.NONE); + manager.compoundAssessmentOperations() + .getWithResponse("rgwebAppCompoundAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); } } ``` -### SqlAssessmentOptionsOperations_ListByAssessmentProject +### CompoundAssessmentOperations_ListByParent ```java /** - * Samples for SqlAssessmentOptionsOperations ListByAssessmentProject. + * Samples for CompoundAssessmentOperations ListByParent. */ -public final class SqlAssessmentOptionsOperationsListByAssessmentProjectSamples { +public final class CompoundAssessmentOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentOptionsOperations_ListByAssessmentProject_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * CompoundAssessmentOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: SqlAssessmentOptionsOperations_ListByAssessmentProject_MaximumSet_Gen. + * Sample code: CompoundAssessmentOperations_ListByParent. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void sqlAssessmentOptionsOperationsListByAssessmentProjectMaximumSetGen( + public static void compoundAssessmentOperationsListByParent( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentOptionsOperations() - .listByAssessmentProject("rgmigrate", "fci-test6904project", com.azure.core.util.Context.NONE); + manager.compoundAssessmentOperations() + .listByParent("rgwebAppCompoundAssessments", "contosoProject", com.azure.core.util.Context.NONE); } } ``` -### SqlAssessmentV2Operations_Create +### CompoundAssessmentSummaryOperations_Get ```java -import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; +/** + * Samples for CompoundAssessmentSummaryOperations Get. + */ +public final class CompoundAssessmentSummaryOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * CompoundAssessmentSummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: CompoundAssessmentSummaryOperations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void compoundAssessmentSummaryOperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.compoundAssessmentSummaryOperations() + .getWithResponse("rgwebAppCompoundAssessments", "contosoProject", "assessmentName", "Modernize", + com.azure.core.util.Context.NONE); + } +} +``` + +### CompoundAssessmentSummaryOperations_ListByParent + +```java +/** + * Samples for CompoundAssessmentSummaryOperations ListByParent. + */ +public final class CompoundAssessmentSummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * CompoundAssessmentSummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: CompoundAssessmentSummaryOperations_ListByParent. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void compoundAssessmentSummaryOperationsListByParent( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.compoundAssessmentSummaryOperations() + .listByParent("rgwebAppCompoundAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} +``` + +### EvaluatedAvsMachinesOperations_Get + +```java +/** + * Samples for EvaluatedAvsMachinesOperations Get. + */ +public final class EvaluatedAvsMachinesOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedAvsMachinesOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedAvsMachinesOperations_Get_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedAvsMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedAvsMachinesOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MyMachine", + com.azure.core.util.Context.NONE); + } +} +``` + +### EvaluatedAvsMachinesOperations_ListByParent + +```java +/** + * Samples for EvaluatedAvsMachinesOperations ListByParent. + */ +public final class EvaluatedAvsMachinesOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedAvsMachinesOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedAvsMachinesOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedAvsMachinesOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedAvsMachinesOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "fknroh", 18, "kri", 12, + com.azure.core.util.Context.NONE); + } +} +``` + +### EvaluatedMachinesOperations_Get + +```java +/** + * Samples for EvaluatedMachinesOperations Get. + */ +public final class EvaluatedMachinesOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedMachinesOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedMachinesOperations_Get_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedMachinesOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MyMachine", + com.azure.core.util.Context.NONE); + } +} +``` + +### EvaluatedMachinesOperations_ListByParent + +```java +/** + * Samples for EvaluatedMachinesOperations ListByParent. + */ +public final class EvaluatedMachinesOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedMachinesOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedMachinesOperations_ListByParent_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedMachinesOperationsListByParentMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedMachinesOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "wzky", 24, "eoevgdmtpkbhlgyglvsa", + 6, com.azure.core.util.Context.NONE); + } +} +``` + +### EvaluatedSqlEntitiesOperations_Get + +```java +/** + * Samples for EvaluatedSqlEntitiesOperations Get. + */ +public final class EvaluatedSqlEntitiesOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedSqlEntitiesOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedSqlEntitiesOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedSqlEntitiesOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedSqlEntitiesOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MyEntity", + com.azure.core.util.Context.NONE); + } +} +``` + +### EvaluatedSqlEntitiesOperations_ListByParent + +```java +/** + * Samples for EvaluatedSqlEntitiesOperations ListByParent. + */ +public final class EvaluatedSqlEntitiesOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedSqlEntitiesOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedSqlEntitiesOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedSqlEntitiesOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedSqlEntitiesOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "luzlkremkujtmqjmc", 13, "bnmyic", + 23, com.azure.core.util.Context.NONE); + } +} +``` + +### EvaluatedWebAppsOperations_Get + +```java +/** + * Samples for EvaluatedWebAppsOperations Get. + */ +public final class EvaluatedWebAppsOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedWebAppsOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedWebAppsOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedWebAppsOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedWebAppsOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MyWebApp", + com.azure.core.util.Context.NONE); + } +} +``` + +### EvaluatedWebAppsOperations_ListByParent + +```java +/** + * Samples for EvaluatedWebAppsOperations ListByParent. + */ +public final class EvaluatedWebAppsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedWebAppsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedWebAppsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedWebAppsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedWebAppsOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "krlcuqeagsjdbbjthvwqqu", 20, + "giprsbjufkenlzmqf", 12, com.azure.core.util.Context.NONE); + } +} +``` + +### HeterogeneousAssessmentOperations_Create + +```java +import com.azure.resourcemanager.migration.assessment.models.HeterogeneousAssessmentProperties; +import java.util.Arrays; + +/** + * Samples for HeterogeneousAssessmentOperations Create. + */ +public final class HeterogeneousAssessmentOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HeterogeneousAssessmentOperations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: HeterogeneousAssessmentOperations_Create. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void heterogeneousAssessmentOperationsCreate( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.heterogeneousAssessmentOperations() + .define("assessmentName") + .withExistingAssessmentProject("rgheterogeneousAssessments", "contosoProject") + .withProperties( + new HeterogeneousAssessmentProperties().withAssessmentArmIds(Arrays.asList("gartykxgfvqccfs"))) + .create(); + } +} +``` + +### HeterogeneousAssessmentOperations_Delete + +```java +/** + * Samples for HeterogeneousAssessmentOperations Delete. + */ +public final class HeterogeneousAssessmentOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HeterogeneousAssessmentOperations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: HeterogeneousAssessmentOperations_Delete. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void heterogeneousAssessmentOperationsDelete( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.heterogeneousAssessmentOperations() + .deleteWithResponse("rgheterogeneousAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} +``` + +### HeterogeneousAssessmentOperations_Get + +```java +/** + * Samples for HeterogeneousAssessmentOperations Get. + */ +public final class HeterogeneousAssessmentOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HeterogeneousAssessmentOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: HeterogeneousAssessmentOperations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void heterogeneousAssessmentOperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.heterogeneousAssessmentOperations() + .getWithResponse("rgheterogeneousAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} +``` + +### HeterogeneousAssessmentOperations_ListByParent + +```java +/** + * Samples for HeterogeneousAssessmentOperations ListByParent. + */ +public final class HeterogeneousAssessmentOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HeterogeneousAssessmentOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: HeterogeneousAssessmentOperations_ListByParent. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void heterogeneousAssessmentOperationsListByParent( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.heterogeneousAssessmentOperations() + .listByParent("rgheterogeneousAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} +``` + +### HeterogeneousAssessmentSummaryOperations_Get + +```java +/** + * Samples for HeterogeneousAssessmentSummaryOperations Get. + */ +public final class HeterogeneousAssessmentSummaryOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HeterogeneousAssessmentSummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: HeterogeneousAssessmentSummaryOperations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void heterogeneousAssessmentSummaryOperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.heterogeneousAssessmentSummaryOperations() + .getWithResponse("rgheterogeneousAssessments", "contosoProject", "assessmentName", "PaaSPreferred", + com.azure.core.util.Context.NONE); + } +} +``` + +### HeterogeneousAssessmentSummaryOperations_ListByParent + +```java +/** + * Samples for HeterogeneousAssessmentSummaryOperations ListByParent. + */ +public final class HeterogeneousAssessmentSummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HeterogeneousAssessmentSummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: HeterogeneousAssessmentSummaryOperations_ListByParent. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void heterogeneousAssessmentSummaryOperationsListByParent( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.heterogeneousAssessmentSummaryOperations() + .listByParent("rgheterogeneousAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} +``` + +### HypervCollectorsOperations_Create + +```java +import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; +import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; +import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; +import java.time.OffsetDateTime; + +/** + * Samples for HypervCollectorsOperations Create. + */ +public final class HypervCollectorsOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HypervCollectorsOperations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: HypervCollectorsOperations_Create. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void hypervCollectorsOperationsCreate( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.hypervCollectorsOperations() + .define("test-697cecollector") + .withExistingAssessmentProject("ayagrawRG", "app18700project") + .withProperties(new CollectorPropertiesBaseWithAgent() + .withAgentProperties(new CollectorAgentPropertiesBase().withId("12f1d90f-b3fa-4926-8893-e56803a09af0") + .withVersion("2.0.1993.19") + .withLastHeartbeatUtc(OffsetDateTime.parse("2022-07-07T14:25:35.708325Z")) + .withSpnDetails(new CollectorAgentSpnPropertiesBase() + .withAuthority("https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47") + .withApplicationId("e3bd6eaa-980b-40ae-a30e-2a5069ba097c") + .withAudience("e3bd6eaa-980b-40ae-a30e-2a5069ba097c") + .withObjectId("01b9f9e2-2d82-414c-adaa-09ce259b6b44") + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47"))) + .withDiscoverySiteId( + "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/HyperVSites/test-60527site")) + .create(); + } +} +``` + +### HypervCollectorsOperations_Delete + +```java +/** + * Samples for HypervCollectorsOperations Delete. + */ +public final class HypervCollectorsOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HypervCollectorsOperations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: HypervCollectorsOperations_Delete. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void hypervCollectorsOperationsDelete( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.hypervCollectorsOperations() + .deleteWithResponse("ayagrawRG", "app18700project", "test-697cecollector", + com.azure.core.util.Context.NONE); + } +} +``` + +### HypervCollectorsOperations_Get + +```java +/** + * Samples for HypervCollectorsOperations Get. + */ +public final class HypervCollectorsOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HypervCollectorsOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: HypervCollectorsOperations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void hypervCollectorsOperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.hypervCollectorsOperations() + .getWithResponse("ayagrawRG", "app18700project", "test-697cecollector", com.azure.core.util.Context.NONE); + } +} +``` + +### HypervCollectorsOperations_ListByParent + +```java +/** + * Samples for HypervCollectorsOperations ListByParent. + */ +public final class HypervCollectorsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HypervCollectorsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: HypervCollectorsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void hypervCollectorsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.hypervCollectorsOperations() + .listByParent("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); + } +} +``` + +### ImportCollectorsOperations_Create + +```java +import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBase; + +/** + * Samples for ImportCollectorsOperations Create. + */ +public final class ImportCollectorsOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ImportCollectorsOperations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: ImportCollectorsOperations_Create. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void importCollectorsOperationsCreate( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.importCollectorsOperations() + .define("importCollectore7d5") + .withExistingAssessmentProject("ayagrawRG", "app18700project") + .withProperties(new CollectorPropertiesBase().withDiscoverySiteId( + "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourcegroups/ayagrawRG/providers/microsoft.offazure/importsites/actualSEA37d4importSite")) + .create(); + } +} +``` + +### ImportCollectorsOperations_Delete + +```java +/** + * Samples for ImportCollectorsOperations Delete. + */ +public final class ImportCollectorsOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ImportCollectorsOperations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ImportCollectorsOperations_Delete. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void importCollectorsOperationsDelete( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.importCollectorsOperations() + .deleteWithResponse("ayagrawRG", "app18700project", "importCollectore7d5", + com.azure.core.util.Context.NONE); + } +} +``` + +### ImportCollectorsOperations_Get + +```java +/** + * Samples for ImportCollectorsOperations Get. + */ +public final class ImportCollectorsOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ImportCollectorsOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ImportCollectorsOperations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void importCollectorsOperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.importCollectorsOperations() + .getWithResponse("ayagrawRG", "app18700project", "importCollectore7d5", com.azure.core.util.Context.NONE); + } +} +``` + +### ImportCollectorsOperations_ListByParent + +```java +/** + * Samples for ImportCollectorsOperations ListByParent. + */ +public final class ImportCollectorsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ImportCollectorsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: ImportCollectorsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void importCollectorsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.importCollectorsOperations() + .listByParent("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); + } +} +``` + +### ImportSqlCollectorOperations_Create + +```java +import com.azure.resourcemanager.migration.assessment.models.ImportSqlCollectorProperties; + +/** + * Samples for ImportSqlCollectorOperations Create. + */ +public final class ImportSqlCollectorOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ImportSqlCollectorOperations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: ImportSqlCollectorOperations_Create_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void importSqlCollectorOperationsCreateMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.importSqlCollectorOperations() + .define("importCollector") + .withExistingAssessmentProject("rgsqlAssessments", "contosoProject") + .withProperties(new ImportSqlCollectorProperties().withDiscoverySiteId( + "/subscriptions/C1DB66AE-BCF9-42FD-ADC2-390E0721C351/resourceGroups/rgsqlAssessments/providers/Microsoft.OffAzure/MasterSites/testproject8566mastersite/SqlSites/testproject8566sqlsites")) + .create(); + } +} +``` + +### ImportSqlCollectorOperations_Delete + +```java +/** + * Samples for ImportSqlCollectorOperations Delete. + */ +public final class ImportSqlCollectorOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ImportSqlCollectorOperations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ImportSqlCollectorOperations_Delete_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void importSqlCollectorOperationsDeleteMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.importSqlCollectorOperations() + .deleteWithResponse("rgsqlAssessments", "contosoProject", "importCollector", + com.azure.core.util.Context.NONE); + } +} +``` + +### ImportSqlCollectorOperations_Get + +```java +/** + * Samples for ImportSqlCollectorOperations Get. + */ +public final class ImportSqlCollectorOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ImportSqlCollectorOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ImportSqlCollectorOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void importSqlCollectorOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.importSqlCollectorOperations() + .getWithResponse("rgsqlAssessments", "contosoProject", "importCollector", com.azure.core.util.Context.NONE); + } +} +``` + +### ImportSqlCollectorOperations_ListByParent + +```java +/** + * Samples for ImportSqlCollectorOperations ListByParent. + */ +public final class ImportSqlCollectorOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ImportSqlCollectorOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: ImportSqlCollectorOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void importSqlCollectorOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.importSqlCollectorOperations() + .listByParent("rgsqlAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} +``` + +### MachineAssessmentV2SummaryOperations_Get + +```java +/** + * Samples for MachineAssessmentV2SummaryOperations Get. + */ +public final class MachineAssessmentV2SummaryOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentV2SummaryOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineAssessmentV2SummaryOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.machineAssessmentV2SummaryOperations() + .getWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", "PaaSPreferred", + com.azure.core.util.Context.NONE); + } +} +``` + +### MachineAssessmentV2SummaryOperations_ListByParent + +```java +/** + * Samples for MachineAssessmentV2SummaryOperations ListByParent. + */ +public final class MachineAssessmentV2SummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineAssessmentV2SummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentV2SummaryOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineAssessmentV2SummaryOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.machineAssessmentV2SummaryOperations() + .listByParent("rgmachineAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); + } +} +``` + +### MachineAssessmentsV2Operations_Create + +```java +import com.azure.resourcemanager.migration.assessment.models.AssessmentDetails; +import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; +import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; +import com.azure.resourcemanager.migration.assessment.models.AzureDiskType; +import com.azure.resourcemanager.migration.assessment.models.AzureHybridUseBenefit; +import com.azure.resourcemanager.migration.assessment.models.AzureOffer; +import com.azure.resourcemanager.migration.assessment.models.AzurePricingTier; +import com.azure.resourcemanager.migration.assessment.models.AzureSecurityOfferingType; +import com.azure.resourcemanager.migration.assessment.models.AzureStorageRedundancy; +import com.azure.resourcemanager.migration.assessment.models.AzureVmFamily; +import com.azure.resourcemanager.migration.assessment.models.BillingSettings; +import com.azure.resourcemanager.migration.assessment.models.EnvironmentType; +import com.azure.resourcemanager.migration.assessment.models.LicensingProgram; +import com.azure.resourcemanager.migration.assessment.models.MachineAssessmentSettings; +import com.azure.resourcemanager.migration.assessment.models.MachineAssessmentV2Properties; +import com.azure.resourcemanager.migration.assessment.models.Percentile; +import com.azure.resourcemanager.migration.assessment.models.PerformanceData; +import com.azure.resourcemanager.migration.assessment.models.SavingsOptions; +import com.azure.resourcemanager.migration.assessment.models.SavingsSettings; +import com.azure.resourcemanager.migration.assessment.models.Scope; +import com.azure.resourcemanager.migration.assessment.models.ScopeType; +import com.azure.resourcemanager.migration.assessment.models.TimeRange; +import com.azure.resourcemanager.migration.assessment.models.VmUptime; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for MachineAssessmentsV2Operations Create. + */ +public final class MachineAssessmentsV2OperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineAssessmentsV2Operations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_Create_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineAssessmentsV2OperationsCreateMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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.0F) + .withDiscountPercentage(5.0F) + .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))) + .withDetails(new AssessmentDetails())) + .create(); + } +} +``` + +### MachineAssessmentsV2Operations_Delete + +```java +/** + * Samples for MachineAssessmentsV2Operations Delete. + */ +public final class MachineAssessmentsV2OperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineAssessmentsV2Operations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_Delete_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineAssessmentsV2OperationsDeleteMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.machineAssessmentsV2Operations() + .deleteWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} +``` + +### MachineAssessmentsV2Operations_DownloadUrl + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for MachineAssessmentsV2Operations DownloadUrl. + */ +public final class MachineAssessmentsV2OperationsDownloadUrlSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineAssessmentsV2Operations_DownloadUrl_MaximumSet_Gen.json + */ + /** + * Sample code: Get download URL for the assessment report. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void getDownloadURLForTheAssessmentReport( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { + manager.machineAssessmentsV2Operations() + .downloadUrl("rgmachineAssessments", "contosoProject", "assessmentName", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } +} +``` + +### MachineAssessmentsV2Operations_Get + +```java +/** + * Samples for MachineAssessmentsV2Operations Get. + */ +public final class MachineAssessmentsV2OperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineAssessmentsV2Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineAssessmentsV2OperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.machineAssessmentsV2Operations() + .getWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} +``` + +### MachineAssessmentsV2Operations_ListByParent + +```java +/** + * Samples for MachineAssessmentsV2Operations ListByParent. + */ +public final class MachineAssessmentsV2OperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineAssessmentsV2Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineAssessmentsV2OperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.machineAssessmentsV2Operations() + .listByParent("rgmachineAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} +``` + +### MachineGraphAssessmentOptionsOperations_Get + +```java +/** + * Samples for MachineGraphAssessmentOptionsOperations Get. + */ +public final class MachineGraphAssessmentOptionsOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: MachineGraphAssessmentOptionsOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineGraphAssessmentOptionsOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.machineGraphAssessmentOptionsOperations() + .getWithResponse("rgmachineAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} +``` + +### MachineGraphAssessmentOptionsOperations_ListByParent + +```java +/** + * Samples for MachineGraphAssessmentOptionsOperations ListByParent. + */ +public final class MachineGraphAssessmentOptionsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: MachineGraphAssessmentOptionsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineGraphAssessmentOptionsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.machineGraphAssessmentOptionsOperations() + .listByParent("rgmachineAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void + operationsList(com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnectionOperations_Delete + +```java +/** + * Samples for PrivateEndpointConnectionOperations Delete. + */ +public final class PrivateEndpointConnectionOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * PrivateEndpointConnectionOperations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: PrivateEndpointConnectionOperations_Delete. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void privateEndpointConnectionOperationsDelete( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.privateEndpointConnectionOperations() + .deleteWithResponse("sakanwar", "sakanwar1204project", + "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnectionOperations_Get + +```java +/** + * Samples for PrivateEndpointConnectionOperations Get. + */ +public final class PrivateEndpointConnectionOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * PrivateEndpointConnectionOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: PrivateEndpointConnectionOperations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void privateEndpointConnectionOperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.privateEndpointConnectionOperations() + .getWithResponse("sakanwar", "sakanwar1204project", + "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnectionOperations_ListByParent + +```java +/** + * Samples for PrivateEndpointConnectionOperations ListByParent. + */ +public final class PrivateEndpointConnectionOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * PrivateEndpointConnectionOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: PrivateEndpointConnectionOperations_ListByParent. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void privateEndpointConnectionOperationsListByParent( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.privateEndpointConnectionOperations() + .listByParent("sakanwar", "sakanwar1204project", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnectionOperations_Update + +```java +import com.azure.resourcemanager.migration.assessment.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.migration.assessment.models.PrivateEndpoint; +import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.migration.assessment.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnectionOperations Update. + */ +public final class PrivateEndpointConnectionOperationsUpdateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * PrivateEndpointConnectionOperations_Update_MaximumSet_Gen.json + */ + /** + * Sample code: PrivateEndpointConnectionOperations_Update. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void privateEndpointConnectionOperationsUpdate( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.privateEndpointConnectionOperations() + .update("sakanwar", "sakanwar1204project", "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7", + new PrivateEndpointConnectionInner() + .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withActionsRequired(""))), + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResourceOperations_Get + +```java +/** + * Samples for PrivateLinkResourceOperations Get. + */ +public final class PrivateLinkResourceOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * PrivateLinkResourceOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: PrivateLinkResourceOperations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void privateLinkResourceOperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.privateLinkResourceOperations() + .getWithResponse("sakanwar", "sakanwar1204project", "Default", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResourceOperations_ListByParent + +```java +/** + * Samples for PrivateLinkResourceOperations ListByParent. + */ +public final class PrivateLinkResourceOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * PrivateLinkResourceOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: PrivateLinkResourceOperations_ListByParent. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void privateLinkResourceOperationsListByParent( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.privateLinkResourceOperations() + .listByParent("sakanwar", "sakanwar1204project", com.azure.core.util.Context.NONE); + } +} +``` + +### ServerCollectorsOperations_Create + +```java +import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; +import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; +import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; + +/** + * Samples for ServerCollectorsOperations Create. + */ +public final class ServerCollectorsOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ServerCollectorsOperations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: ServerCollectorsOperations_Create. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void serverCollectorsOperationsCreate( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.serverCollectorsOperations() + .define("walter389fcollector") + .withExistingAssessmentProject("ayagrawRG", "app18700project") + .withProperties(new CollectorPropertiesBaseWithAgent() + .withAgentProperties(new CollectorAgentPropertiesBase().withId("498e4965-bbb1-47c2-8613-345baff9c509") + .withSpnDetails(new CollectorAgentSpnPropertiesBase() + .withAuthority("https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47") + .withApplicationId("65153d2f-9afb-44e8-b3ca-1369150b7354") + .withAudience("65153d2f-9afb-44e8-b3ca-1369150b7354") + .withObjectId("ddde6f96-87c8-420b-9d4d-f16a5090519e") + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47"))) + .withDiscoverySiteId( + "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/ServerSites/walter7155site")) + .create(); + } +} +``` + +### ServerCollectorsOperations_Delete + +```java +/** + * Samples for ServerCollectorsOperations Delete. + */ +public final class ServerCollectorsOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ServerCollectorsOperations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ServerCollectorsOperations_Delete. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void serverCollectorsOperationsDelete( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.serverCollectorsOperations() + .deleteWithResponse("ayagrawRG", "app18700project", "walter389fcollector", + com.azure.core.util.Context.NONE); + } +} +``` + +### ServerCollectorsOperations_Get + +```java +/** + * Samples for ServerCollectorsOperations Get. + */ +public final class ServerCollectorsOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ServerCollectorsOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ServerCollectorsOperations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void serverCollectorsOperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.serverCollectorsOperations() + .getWithResponse("ayagrawRG", "app18700project", "walter389fcollector", com.azure.core.util.Context.NONE); + } +} +``` + +### ServerCollectorsOperations_ListByParent + +```java +/** + * Samples for ServerCollectorsOperations ListByParent. + */ +public final class ServerCollectorsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ServerCollectorsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: ServerCollectorsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void serverCollectorsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.serverCollectorsOperations() + .listByParent("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); + } +} +``` + +### SqlAssessmentV3Operations_Create + +```java +import com.azure.resourcemanager.migration.assessment.models.AssessmentDetails; +import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; import com.azure.resourcemanager.migration.assessment.models.AsyncCommitModeIntent; import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.AzureReservedInstance; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlDataBaseType; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlInstanceType; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlPurchaseModel; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlServiceTier; -import com.azure.resourcemanager.migration.assessment.models.AzureVmFamily; -import com.azure.resourcemanager.migration.assessment.models.ComputeTier; -import com.azure.resourcemanager.migration.assessment.models.EntityUptime; +import com.azure.resourcemanager.migration.assessment.models.AzureLocation; +import com.azure.resourcemanager.migration.assessment.models.AzureOffer; +import com.azure.resourcemanager.migration.assessment.models.AzureSecurityOfferingType; +import com.azure.resourcemanager.migration.assessment.models.AzureSqlDataBaseType; +import com.azure.resourcemanager.migration.assessment.models.AzureSqlInstanceType; +import com.azure.resourcemanager.migration.assessment.models.AzureSqlPurchaseModel; +import com.azure.resourcemanager.migration.assessment.models.AzureSqlServiceTierV3; +import com.azure.resourcemanager.migration.assessment.models.AzureTarget; +import com.azure.resourcemanager.migration.assessment.models.AzureVmFamily; +import com.azure.resourcemanager.migration.assessment.models.BillingSettings; +import com.azure.resourcemanager.migration.assessment.models.ComputeTier; +import com.azure.resourcemanager.migration.assessment.models.EntityUptime; +import com.azure.resourcemanager.migration.assessment.models.EnvironmentType; +import com.azure.resourcemanager.migration.assessment.models.LicensingProgram; +import com.azure.resourcemanager.migration.assessment.models.MultiSubnetIntent; +import com.azure.resourcemanager.migration.assessment.models.OsLicense; +import com.azure.resourcemanager.migration.assessment.models.Percentile; +import com.azure.resourcemanager.migration.assessment.models.PerformanceData; +import com.azure.resourcemanager.migration.assessment.models.SavingsOptions; +import com.azure.resourcemanager.migration.assessment.models.SavingsSettings; +import com.azure.resourcemanager.migration.assessment.models.Scope; +import com.azure.resourcemanager.migration.assessment.models.ScopeType; +import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentSettings; +import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV3Properties; +import com.azure.resourcemanager.migration.assessment.models.SqlDbSettingsV3; +import com.azure.resourcemanager.migration.assessment.models.SqlMiSettingsV3; +import com.azure.resourcemanager.migration.assessment.models.SqlServerLicense; +import com.azure.resourcemanager.migration.assessment.models.SqlVmSettings; +import com.azure.resourcemanager.migration.assessment.models.TimeRange; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for SqlAssessmentV3Operations Create. + */ +public final class SqlAssessmentV3OperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlAssessmentV3Operations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: SqlAssessmentV3Operations_Create_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlAssessmentV3OperationsCreateMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlAssessmentV3Operations() + .define("assessmentName") + .withExistingAssessmentProject("rgsqlAssessments", "contosoProject") + .withProperties(new SqlAssessmentV3Properties() + .withScope(new Scope().withScopeType(ScopeType.SERVER_GROUP_ID) + .withServerGroupId("ppxcjyrxfmpm") + .withAzureResourceGraphQuery("ddqs")) + .withSettings(new SqlAssessmentSettings().withAzureLocation("vtpazagckatiezkiwol") + .withCurrency(AzureCurrency.UNKNOWN) + .withScalingFactor(27.0F) + .withDiscountPercentage(8.0F) + .withSizingCriterion(AssessmentSizingCriterion.PERFORMANCE_BASED) + .withPerformanceData(new PerformanceData().withPercentile(Percentile.fromString("Unknown")) + .withTimeRange(TimeRange.DAY) + .withPerfDataStartTime(OffsetDateTime.parse("2025-02-21T05:15:28.133Z")) + .withPerfDataEndTime(OffsetDateTime.parse("2025-02-21T05:15:28.133Z"))) + .withSavingsSettings(new SavingsSettings().withSavingsOptions(SavingsOptions.NONE) + .withAzureOfferCode(AzureOffer.UNKNOWN)) + .withBillingSettings( + new BillingSettings().withLicensingProgram(LicensingProgram.RETAIL).withSubscriptionId("sp")) + .withEnvironmentType(EnvironmentType.PRODUCTION) + .withOsLicense(OsLicense.UNKNOWN) + .withEntityUptime(new EntityUptime().withDaysPerMonth(2).withHoursPerDay(28)) + .withPreferredTargets(Arrays.asList(AzureTarget.UNKNOWN)) + .withAzureSqlManagedInstanceSettings( + new SqlMiSettingsV3().withAzureSqlServiceTier(AzureSqlServiceTierV3.SQL_SERVICE_UNKNOWN) + .withAzureSqlInstanceType(AzureSqlInstanceType.UNKNOWN)) + .withAzureSqlDatabaseSettings( + new SqlDbSettingsV3().withAzureSqlServiceTier(AzureSqlServiceTierV3.SQL_SERVICE_UNKNOWN) + .withAzureSqlDataBaseType(AzureSqlDataBaseType.UNKNOWN) + .withAzureSqlComputeTier(ComputeTier.UNKNOWN) + .withAzureSqlPurchaseModel(AzureSqlPurchaseModel.UNKNOWN)) + .withAzureSqlVmSettings( + new SqlVmSettings().withInstanceSeries(Arrays.asList(AzureVmFamily.UNKNOWN))) + .withMultiSubnetIntent(MultiSubnetIntent.NONE) + .withAsyncCommitModeIntent(AsyncCommitModeIntent.NONE) + .withIsInternetAccessAvailable(true) + .withDisasterRecoveryLocation(AzureLocation.UNKNOWN) + .withEnableHadrAssessment(true) + .withAzureSecurityOfferingType(AzureSecurityOfferingType.NO) + .withSqlServerLicense(SqlServerLicense.UNKNOWN)) + .withDetails(new AssessmentDetails()) + .withFallbackMachineAssessmentArmId("jfwkifsuigza")) + .create(); + } +} +``` + +### SqlAssessmentV3Operations_Delete + +```java +/** + * Samples for SqlAssessmentV3Operations Delete. + */ +public final class SqlAssessmentV3OperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlAssessmentV3Operations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: SqlAssessmentV3Operations_Delete_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlAssessmentV3OperationsDeleteMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlAssessmentV3Operations() + .deleteWithResponse("rgsqlAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} +``` + +### SqlAssessmentV3Operations_DownloadUrl + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for SqlAssessmentV3Operations DownloadUrl. + */ +public final class SqlAssessmentV3OperationsDownloadUrlSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlAssessmentV3Operations_DownloadUrl_MaximumSet_Gen.json + */ + /** + * Sample code: Get download URL for the assessment report. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void getDownloadURLForTheAssessmentReport( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { + manager.sqlAssessmentV3Operations() + .downloadUrl("rgsqlAssessments", "contosoProject", "assessmentName", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } +} +``` + +### SqlAssessmentV3Operations_Get + +```java +/** + * Samples for SqlAssessmentV3Operations Get. + */ +public final class SqlAssessmentV3OperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlAssessmentV3Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: SqlAssessmentV3Operations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlAssessmentV3OperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlAssessmentV3Operations() + .getWithResponse("rgsqlAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); + } +} +``` + +### SqlAssessmentV3Operations_ListByParent + +```java +/** + * Samples for SqlAssessmentV3Operations ListByParent. + */ +public final class SqlAssessmentV3OperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlAssessmentV3Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: SqlAssessmentV3Operations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlAssessmentV3OperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlAssessmentV3Operations() + .listByParent("rgsqlAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} +``` + +### SqlAssessmentV3SummaryOperations_Get + +```java +/** + * Samples for SqlAssessmentV3SummaryOperations Get. + */ +public final class SqlAssessmentV3SummaryOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: SqlAssessmentV3SummaryOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlAssessmentV3SummaryOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlAssessmentV3SummaryOperations() + .getWithResponse("rgsqlAssessments", "contosoProject", "assessmentName", "PaaSPreferred", + com.azure.core.util.Context.NONE); + } +} +``` + +### SqlAssessmentV3SummaryOperations_ListByParent + +```java +/** + * Samples for SqlAssessmentV3SummaryOperations ListByParent. + */ +public final class SqlAssessmentV3SummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlAssessmentV3SummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: SqlAssessmentV3SummaryOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlAssessmentV3SummaryOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlAssessmentV3SummaryOperations() + .listByParent("rgsqlAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); + } +} +``` + +### SqlCollectorOperations_Create + +```java +import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; +import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; +import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; + +/** + * Samples for SqlCollectorOperations Create. + */ +public final class SqlCollectorOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlCollectorOperations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: SqlCollectorOperations_Create. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlCollectorOperationsCreate( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlCollectorOperations() + .define("fci-test0c1esqlsitecollector") + .withExistingAssessmentProject("rgmigrate", "fci-test6904project") + .withProperties(new CollectorPropertiesBaseWithAgent() + .withAgentProperties( + new CollectorAgentPropertiesBase().withId("630da710-4d44-41f7-a189-72fe3db5502b-agent") + .withSpnDetails(new CollectorAgentSpnPropertiesBase() + .withAuthority("https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47") + .withApplicationId("db9c4c3d-477c-4d5a-817b-318276713565") + .withAudience("db9c4c3d-477c-4d5a-817b-318276713565") + .withObjectId("e50236ad-ad07-47d4-af71-ed7b52d200d5") + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47"))) + .withDiscoverySiteId( + "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/bansalankit-rg/providers/Microsoft.OffAzure/MasterSites/fci-ankit-test6065mastersite/SqlSites/fci-ankit-test6065sqlsites")) + .create(); + } +} +``` + +### SqlCollectorOperations_Delete + +```java +/** + * Samples for SqlCollectorOperations Delete. + */ +public final class SqlCollectorOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlCollectorOperations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: SqlCollectorOperations_Delete. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlCollectorOperationsDelete( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlCollectorOperations() + .deleteWithResponse("rgmigrate", "fci-test6904project", "fci-test0c1esqlsitecollector", + com.azure.core.util.Context.NONE); + } +} +``` + +### SqlCollectorOperations_Get + +```java +/** + * Samples for SqlCollectorOperations Get. + */ +public final class SqlCollectorOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlCollectorOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: SqlCollectorOperations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void + sqlCollectorOperationsGet(com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlCollectorOperations() + .getWithResponse("rgmigrate", "fci-test6904project", "fci-test0c1esqlsitecollector", + com.azure.core.util.Context.NONE); + } +} +``` + +### SqlCollectorOperations_ListByParent + +```java +/** + * Samples for SqlCollectorOperations ListByParent. + */ +public final class SqlCollectorOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlCollectorOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: SqlCollectorOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlCollectorOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlCollectorOperations() + .listByParent("rgmigrate", "fci-test6904project", com.azure.core.util.Context.NONE); + } +} +``` + +### SqlGraphAssessmentOptionsOperations_Get + +```java +/** + * Samples for SqlGraphAssessmentOptionsOperations Get. + */ +public final class SqlGraphAssessmentOptionsOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: SqlGraphAssessmentOptionsOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlGraphAssessmentOptionsOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlGraphAssessmentOptionsOperations() + .getWithResponse("rgsqlAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} +``` + +### SqlGraphAssessmentOptionsOperations_ListByParent + +```java +/** + * Samples for SqlGraphAssessmentOptionsOperations ListByParent. + */ +public final class SqlGraphAssessmentOptionsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: SqlGraphAssessmentOptionsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlGraphAssessmentOptionsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlGraphAssessmentOptionsOperations() + .listByParent("rgsqlAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} +``` + +### VmwareCollectorsOperations_Create + +```java +import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; +import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; +import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; +import java.time.OffsetDateTime; + +/** + * Samples for VmwareCollectorsOperations Create. + */ +public final class VmwareCollectorsOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * VmwareCollectorsOperations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: VmwareCollectorsOperations_Create. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void vmwareCollectorsOperationsCreate( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.vmwareCollectorsOperations() + .define("Vmware2258collector") + .withExistingAssessmentProject("ayagrawRG", "app18700project") + .withProperties(new CollectorPropertiesBaseWithAgent() + .withAgentProperties(new CollectorAgentPropertiesBase().withId("fe243486-3318-41fa-aaba-c48b5df75308") + .withVersion("1.0.8.383") + .withLastHeartbeatUtc(OffsetDateTime.parse("2022-03-29T12:10:08.9167289Z")) + .withSpnDetails(new CollectorAgentSpnPropertiesBase() + .withAuthority("https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47") + .withApplicationId("82b3e452-c0e8-4662-8347-58282925ae84") + .withAudience("82b3e452-c0e8-4662-8347-58282925ae84") + .withObjectId("3fc89111-1405-4938-9214-37aa4739401d") + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47"))) + .withDiscoverySiteId( + "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/VMwareSites/Vmware2744site")) + .create(); + } +} +``` + +### VmwareCollectorsOperations_Delete + +```java +/** + * Samples for VmwareCollectorsOperations Delete. + */ +public final class VmwareCollectorsOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * VmwareCollectorsOperations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: VmwareCollectorsOperations_Delete. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void vmwareCollectorsOperationsDelete( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.vmwareCollectorsOperations() + .deleteWithResponse("ayagrawRG", "app18700project", "Vmware2258collector", + com.azure.core.util.Context.NONE); + } +} +``` + +### VmwareCollectorsOperations_Get + +```java +/** + * Samples for VmwareCollectorsOperations Get. + */ +public final class VmwareCollectorsOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * VmwareCollectorsOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: VmwareCollectorsOperations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void vmwareCollectorsOperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.vmwareCollectorsOperations() + .getWithResponse("ayagrawRG", "app18700project", "Vmware2258collector", com.azure.core.util.Context.NONE); + } +} +``` + +### VmwareCollectorsOperations_ListByParent + +```java +/** + * Samples for VmwareCollectorsOperations ListByParent. + */ +public final class VmwareCollectorsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * VmwareCollectorsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: VmwareCollectorsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void vmwareCollectorsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.vmwareCollectorsOperations() + .listByParent("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); + } +} +``` + +### WebAppAssessmentV3Operations_Create + +```java +import com.azure.resourcemanager.migration.assessment.models.AppSvcContainerSettings; +import com.azure.resourcemanager.migration.assessment.models.AppSvcNativeSettings; +import com.azure.resourcemanager.migration.assessment.models.AssessmentDetails; +import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; +import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; +import com.azure.resourcemanager.migration.assessment.models.AzureOffer; +import com.azure.resourcemanager.migration.assessment.models.AzureSecurityOfferingType; +import com.azure.resourcemanager.migration.assessment.models.BillingSettings; import com.azure.resourcemanager.migration.assessment.models.EnvironmentType; -import com.azure.resourcemanager.migration.assessment.models.MultiSubnetIntent; -import com.azure.resourcemanager.migration.assessment.models.OptimizationLogic; -import com.azure.resourcemanager.migration.assessment.models.OsLicense; +import com.azure.resourcemanager.migration.assessment.models.LicensingProgram; import com.azure.resourcemanager.migration.assessment.models.Percentile; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2Properties; -import com.azure.resourcemanager.migration.assessment.models.SqlDbSettings; -import com.azure.resourcemanager.migration.assessment.models.SqlMiSettings; -import com.azure.resourcemanager.migration.assessment.models.SqlServerLicense; -import com.azure.resourcemanager.migration.assessment.models.SqlVmSettings; +import com.azure.resourcemanager.migration.assessment.models.PerformanceData; +import com.azure.resourcemanager.migration.assessment.models.SavingsOptions; +import com.azure.resourcemanager.migration.assessment.models.SavingsSettings; +import com.azure.resourcemanager.migration.assessment.models.Scope; +import com.azure.resourcemanager.migration.assessment.models.ScopeType; import com.azure.resourcemanager.migration.assessment.models.TimeRange; -import java.util.Arrays; +import com.azure.resourcemanager.migration.assessment.models.WebAppAssessmentSettings; +import com.azure.resourcemanager.migration.assessment.models.WebAppAssessmentV3Properties; +import java.time.OffsetDateTime; /** - * Samples for SqlAssessmentV2Operations Create. - */ -public final class SqlAssessmentV2OperationsCreateSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentV2Operations_Create_MaximumSet_Gen.json - */ - /** - * Sample code: SqlAssessmentV2Operations_Create_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void sqlAssessmentV2OperationsCreateMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentV2Operations() - .define("test_swagger_1") - .withExistingGroup("rgmigrate", "fci-test6904project", "test_fci_hadr") - .withProperties(new SqlAssessmentV2Properties().withOsLicense(OsLicense.UNKNOWN) - .withEnvironmentType(EnvironmentType.PRODUCTION) - .withEntityUptime(new EntityUptime().withDaysPerMonth(30).withHoursPerDay(24)) - .withOptimizationLogic(OptimizationLogic.MINIMIZE_COST) - .withReservedInstanceForVm(AzureReservedInstance.NONE) - .withAzureOfferCodeForVm(AzureOfferCode.MSAZR0003P) - .withAzureSqlManagedInstanceSettings( - new SqlMiSettings().withAzureSqlServiceTier(AzureSqlServiceTier.AUTOMATIC) - .withAzureSqlInstanceType(AzureSqlInstanceType.SINGLE_INSTANCE)) - .withAzureSqlDatabaseSettings(new SqlDbSettings().withAzureSqlServiceTier(AzureSqlServiceTier.AUTOMATIC) - .withAzureSqlDataBaseType(AzureSqlDataBaseType.SINGLE_DATABASE) - .withAzureSqlComputeTier(ComputeTier.AUTOMATIC) - .withAzureSqlPurchaseModel(AzureSqlPurchaseModel.VCORE)) - .withAzureSqlVmSettings( - new SqlVmSettings().withInstanceSeries(Arrays.asList(AzureVmFamily.EADSV5_SERIES))) - .withMultiSubnetIntent(MultiSubnetIntent.DISASTER_RECOVERY) - .withAsyncCommitModeIntent(AsyncCommitModeIntent.DISASTER_RECOVERY) - .withDisasterRecoveryLocation(AzureLocation.EAST_ASIA) - .withEnableHadrAssessment(true) - .withReservedInstance(AzureReservedInstance.NONE) - .withSqlServerLicense(SqlServerLicense.UNKNOWN) - .withAzureLocation("SoutheastAsia") - .withAzureOfferCode(AzureOfferCode.MSAZR0003P) - .withCurrency(AzureCurrency.USD) - .withScalingFactor(1.0F) - .withPercentile(Percentile.PERCENTILE95) - .withTimeRange(TimeRange.DAY) - .withDiscountPercentage(0.0F) - .withSizingCriterion(AssessmentSizingCriterion.PERFORMANCE_BASED)) + * Samples for WebAppAssessmentV3Operations Create. + */ +public final class WebAppAssessmentV3OperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppAssessmentV3Operations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppAssessmentV3Operations_Create_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppAssessmentV3OperationsCreateMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.webAppAssessmentV3Operations() + .define("assessmentName") + .withExistingAssessmentProject("rgwebAppAssessments", "contosoProject") + .withProperties(new WebAppAssessmentV3Properties() + .withScope(new Scope().withScopeType(ScopeType.SERVER_GROUP_ID) + .withServerGroupId("sxwigkygd") + .withAzureResourceGraphQuery("mjonozzzflcglhdb")) + .withSettings(new WebAppAssessmentSettings().withAzureLocation("khzvggbrcnpkzrqdtvvyytc") + .withCurrency(AzureCurrency.UNKNOWN) + .withScalingFactor(6.0F) + .withDiscountPercentage(12.0F) + .withSizingCriterion(AssessmentSizingCriterion.PERFORMANCE_BASED) + .withPerformanceData(new PerformanceData().withPercentile(Percentile.fromString("Unknown")) + .withTimeRange(TimeRange.DAY) + .withPerfDataStartTime(OffsetDateTime.parse("2025-02-21T06:18:34.789Z")) + .withPerfDataEndTime(OffsetDateTime.parse("2025-02-21T06:18:34.789Z"))) + .withSavingsSettings(new SavingsSettings().withSavingsOptions(SavingsOptions.NONE) + .withAzureOfferCode(AzureOffer.UNKNOWN)) + .withBillingSettings(new BillingSettings().withLicensingProgram(LicensingProgram.RETAIL) + .withSubscriptionId("lakvxkjeqpajer")) + .withEnvironmentType(EnvironmentType.PRODUCTION) + .withAppSvcNativeSettings(new AppSvcNativeSettings().withIsolationRequired(true)) + .withAppSvcContainerSettings(new AppSvcContainerSettings().withIsolationRequired(true)) + .withAzureSecurityOfferingType(AzureSecurityOfferingType.NO)) + .withDetails(new AssessmentDetails()) + .withFallbackMachineAssessmentArmId("gfjcubgnh")) .create(); } } ``` -### SqlAssessmentV2Operations_Delete +### WebAppAssessmentV3Operations_Delete ```java /** - * Samples for SqlAssessmentV2Operations Delete. + * Samples for WebAppAssessmentV3Operations Delete. */ -public final class SqlAssessmentV2OperationsDeleteSamples { +public final class WebAppAssessmentV3OperationsDeleteSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentV2Operations_Delete_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppAssessmentV3Operations_Delete_MaximumSet_Gen.json */ /** - * Sample code: SqlAssessmentV2Operations_Delete_MaximumSet_Gen. + * Sample code: WebAppAssessmentV3Operations_Delete_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void sqlAssessmentV2OperationsDeleteMaximumSetGen( + public static void webAppAssessmentV3OperationsDeleteMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentV2Operations() - .deleteWithResponse("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", + manager.webAppAssessmentV3Operations() + .deleteWithResponse("rgwebAppAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); } } ``` -### SqlAssessmentV2Operations_DownloadUrl +### WebAppAssessmentV3Operations_DownloadUrl ```java import com.azure.core.management.serializer.SerializerFactory; @@ -2056,23 +4173,23 @@ import com.azure.core.util.serializer.SerializerEncoding; import java.io.IOException; /** - * Samples for SqlAssessmentV2Operations DownloadUrl. + * Samples for WebAppAssessmentV3Operations DownloadUrl. */ -public final class SqlAssessmentV2OperationsDownloadUrlSamples { +public final class WebAppAssessmentV3OperationsDownloadUrlSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentV2Operations_DownloadUrl_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppAssessmentV3Operations_DownloadUrl_MaximumSet_Gen.json */ /** - * Sample code: SqlAssessmentV2Operations_DownloadUrl_MaximumSet_Gen. + * Sample code: WebAppAssessmentV3Operations_DownloadUrl_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void sqlAssessmentV2OperationsDownloadUrlMaximumSetGen( + public static void webAppAssessmentV3OperationsDownloadUrlMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { - manager.sqlAssessmentV2Operations() - .downloadUrl("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", + manager.webAppAssessmentV3Operations() + .downloadUrl("rgwebAppAssessments", "contosoProject", "assessmentName", SerializerFactory.createDefaultManagementSerializerAdapter() .deserialize("{}", Object.class, SerializerEncoding.JSON), com.azure.core.util.Context.NONE); @@ -2080,345 +4197,325 @@ public final class SqlAssessmentV2OperationsDownloadUrlSamples { } ``` -### SqlAssessmentV2Operations_Get +### WebAppAssessmentV3Operations_Get ```java /** - * Samples for SqlAssessmentV2Operations Get. + * Samples for WebAppAssessmentV3Operations Get. */ -public final class SqlAssessmentV2OperationsGetSamples { +public final class WebAppAssessmentV3OperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentV2Operations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppAssessmentV3Operations_Get_MaximumSet_Gen.json */ /** - * Sample code: SqlAssessmentV2Operations_Get_MaximumSet_Gen. + * Sample code: WebAppAssessmentV3Operations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void sqlAssessmentV2OperationsGetMaximumSetGen( + public static void webAppAssessmentV3OperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentV2Operations() - .getWithResponse("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", + manager.webAppAssessmentV3Operations() + .getWithResponse("rgwebAppAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); } } ``` -### SqlAssessmentV2Operations_ListByGroup +### WebAppAssessmentV3Operations_ListByParent ```java /** - * Samples for SqlAssessmentV2Operations ListByGroup. + * Samples for WebAppAssessmentV3Operations ListByParent. */ -public final class SqlAssessmentV2OperationsListByGroupSamples { +public final class WebAppAssessmentV3OperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentV2Operations_ListByGroup_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppAssessmentV3Operations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: SqlAssessmentV2Operations_ListByGroup_MaximumSet_Gen. + * Sample code: WebAppAssessmentV3Operations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void sqlAssessmentV2OperationsListByGroupMaximumSetGen( + public static void webAppAssessmentV3OperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentV2Operations() - .listByGroup("rgmigrate", "fci-test6904project", "test_fci_hadr", com.azure.core.util.Context.NONE); + manager.webAppAssessmentV3Operations() + .listByParent("rgwebAppAssessments", "contosoProject", com.azure.core.util.Context.NONE); } } ``` -### SqlAssessmentV2SummaryOperations_Get +### WebAppAssessmentV3SummaryOperations_Get ```java /** - * Samples for SqlAssessmentV2SummaryOperations Get. + * Samples for WebAppAssessmentV3SummaryOperations Get. */ -public final class SqlAssessmentV2SummaryOperationsGetSamples { +public final class WebAppAssessmentV3SummaryOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: SqlAssessmentV2SummaryOperations_Get_MaximumSet_Gen. + * Sample code: WebAppAssessmentV3SummaryOperations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void sqlAssessmentV2SummaryOperationsGetMaximumSetGen( + public static void webAppAssessmentV3SummaryOperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentV2SummaryOperations() - .getWithResponse("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", "default", + manager.webAppAssessmentV3SummaryOperations() + .getWithResponse("rgwebAppAssessments", "contosoProject", "assessmentName", "PaaSPreferred", com.azure.core.util.Context.NONE); } } ``` -### SqlAssessmentV2SummaryOperations_ListBySqlAssessmentV2 +### WebAppAssessmentV3SummaryOperations_ListByParent ```java /** - * Samples for SqlAssessmentV2SummaryOperations ListBySqlAssessmentV2. + * Samples for WebAppAssessmentV3SummaryOperations ListByParent. */ -public final class SqlAssessmentV2SummaryOperationsListBySqlAssessmentV2Samples { +public final class WebAppAssessmentV3SummaryOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentV2SummaryOperations_ListBySqlAssessmentV2_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppAssessmentV3SummaryOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: SqlAssessmentV2SummaryOperations_ListBySqlAssessmentV2_MaximumSet_Gen. + * Sample code: WebAppAssessmentV3SummaryOperations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void sqlAssessmentV2SummaryOperationsListBySqlAssessmentV2MaximumSetGen( + public static void webAppAssessmentV3SummaryOperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentV2SummaryOperations() - .listBySqlAssessmentV2("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - com.azure.core.util.Context.NONE); + manager.webAppAssessmentV3SummaryOperations() + .listByParent("rgwebAppAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); } } ``` -### SqlCollectorOperations_Create +### WebAppCollectorOperations_Create ```java import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; +import java.time.OffsetDateTime; /** - * Samples for SqlCollectorOperations Create. + * Samples for WebAppCollectorOperations Create. */ -public final class SqlCollectorOperationsCreateSamples { +public final class WebAppCollectorOperationsCreateSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlCollectorOperations_Create_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppCollectorOperations_Create_MaximumSet_Gen.json */ /** - * Sample code: SqlCollectorOperations_Create_MaximumSet_Gen. + * Sample code: WebAppCollectorOperations_Create. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void sqlCollectorOperationsCreateMaximumSetGen( + public static void webAppCollectorOperationsCreate( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlCollectorOperations() - .define("fci-test0c1esqlsitecollector") - .withExistingAssessmentProject("rgmigrate", "fci-test6904project") + manager.webAppCollectorOperations() + .define("collector1") + .withExistingAssessmentProject("rgopenapi", "sumukk-ccy-bcs4557project") .withProperties(new CollectorPropertiesBaseWithAgent() .withAgentProperties( - new CollectorAgentPropertiesBase().withId("630da710-4d44-41f7-a189-72fe3db5502b-agent") + new CollectorAgentPropertiesBase().withId("fed93df5-b787-4e3f-a764-e3d2b9101a59-agent") + .withLastHeartbeatUtc(OffsetDateTime.parse("2023-11-03T05:43:02.078Z")) .withSpnDetails(new CollectorAgentSpnPropertiesBase() - .withAuthority("https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47") - .withApplicationId("db9c4c3d-477c-4d5a-817b-318276713565") - .withAudience("db9c4c3d-477c-4d5a-817b-318276713565") - .withObjectId("e50236ad-ad07-47d4-af71-ed7b52d200d5") - .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47"))) + .withAuthority("https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47") + .withApplicationId("2f70d5e8-7adc-4c64-910a-7031079efc6e") + .withAudience("2f70d5e8-7adc-4c64-910a-7031079efc6e") + .withObjectId("2f70d5e8-7adc-4c64-910a-7031079efc6e") + .withTenantId("2f70d5e8-7adc-4c64-910a-7031079efc6e"))) .withDiscoverySiteId( - "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/bansalankit-rg/providers/Microsoft.OffAzure/MasterSites/fci-ankit-test6065mastersite/SqlSites/fci-ankit-test6065sqlsites")) + "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sumukk-ccy-bcs/providers/Microsoft.OffAzure/MasterSites/sumukk-ccy-bcs9880mastersite/WebAppSites/sumukk-ccy-bcs9880webappsites")) .create(); } } ``` -### SqlCollectorOperations_Delete +### WebAppCollectorOperations_Delete ```java /** - * Samples for SqlCollectorOperations Delete. + * Samples for WebAppCollectorOperations Delete. */ -public final class SqlCollectorOperationsDeleteSamples { +public final class WebAppCollectorOperationsDeleteSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlCollectorOperations_Delete_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppCollectorOperations_Delete_MaximumSet_Gen.json */ /** - * Sample code: SqlCollectorOperations_Delete_MaximumSet_Gen. + * Sample code: WebAppCollectorOperations_Delete. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void sqlCollectorOperationsDeleteMaximumSetGen( + public static void webAppCollectorOperationsDelete( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlCollectorOperations() - .deleteWithResponse("rgmigrate", "fci-test6904project", "fci-test0c1esqlsitecollector", + manager.webAppCollectorOperations() + .deleteWithResponse("rgopenapi", "sumukk-ccy-bcs4557project", "collector1", com.azure.core.util.Context.NONE); } } ``` -### SqlCollectorOperations_Get +### WebAppCollectorOperations_Get ```java /** - * Samples for SqlCollectorOperations Get. + * Samples for WebAppCollectorOperations Get. */ -public final class SqlCollectorOperationsGetSamples { +public final class WebAppCollectorOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlCollectorOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppCollectorOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: SqlCollectorOperations_Get_MaximumSet_Gen. + * Sample code: WebAppCollectorOperations_Get. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void sqlCollectorOperationsGetMaximumSetGen( + public static void webAppCollectorOperationsGet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlCollectorOperations() - .getWithResponse("rgmigrate", "fci-test6904project", "fci-test0c1esqlsitecollector", - com.azure.core.util.Context.NONE); + manager.webAppCollectorOperations() + .getWithResponse("rgopenapi", "sumukk-ccy-bcs4557project", "collector1", com.azure.core.util.Context.NONE); } } ``` -### SqlCollectorOperations_ListByAssessmentProject +### WebAppCollectorOperations_ListByParent ```java /** - * Samples for SqlCollectorOperations ListByAssessmentProject. + * Samples for WebAppCollectorOperations ListByParent. */ -public final class SqlCollectorOperationsListByAssessmentProjectSamples { +public final class WebAppCollectorOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlCollectorOperations_ListByAssessmentProject_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppCollectorOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: SqlCollectorOperations_ListByAssessmentProject_MaximumSet_Gen. + * Sample code: WebAppCollectorOperations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void sqlCollectorOperationsListByAssessmentProjectMaximumSetGen( + public static void webAppCollectorOperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlCollectorOperations() - .listByAssessmentProject("rgmigrate", "fci-test6904project", com.azure.core.util.Context.NONE); + manager.webAppCollectorOperations() + .listByParent("rgopenapi", "sumukk-ccy-bcs4557project", com.azure.core.util.Context.NONE); } } ``` -### VmwareCollectorsOperations_Create +### WebAppGraphAssessmentOptionsOperations_Get ```java -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.time.OffsetDateTime; - /** - * Samples for VmwareCollectorsOperations Create. + * Samples for WebAppGraphAssessmentOptionsOperations Get. */ -public final class VmwareCollectorsOperationsCreateSamples { +public final class WebAppGraphAssessmentOptionsOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * VmwareCollectorsOperations_Create_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: VmwareCollectorsOperations_Create_MaximumSet_Gen. + * Sample code: WebAppGraphAssessmentOptionsOperations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void vmwareCollectorsOperationsCreateMaximumSetGen( + public static void webAppGraphAssessmentOptionsOperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.vmwareCollectorsOperations() - .define("Vmware2258collector") - .withExistingAssessmentProject("ayagrawRG", "app18700project") - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.SUCCEEDED) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("fe243486-3318-41fa-aaba-c48b5df75308") - .withVersion("1.0.8.383") - .withLastHeartbeatUtc(OffsetDateTime.parse("2022-03-29T12:10:08.9167289Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase() - .withAuthority("https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47") - .withApplicationId("82b3e452-c0e8-4662-8347-58282925ae84") - .withAudience("82b3e452-c0e8-4662-8347-58282925ae84") - .withObjectId("3fc89111-1405-4938-9214-37aa4739401d") - .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47"))) - .withDiscoverySiteId( - "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/VMwareSites/Vmware2744site")) - .create(); + manager.webAppGraphAssessmentOptionsOperations() + .getWithResponse("rgwebAppAssessments", "contosoProject", com.azure.core.util.Context.NONE); } } ``` -### VmwareCollectorsOperations_Delete +### WebAppGraphAssessmentOptionsOperations_ListByParent ```java /** - * Samples for VmwareCollectorsOperations Delete. + * Samples for WebAppGraphAssessmentOptionsOperations ListByParent. */ -public final class VmwareCollectorsOperationsDeleteSamples { +public final class WebAppGraphAssessmentOptionsOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * VmwareCollectorsOperations_Delete_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: VmwareCollectorsOperations_Delete_MaximumSet_Gen. + * Sample code: WebAppGraphAssessmentOptionsOperations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void vmwareCollectorsOperationsDeleteMaximumSetGen( + public static void webAppGraphAssessmentOptionsOperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.vmwareCollectorsOperations() - .deleteWithResponse("ayagrawRG", "app18700project", "Vmware2258collector", - com.azure.core.util.Context.NONE); + manager.webAppGraphAssessmentOptionsOperations() + .listByParent("rgwebAppAssessments", "contosoProject", com.azure.core.util.Context.NONE); } } ``` -### VmwareCollectorsOperations_Get +### WebAppServicePlansOperations_Get ```java /** - * Samples for VmwareCollectorsOperations Get. + * Samples for WebAppServicePlansOperations Get. */ -public final class VmwareCollectorsOperationsGetSamples { +public final class WebAppServicePlansOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * VmwareCollectorsOperations_Get_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppServicePlansOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: VmwareCollectorsOperations_Get_MaximumSet_Gen. + * Sample code: WebAppServicePlansOperations_Get_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void vmwareCollectorsOperationsGetMaximumSetGen( + public static void webAppServicePlansOperationsGetMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.vmwareCollectorsOperations() - .getWithResponse("ayagrawRG", "app18700project", "Vmware2258collector", com.azure.core.util.Context.NONE); + manager.webAppServicePlansOperations() + .getWithResponse("rgwebAppAssessments", "contosoProject", "assessmentName", "sp1", + com.azure.core.util.Context.NONE); } } ``` -### VmwareCollectorsOperations_ListByAssessmentProject +### WebAppServicePlansOperations_ListByParent ```java /** - * Samples for VmwareCollectorsOperations ListByAssessmentProject. + * Samples for WebAppServicePlansOperations ListByParent. */ -public final class VmwareCollectorsOperationsListByAssessmentProjectSamples { +public final class WebAppServicePlansOperationsListByParentSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * VmwareCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppServicePlansOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: VmwareCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen. + * Sample code: WebAppServicePlansOperations_ListByParent_MaximumSet. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void vmwareCollectorsOperationsListByAssessmentProjectMaximumSetGen( + public static void webAppServicePlansOperationsListByParentMaximumSet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.vmwareCollectorsOperations() - .listByAssessmentProject("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); + manager.webAppServicePlansOperations() + .listByParent("rgwebAppAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/pom.xml b/sdk/migration/azure-resourcemanager-migration-assessment/pom.xml index 45abcca993ff..f28aa1fb071c 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/pom.xml +++ b/sdk/migration/azure-resourcemanager-migration-assessment/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for Migration Assessment Management - This package contains Microsoft Azure SDK for Migration Assessment Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Migrate Resource Provider management API. Package tag package-2023-03. + This package contains Microsoft Azure SDK for Migration Assessment Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Migrate Resource Provider management API. Package tag package-preview-2024-03. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/MigrationAssessmentManager.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/MigrationAssessmentManager.java index 7bc6082cdd20..3205f2fa007d 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/MigrationAssessmentManager.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/MigrationAssessmentManager.java @@ -25,57 +25,107 @@ import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.migration.assessment.fluent.MigrationAssessmentManagementClient; -import com.azure.resourcemanager.migration.assessment.implementation.AssessedMachinesOperationsImpl; -import com.azure.resourcemanager.migration.assessment.implementation.AssessedSqlDatabaseV2OperationsImpl; -import com.azure.resourcemanager.migration.assessment.implementation.AssessedSqlInstanceV2OperationsImpl; -import com.azure.resourcemanager.migration.assessment.implementation.AssessedSqlMachinesOperationsImpl; -import com.azure.resourcemanager.migration.assessment.implementation.AssessedSqlRecommendedEntityOperationsImpl; -import com.azure.resourcemanager.migration.assessment.implementation.AssessmentOptionsOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.AksAssessmentOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.AksClusterOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.AksCostDetailOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.AksOptionsOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.AksSummaryOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.AssessedMachinesV2OperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.AssessedSqlDatabaseV3OperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.AssessedSqlInstanceV3OperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.AssessedSqlMachinesV3OperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.AssessedWebApplicationOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.AssessedWebAppsV3OperationsImpl; import com.azure.resourcemanager.migration.assessment.implementation.AssessmentProjectSummaryOperationsImpl; import com.azure.resourcemanager.migration.assessment.implementation.AssessmentProjectsOperationsImpl; -import com.azure.resourcemanager.migration.assessment.implementation.AssessmentsOperationsImpl; -import com.azure.resourcemanager.migration.assessment.implementation.AvsAssessedMachinesOperationsImpl; -import com.azure.resourcemanager.migration.assessment.implementation.AvsAssessmentOptionsOperationsImpl; -import com.azure.resourcemanager.migration.assessment.implementation.AvsAssessmentsOperationsImpl; -import com.azure.resourcemanager.migration.assessment.implementation.GroupsOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.AvsAssessedMachinesV2OperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.AvsAssessmentV2SummaryOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.AvsAssessmentsV2OperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.AvsGraphAssessmentOptionsOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.BusinessCaseAvsSummaryOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.BusinessCaseIaasSummaryOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.BusinessCaseOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.BusinessCaseOverviewSummaryOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.BusinessCasePaasSummaryOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.CompoundAssessmentOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.CompoundAssessmentSummaryOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.EvaluatedAvsMachinesOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.EvaluatedMachinesOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.EvaluatedSqlEntitiesOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.EvaluatedWebAppsOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.HeterogeneousAssessmentOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.HeterogeneousAssessmentSummaryOperationsImpl; import com.azure.resourcemanager.migration.assessment.implementation.HypervCollectorsOperationsImpl; import com.azure.resourcemanager.migration.assessment.implementation.ImportCollectorsOperationsImpl; -import com.azure.resourcemanager.migration.assessment.implementation.MachinesOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.ImportSqlCollectorOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.MachineAssessmentV2SummaryOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.MachineAssessmentsV2OperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.MachineGraphAssessmentOptionsOperationsImpl; import com.azure.resourcemanager.migration.assessment.implementation.MigrationAssessmentManagementClientBuilder; import com.azure.resourcemanager.migration.assessment.implementation.OperationsImpl; import com.azure.resourcemanager.migration.assessment.implementation.PrivateEndpointConnectionOperationsImpl; import com.azure.resourcemanager.migration.assessment.implementation.PrivateLinkResourceOperationsImpl; import com.azure.resourcemanager.migration.assessment.implementation.ServerCollectorsOperationsImpl; -import com.azure.resourcemanager.migration.assessment.implementation.SqlAssessmentOptionsOperationsImpl; -import com.azure.resourcemanager.migration.assessment.implementation.SqlAssessmentV2OperationsImpl; -import com.azure.resourcemanager.migration.assessment.implementation.SqlAssessmentV2SummaryOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.SqlAssessmentV3OperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.SqlAssessmentV3SummaryOperationsImpl; import com.azure.resourcemanager.migration.assessment.implementation.SqlCollectorOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.SqlGraphAssessmentOptionsOperationsImpl; import com.azure.resourcemanager.migration.assessment.implementation.VmwareCollectorsOperationsImpl; -import com.azure.resourcemanager.migration.assessment.models.AssessedMachinesOperations; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV2Operations; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV2Operations; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachinesOperations; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlRecommendedEntityOperations; -import com.azure.resourcemanager.migration.assessment.models.AssessmentOptionsOperations; +import com.azure.resourcemanager.migration.assessment.implementation.WebAppAssessmentV3OperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.WebAppAssessmentV3SummaryOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.WebAppCollectorOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.WebAppGraphAssessmentOptionsOperationsImpl; +import com.azure.resourcemanager.migration.assessment.implementation.WebAppServicePlansOperationsImpl; +import com.azure.resourcemanager.migration.assessment.models.AksAssessmentOperations; +import com.azure.resourcemanager.migration.assessment.models.AksClusterOperations; +import com.azure.resourcemanager.migration.assessment.models.AksCostDetailOperations; +import com.azure.resourcemanager.migration.assessment.models.AksOptionsOperations; +import com.azure.resourcemanager.migration.assessment.models.AksSummaryOperations; +import com.azure.resourcemanager.migration.assessment.models.AssessedMachinesV2Operations; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV3Operations; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV3Operations; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachinesV3Operations; +import com.azure.resourcemanager.migration.assessment.models.AssessedWebApplicationOperations; +import com.azure.resourcemanager.migration.assessment.models.AssessedWebAppsV3Operations; import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectSummaryOperations; import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectsOperations; -import com.azure.resourcemanager.migration.assessment.models.AssessmentsOperations; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessedMachinesOperations; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentOptionsOperations; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentsOperations; -import com.azure.resourcemanager.migration.assessment.models.GroupsOperations; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessedMachinesV2Operations; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentV2SummaryOperations; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentsV2Operations; +import com.azure.resourcemanager.migration.assessment.models.AvsGraphAssessmentOptionsOperations; +import com.azure.resourcemanager.migration.assessment.models.BusinessCaseAvsSummaryOperations; +import com.azure.resourcemanager.migration.assessment.models.BusinessCaseIaasSummaryOperations; +import com.azure.resourcemanager.migration.assessment.models.BusinessCaseOperations; +import com.azure.resourcemanager.migration.assessment.models.BusinessCaseOverviewSummaryOperations; +import com.azure.resourcemanager.migration.assessment.models.BusinessCasePaasSummaryOperations; +import com.azure.resourcemanager.migration.assessment.models.CompoundAssessmentOperations; +import com.azure.resourcemanager.migration.assessment.models.CompoundAssessmentSummaryOperations; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedAvsMachinesOperations; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedMachinesOperations; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedSqlEntitiesOperations; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedWebAppsOperations; +import com.azure.resourcemanager.migration.assessment.models.HeterogeneousAssessmentOperations; +import com.azure.resourcemanager.migration.assessment.models.HeterogeneousAssessmentSummaryOperations; import com.azure.resourcemanager.migration.assessment.models.HypervCollectorsOperations; import com.azure.resourcemanager.migration.assessment.models.ImportCollectorsOperations; -import com.azure.resourcemanager.migration.assessment.models.MachinesOperations; +import com.azure.resourcemanager.migration.assessment.models.ImportSqlCollectorOperations; +import com.azure.resourcemanager.migration.assessment.models.MachineAssessmentV2SummaryOperations; +import com.azure.resourcemanager.migration.assessment.models.MachineAssessmentsV2Operations; +import com.azure.resourcemanager.migration.assessment.models.MachineGraphAssessmentOptionsOperations; import com.azure.resourcemanager.migration.assessment.models.Operations; import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointConnectionOperations; import com.azure.resourcemanager.migration.assessment.models.PrivateLinkResourceOperations; import com.azure.resourcemanager.migration.assessment.models.ServerCollectorsOperations; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentOptionsOperations; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2Operations; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2SummaryOperations; +import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV3Operations; +import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV3SummaryOperations; import com.azure.resourcemanager.migration.assessment.models.SqlCollectorOperations; +import com.azure.resourcemanager.migration.assessment.models.SqlGraphAssessmentOptionsOperations; import com.azure.resourcemanager.migration.assessment.models.VmwareCollectorsOperations; +import com.azure.resourcemanager.migration.assessment.models.WebAppAssessmentV3Operations; +import com.azure.resourcemanager.migration.assessment.models.WebAppAssessmentV3SummaryOperations; +import com.azure.resourcemanager.migration.assessment.models.WebAppCollectorOperations; +import com.azure.resourcemanager.migration.assessment.models.WebAppGraphAssessmentOptionsOperations; +import com.azure.resourcemanager.migration.assessment.models.WebAppServicePlansOperations; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -93,52 +143,102 @@ public final class MigrationAssessmentManager { private AssessmentProjectsOperations assessmentProjectsOperations; - private AssessmentOptionsOperations assessmentOptionsOperations; + private PrivateEndpointConnectionOperations privateEndpointConnectionOperations; - private AvsAssessmentOptionsOperations avsAssessmentOptionsOperations; + private PrivateLinkResourceOperations privateLinkResourceOperations; - private GroupsOperations groupsOperations; + private AssessmentProjectSummaryOperations assessmentProjectSummaryOperations; - private AssessmentsOperations assessmentsOperations; + private AvsGraphAssessmentOptionsOperations avsGraphAssessmentOptionsOperations; - private AssessedMachinesOperations assessedMachinesOperations; + private AvsAssessmentsV2Operations avsAssessmentsV2Operations; - private AvsAssessmentsOperations avsAssessmentsOperations; + private AvsAssessedMachinesV2Operations avsAssessedMachinesV2Operations; - private AvsAssessedMachinesOperations avsAssessedMachinesOperations; + private AvsAssessmentV2SummaryOperations avsAssessmentV2SummaryOperations; - private SqlAssessmentV2Operations sqlAssessmentV2Operations; + private HeterogeneousAssessmentOperations heterogeneousAssessmentOperations; - private AssessedSqlDatabaseV2Operations assessedSqlDatabaseV2Operations; + private HeterogeneousAssessmentSummaryOperations heterogeneousAssessmentSummaryOperations; - private AssessedSqlInstanceV2Operations assessedSqlInstanceV2Operations; + private MachineGraphAssessmentOptionsOperations machineGraphAssessmentOptionsOperations; - private AssessedSqlMachinesOperations assessedSqlMachinesOperations; + private MachineAssessmentsV2Operations machineAssessmentsV2Operations; - private AssessedSqlRecommendedEntityOperations assessedSqlRecommendedEntityOperations; + private AssessedMachinesV2Operations assessedMachinesV2Operations; - private SqlAssessmentV2SummaryOperations sqlAssessmentV2SummaryOperations; + private MachineAssessmentV2SummaryOperations machineAssessmentV2SummaryOperations; - private HypervCollectorsOperations hypervCollectorsOperations; + private SqlGraphAssessmentOptionsOperations sqlGraphAssessmentOptionsOperations; - private ImportCollectorsOperations importCollectorsOperations; + private SqlAssessmentV3Operations sqlAssessmentV3Operations; - private MachinesOperations machinesOperations; + private AssessedSqlDatabaseV3Operations assessedSqlDatabaseV3Operations; - private PrivateEndpointConnectionOperations privateEndpointConnectionOperations; + private AssessedSqlInstanceV3Operations assessedSqlInstanceV3Operations; - private PrivateLinkResourceOperations privateLinkResourceOperations; + private AssessedSqlMachinesV3Operations assessedSqlMachinesV3Operations; - private AssessmentProjectSummaryOperations assessmentProjectSummaryOperations; + private SqlAssessmentV3SummaryOperations sqlAssessmentV3SummaryOperations; - private ServerCollectorsOperations serverCollectorsOperations; + private BusinessCaseOperations businessCaseOperations; + + private BusinessCaseAvsSummaryOperations businessCaseAvsSummaryOperations; + + private EvaluatedAvsMachinesOperations evaluatedAvsMachinesOperations; + + private EvaluatedMachinesOperations evaluatedMachinesOperations; + + private EvaluatedSqlEntitiesOperations evaluatedSqlEntitiesOperations; + + private EvaluatedWebAppsOperations evaluatedWebAppsOperations; + + private BusinessCaseIaasSummaryOperations businessCaseIaasSummaryOperations; + + private BusinessCaseOverviewSummaryOperations businessCaseOverviewSummaryOperations; + + private BusinessCasePaasSummaryOperations businessCasePaasSummaryOperations; + + private WebAppGraphAssessmentOptionsOperations webAppGraphAssessmentOptionsOperations; + + private WebAppAssessmentV3Operations webAppAssessmentV3Operations; + + private AssessedWebAppsV3Operations assessedWebAppsV3Operations; + + private WebAppAssessmentV3SummaryOperations webAppAssessmentV3SummaryOperations; + + private WebAppServicePlansOperations webAppServicePlansOperations; + + private CompoundAssessmentOperations compoundAssessmentOperations; + + private CompoundAssessmentSummaryOperations compoundAssessmentSummaryOperations; + + private AksOptionsOperations aksOptionsOperations; + + private AksAssessmentOperations aksAssessmentOperations; + + private AssessedWebApplicationOperations assessedWebApplicationOperations; + + private AksClusterOperations aksClusterOperations; + + private AksCostDetailOperations aksCostDetailOperations; + + private AksSummaryOperations aksSummaryOperations; + + private HypervCollectorsOperations hypervCollectorsOperations; + + private ImportSqlCollectorOperations importSqlCollectorOperations; + + private ImportCollectorsOperations importCollectorsOperations; - private SqlAssessmentOptionsOperations sqlAssessmentOptionsOperations; + private ServerCollectorsOperations serverCollectorsOperations; private SqlCollectorOperations sqlCollectorOperations; private VmwareCollectorsOperations vmwareCollectorsOperations; + private WebAppCollectorOperations webAppCollectorOperations; + private final MigrationAssessmentManagementClient clientObject; private MigrationAssessmentManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -380,247 +480,572 @@ public AssessmentProjectsOperations assessmentProjectsOperations() { } /** - * Gets the resource collection API of AssessmentOptionsOperations. + * Gets the resource collection API of PrivateEndpointConnectionOperations. * - * @return Resource collection API of AssessmentOptionsOperations. + * @return Resource collection API of PrivateEndpointConnectionOperations. */ - public AssessmentOptionsOperations assessmentOptionsOperations() { - if (this.assessmentOptionsOperations == null) { - this.assessmentOptionsOperations - = new AssessmentOptionsOperationsImpl(clientObject.getAssessmentOptionsOperations(), this); + public PrivateEndpointConnectionOperations privateEndpointConnectionOperations() { + if (this.privateEndpointConnectionOperations == null) { + this.privateEndpointConnectionOperations = new PrivateEndpointConnectionOperationsImpl( + clientObject.getPrivateEndpointConnectionOperations(), this); } - return assessmentOptionsOperations; + return privateEndpointConnectionOperations; } /** - * Gets the resource collection API of AvsAssessmentOptionsOperations. + * Gets the resource collection API of PrivateLinkResourceOperations. * - * @return Resource collection API of AvsAssessmentOptionsOperations. + * @return Resource collection API of PrivateLinkResourceOperations. */ - public AvsAssessmentOptionsOperations avsAssessmentOptionsOperations() { - if (this.avsAssessmentOptionsOperations == null) { - this.avsAssessmentOptionsOperations - = new AvsAssessmentOptionsOperationsImpl(clientObject.getAvsAssessmentOptionsOperations(), this); + public PrivateLinkResourceOperations privateLinkResourceOperations() { + if (this.privateLinkResourceOperations == null) { + this.privateLinkResourceOperations + = new PrivateLinkResourceOperationsImpl(clientObject.getPrivateLinkResourceOperations(), this); } - return avsAssessmentOptionsOperations; + return privateLinkResourceOperations; } /** - * Gets the resource collection API of GroupsOperations. It manages Group. + * Gets the resource collection API of AssessmentProjectSummaryOperations. * - * @return Resource collection API of GroupsOperations. + * @return Resource collection API of AssessmentProjectSummaryOperations. */ - public GroupsOperations groupsOperations() { - if (this.groupsOperations == null) { - this.groupsOperations = new GroupsOperationsImpl(clientObject.getGroupsOperations(), this); + public AssessmentProjectSummaryOperations assessmentProjectSummaryOperations() { + if (this.assessmentProjectSummaryOperations == null) { + this.assessmentProjectSummaryOperations = new AssessmentProjectSummaryOperationsImpl( + clientObject.getAssessmentProjectSummaryOperations(), this); } - return groupsOperations; + return assessmentProjectSummaryOperations; } /** - * Gets the resource collection API of AssessmentsOperations. It manages Assessment. + * Gets the resource collection API of AvsGraphAssessmentOptionsOperations. * - * @return Resource collection API of AssessmentsOperations. + * @return Resource collection API of AvsGraphAssessmentOptionsOperations. */ - public AssessmentsOperations assessmentsOperations() { - if (this.assessmentsOperations == null) { - this.assessmentsOperations = new AssessmentsOperationsImpl(clientObject.getAssessmentsOperations(), this); + public AvsGraphAssessmentOptionsOperations avsGraphAssessmentOptionsOperations() { + if (this.avsGraphAssessmentOptionsOperations == null) { + this.avsGraphAssessmentOptionsOperations = new AvsGraphAssessmentOptionsOperationsImpl( + clientObject.getAvsGraphAssessmentOptionsOperations(), this); } - return assessmentsOperations; + return avsGraphAssessmentOptionsOperations; } /** - * Gets the resource collection API of AssessedMachinesOperations. + * Gets the resource collection API of AvsAssessmentsV2Operations. It manages AvsAssessmentV2. * - * @return Resource collection API of AssessedMachinesOperations. + * @return Resource collection API of AvsAssessmentsV2Operations. */ - public AssessedMachinesOperations assessedMachinesOperations() { - if (this.assessedMachinesOperations == null) { - this.assessedMachinesOperations - = new AssessedMachinesOperationsImpl(clientObject.getAssessedMachinesOperations(), this); + public AvsAssessmentsV2Operations avsAssessmentsV2Operations() { + if (this.avsAssessmentsV2Operations == null) { + this.avsAssessmentsV2Operations + = new AvsAssessmentsV2OperationsImpl(clientObject.getAvsAssessmentsV2Operations(), this); } - return assessedMachinesOperations; + return avsAssessmentsV2Operations; } /** - * Gets the resource collection API of AvsAssessmentsOperations. It manages AvsAssessment. + * Gets the resource collection API of AvsAssessedMachinesV2Operations. * - * @return Resource collection API of AvsAssessmentsOperations. + * @return Resource collection API of AvsAssessedMachinesV2Operations. */ - public AvsAssessmentsOperations avsAssessmentsOperations() { - if (this.avsAssessmentsOperations == null) { - this.avsAssessmentsOperations - = new AvsAssessmentsOperationsImpl(clientObject.getAvsAssessmentsOperations(), this); + public AvsAssessedMachinesV2Operations avsAssessedMachinesV2Operations() { + if (this.avsAssessedMachinesV2Operations == null) { + this.avsAssessedMachinesV2Operations + = new AvsAssessedMachinesV2OperationsImpl(clientObject.getAvsAssessedMachinesV2Operations(), this); } - return avsAssessmentsOperations; + return avsAssessedMachinesV2Operations; } /** - * Gets the resource collection API of AvsAssessedMachinesOperations. + * Gets the resource collection API of AvsAssessmentV2SummaryOperations. * - * @return Resource collection API of AvsAssessedMachinesOperations. + * @return Resource collection API of AvsAssessmentV2SummaryOperations. */ - public AvsAssessedMachinesOperations avsAssessedMachinesOperations() { - if (this.avsAssessedMachinesOperations == null) { - this.avsAssessedMachinesOperations - = new AvsAssessedMachinesOperationsImpl(clientObject.getAvsAssessedMachinesOperations(), this); + public AvsAssessmentV2SummaryOperations avsAssessmentV2SummaryOperations() { + if (this.avsAssessmentV2SummaryOperations == null) { + this.avsAssessmentV2SummaryOperations + = new AvsAssessmentV2SummaryOperationsImpl(clientObject.getAvsAssessmentV2SummaryOperations(), this); } - return avsAssessedMachinesOperations; + return avsAssessmentV2SummaryOperations; } /** - * Gets the resource collection API of SqlAssessmentV2Operations. It manages SqlAssessmentV2. + * Gets the resource collection API of HeterogeneousAssessmentOperations. It manages HeterogeneousAssessment. * - * @return Resource collection API of SqlAssessmentV2Operations. + * @return Resource collection API of HeterogeneousAssessmentOperations. */ - public SqlAssessmentV2Operations sqlAssessmentV2Operations() { - if (this.sqlAssessmentV2Operations == null) { - this.sqlAssessmentV2Operations - = new SqlAssessmentV2OperationsImpl(clientObject.getSqlAssessmentV2Operations(), this); + public HeterogeneousAssessmentOperations heterogeneousAssessmentOperations() { + if (this.heterogeneousAssessmentOperations == null) { + this.heterogeneousAssessmentOperations + = new HeterogeneousAssessmentOperationsImpl(clientObject.getHeterogeneousAssessmentOperations(), this); } - return sqlAssessmentV2Operations; + return heterogeneousAssessmentOperations; } /** - * Gets the resource collection API of AssessedSqlDatabaseV2Operations. + * Gets the resource collection API of HeterogeneousAssessmentSummaryOperations. * - * @return Resource collection API of AssessedSqlDatabaseV2Operations. + * @return Resource collection API of HeterogeneousAssessmentSummaryOperations. */ - public AssessedSqlDatabaseV2Operations assessedSqlDatabaseV2Operations() { - if (this.assessedSqlDatabaseV2Operations == null) { - this.assessedSqlDatabaseV2Operations - = new AssessedSqlDatabaseV2OperationsImpl(clientObject.getAssessedSqlDatabaseV2Operations(), this); + public HeterogeneousAssessmentSummaryOperations heterogeneousAssessmentSummaryOperations() { + if (this.heterogeneousAssessmentSummaryOperations == null) { + this.heterogeneousAssessmentSummaryOperations = new HeterogeneousAssessmentSummaryOperationsImpl( + clientObject.getHeterogeneousAssessmentSummaryOperations(), this); } - return assessedSqlDatabaseV2Operations; + return heterogeneousAssessmentSummaryOperations; } /** - * Gets the resource collection API of AssessedSqlInstanceV2Operations. + * Gets the resource collection API of MachineGraphAssessmentOptionsOperations. * - * @return Resource collection API of AssessedSqlInstanceV2Operations. + * @return Resource collection API of MachineGraphAssessmentOptionsOperations. */ - public AssessedSqlInstanceV2Operations assessedSqlInstanceV2Operations() { - if (this.assessedSqlInstanceV2Operations == null) { - this.assessedSqlInstanceV2Operations - = new AssessedSqlInstanceV2OperationsImpl(clientObject.getAssessedSqlInstanceV2Operations(), this); + public MachineGraphAssessmentOptionsOperations machineGraphAssessmentOptionsOperations() { + if (this.machineGraphAssessmentOptionsOperations == null) { + this.machineGraphAssessmentOptionsOperations = new MachineGraphAssessmentOptionsOperationsImpl( + clientObject.getMachineGraphAssessmentOptionsOperations(), this); } - return assessedSqlInstanceV2Operations; + return machineGraphAssessmentOptionsOperations; } /** - * Gets the resource collection API of AssessedSqlMachinesOperations. + * Gets the resource collection API of MachineAssessmentsV2Operations. It manages MachineAssessmentV2. * - * @return Resource collection API of AssessedSqlMachinesOperations. + * @return Resource collection API of MachineAssessmentsV2Operations. */ - public AssessedSqlMachinesOperations assessedSqlMachinesOperations() { - if (this.assessedSqlMachinesOperations == null) { - this.assessedSqlMachinesOperations - = new AssessedSqlMachinesOperationsImpl(clientObject.getAssessedSqlMachinesOperations(), this); + public MachineAssessmentsV2Operations machineAssessmentsV2Operations() { + if (this.machineAssessmentsV2Operations == null) { + this.machineAssessmentsV2Operations + = new MachineAssessmentsV2OperationsImpl(clientObject.getMachineAssessmentsV2Operations(), this); } - return assessedSqlMachinesOperations; + return machineAssessmentsV2Operations; } /** - * Gets the resource collection API of AssessedSqlRecommendedEntityOperations. + * Gets the resource collection API of AssessedMachinesV2Operations. * - * @return Resource collection API of AssessedSqlRecommendedEntityOperations. + * @return Resource collection API of AssessedMachinesV2Operations. */ - public AssessedSqlRecommendedEntityOperations assessedSqlRecommendedEntityOperations() { - if (this.assessedSqlRecommendedEntityOperations == null) { - this.assessedSqlRecommendedEntityOperations = new AssessedSqlRecommendedEntityOperationsImpl( - clientObject.getAssessedSqlRecommendedEntityOperations(), this); + public AssessedMachinesV2Operations assessedMachinesV2Operations() { + if (this.assessedMachinesV2Operations == null) { + this.assessedMachinesV2Operations + = new AssessedMachinesV2OperationsImpl(clientObject.getAssessedMachinesV2Operations(), this); } - return assessedSqlRecommendedEntityOperations; + return assessedMachinesV2Operations; } /** - * Gets the resource collection API of SqlAssessmentV2SummaryOperations. + * Gets the resource collection API of MachineAssessmentV2SummaryOperations. * - * @return Resource collection API of SqlAssessmentV2SummaryOperations. + * @return Resource collection API of MachineAssessmentV2SummaryOperations. */ - public SqlAssessmentV2SummaryOperations sqlAssessmentV2SummaryOperations() { - if (this.sqlAssessmentV2SummaryOperations == null) { - this.sqlAssessmentV2SummaryOperations - = new SqlAssessmentV2SummaryOperationsImpl(clientObject.getSqlAssessmentV2SummaryOperations(), this); + public MachineAssessmentV2SummaryOperations machineAssessmentV2SummaryOperations() { + if (this.machineAssessmentV2SummaryOperations == null) { + this.machineAssessmentV2SummaryOperations = new MachineAssessmentV2SummaryOperationsImpl( + clientObject.getMachineAssessmentV2SummaryOperations(), this); } - return sqlAssessmentV2SummaryOperations; + return machineAssessmentV2SummaryOperations; } /** - * Gets the resource collection API of HypervCollectorsOperations. It manages HypervCollector. + * Gets the resource collection API of SqlGraphAssessmentOptionsOperations. * - * @return Resource collection API of HypervCollectorsOperations. + * @return Resource collection API of SqlGraphAssessmentOptionsOperations. */ - public HypervCollectorsOperations hypervCollectorsOperations() { - if (this.hypervCollectorsOperations == null) { - this.hypervCollectorsOperations - = new HypervCollectorsOperationsImpl(clientObject.getHypervCollectorsOperations(), this); + public SqlGraphAssessmentOptionsOperations sqlGraphAssessmentOptionsOperations() { + if (this.sqlGraphAssessmentOptionsOperations == null) { + this.sqlGraphAssessmentOptionsOperations = new SqlGraphAssessmentOptionsOperationsImpl( + clientObject.getSqlGraphAssessmentOptionsOperations(), this); } - return hypervCollectorsOperations; + return sqlGraphAssessmentOptionsOperations; } /** - * Gets the resource collection API of ImportCollectorsOperations. It manages ImportCollector. + * Gets the resource collection API of SqlAssessmentV3Operations. It manages SqlAssessmentV3. * - * @return Resource collection API of ImportCollectorsOperations. + * @return Resource collection API of SqlAssessmentV3Operations. */ - public ImportCollectorsOperations importCollectorsOperations() { - if (this.importCollectorsOperations == null) { - this.importCollectorsOperations - = new ImportCollectorsOperationsImpl(clientObject.getImportCollectorsOperations(), this); + public SqlAssessmentV3Operations sqlAssessmentV3Operations() { + if (this.sqlAssessmentV3Operations == null) { + this.sqlAssessmentV3Operations + = new SqlAssessmentV3OperationsImpl(clientObject.getSqlAssessmentV3Operations(), this); } - return importCollectorsOperations; + return sqlAssessmentV3Operations; } /** - * Gets the resource collection API of MachinesOperations. + * Gets the resource collection API of AssessedSqlDatabaseV3Operations. * - * @return Resource collection API of MachinesOperations. + * @return Resource collection API of AssessedSqlDatabaseV3Operations. */ - public MachinesOperations machinesOperations() { - if (this.machinesOperations == null) { - this.machinesOperations = new MachinesOperationsImpl(clientObject.getMachinesOperations(), this); + public AssessedSqlDatabaseV3Operations assessedSqlDatabaseV3Operations() { + if (this.assessedSqlDatabaseV3Operations == null) { + this.assessedSqlDatabaseV3Operations + = new AssessedSqlDatabaseV3OperationsImpl(clientObject.getAssessedSqlDatabaseV3Operations(), this); } - return machinesOperations; + return assessedSqlDatabaseV3Operations; } /** - * Gets the resource collection API of PrivateEndpointConnectionOperations. + * Gets the resource collection API of AssessedSqlInstanceV3Operations. * - * @return Resource collection API of PrivateEndpointConnectionOperations. + * @return Resource collection API of AssessedSqlInstanceV3Operations. */ - public PrivateEndpointConnectionOperations privateEndpointConnectionOperations() { - if (this.privateEndpointConnectionOperations == null) { - this.privateEndpointConnectionOperations = new PrivateEndpointConnectionOperationsImpl( - clientObject.getPrivateEndpointConnectionOperations(), this); + public AssessedSqlInstanceV3Operations assessedSqlInstanceV3Operations() { + if (this.assessedSqlInstanceV3Operations == null) { + this.assessedSqlInstanceV3Operations + = new AssessedSqlInstanceV3OperationsImpl(clientObject.getAssessedSqlInstanceV3Operations(), this); } - return privateEndpointConnectionOperations; + return assessedSqlInstanceV3Operations; } /** - * Gets the resource collection API of PrivateLinkResourceOperations. + * Gets the resource collection API of AssessedSqlMachinesV3Operations. * - * @return Resource collection API of PrivateLinkResourceOperations. + * @return Resource collection API of AssessedSqlMachinesV3Operations. */ - public PrivateLinkResourceOperations privateLinkResourceOperations() { - if (this.privateLinkResourceOperations == null) { - this.privateLinkResourceOperations - = new PrivateLinkResourceOperationsImpl(clientObject.getPrivateLinkResourceOperations(), this); + public AssessedSqlMachinesV3Operations assessedSqlMachinesV3Operations() { + if (this.assessedSqlMachinesV3Operations == null) { + this.assessedSqlMachinesV3Operations + = new AssessedSqlMachinesV3OperationsImpl(clientObject.getAssessedSqlMachinesV3Operations(), this); } - return privateLinkResourceOperations; + return assessedSqlMachinesV3Operations; } /** - * Gets the resource collection API of AssessmentProjectSummaryOperations. + * Gets the resource collection API of SqlAssessmentV3SummaryOperations. * - * @return Resource collection API of AssessmentProjectSummaryOperations. + * @return Resource collection API of SqlAssessmentV3SummaryOperations. */ - public AssessmentProjectSummaryOperations assessmentProjectSummaryOperations() { - if (this.assessmentProjectSummaryOperations == null) { - this.assessmentProjectSummaryOperations = new AssessmentProjectSummaryOperationsImpl( - clientObject.getAssessmentProjectSummaryOperations(), this); + public SqlAssessmentV3SummaryOperations sqlAssessmentV3SummaryOperations() { + if (this.sqlAssessmentV3SummaryOperations == null) { + this.sqlAssessmentV3SummaryOperations + = new SqlAssessmentV3SummaryOperationsImpl(clientObject.getSqlAssessmentV3SummaryOperations(), this); } - return assessmentProjectSummaryOperations; + return sqlAssessmentV3SummaryOperations; + } + + /** + * Gets the resource collection API of BusinessCaseOperations. It manages BusinessCase. + * + * @return Resource collection API of BusinessCaseOperations. + */ + public BusinessCaseOperations businessCaseOperations() { + if (this.businessCaseOperations == null) { + this.businessCaseOperations + = new BusinessCaseOperationsImpl(clientObject.getBusinessCaseOperations(), this); + } + return businessCaseOperations; + } + + /** + * Gets the resource collection API of BusinessCaseAvsSummaryOperations. + * + * @return Resource collection API of BusinessCaseAvsSummaryOperations. + */ + public BusinessCaseAvsSummaryOperations businessCaseAvsSummaryOperations() { + if (this.businessCaseAvsSummaryOperations == null) { + this.businessCaseAvsSummaryOperations + = new BusinessCaseAvsSummaryOperationsImpl(clientObject.getBusinessCaseAvsSummaryOperations(), this); + } + return businessCaseAvsSummaryOperations; + } + + /** + * Gets the resource collection API of EvaluatedAvsMachinesOperations. + * + * @return Resource collection API of EvaluatedAvsMachinesOperations. + */ + public EvaluatedAvsMachinesOperations evaluatedAvsMachinesOperations() { + if (this.evaluatedAvsMachinesOperations == null) { + this.evaluatedAvsMachinesOperations + = new EvaluatedAvsMachinesOperationsImpl(clientObject.getEvaluatedAvsMachinesOperations(), this); + } + return evaluatedAvsMachinesOperations; + } + + /** + * Gets the resource collection API of EvaluatedMachinesOperations. + * + * @return Resource collection API of EvaluatedMachinesOperations. + */ + public EvaluatedMachinesOperations evaluatedMachinesOperations() { + if (this.evaluatedMachinesOperations == null) { + this.evaluatedMachinesOperations + = new EvaluatedMachinesOperationsImpl(clientObject.getEvaluatedMachinesOperations(), this); + } + return evaluatedMachinesOperations; + } + + /** + * Gets the resource collection API of EvaluatedSqlEntitiesOperations. + * + * @return Resource collection API of EvaluatedSqlEntitiesOperations. + */ + public EvaluatedSqlEntitiesOperations evaluatedSqlEntitiesOperations() { + if (this.evaluatedSqlEntitiesOperations == null) { + this.evaluatedSqlEntitiesOperations + = new EvaluatedSqlEntitiesOperationsImpl(clientObject.getEvaluatedSqlEntitiesOperations(), this); + } + return evaluatedSqlEntitiesOperations; + } + + /** + * Gets the resource collection API of EvaluatedWebAppsOperations. + * + * @return Resource collection API of EvaluatedWebAppsOperations. + */ + public EvaluatedWebAppsOperations evaluatedWebAppsOperations() { + if (this.evaluatedWebAppsOperations == null) { + this.evaluatedWebAppsOperations + = new EvaluatedWebAppsOperationsImpl(clientObject.getEvaluatedWebAppsOperations(), this); + } + return evaluatedWebAppsOperations; + } + + /** + * Gets the resource collection API of BusinessCaseIaasSummaryOperations. + * + * @return Resource collection API of BusinessCaseIaasSummaryOperations. + */ + public BusinessCaseIaasSummaryOperations businessCaseIaasSummaryOperations() { + if (this.businessCaseIaasSummaryOperations == null) { + this.businessCaseIaasSummaryOperations + = new BusinessCaseIaasSummaryOperationsImpl(clientObject.getBusinessCaseIaasSummaryOperations(), this); + } + return businessCaseIaasSummaryOperations; + } + + /** + * Gets the resource collection API of BusinessCaseOverviewSummaryOperations. + * + * @return Resource collection API of BusinessCaseOverviewSummaryOperations. + */ + public BusinessCaseOverviewSummaryOperations businessCaseOverviewSummaryOperations() { + if (this.businessCaseOverviewSummaryOperations == null) { + this.businessCaseOverviewSummaryOperations = new BusinessCaseOverviewSummaryOperationsImpl( + clientObject.getBusinessCaseOverviewSummaryOperations(), this); + } + return businessCaseOverviewSummaryOperations; + } + + /** + * Gets the resource collection API of BusinessCasePaasSummaryOperations. + * + * @return Resource collection API of BusinessCasePaasSummaryOperations. + */ + public BusinessCasePaasSummaryOperations businessCasePaasSummaryOperations() { + if (this.businessCasePaasSummaryOperations == null) { + this.businessCasePaasSummaryOperations + = new BusinessCasePaasSummaryOperationsImpl(clientObject.getBusinessCasePaasSummaryOperations(), this); + } + return businessCasePaasSummaryOperations; + } + + /** + * Gets the resource collection API of WebAppGraphAssessmentOptionsOperations. + * + * @return Resource collection API of WebAppGraphAssessmentOptionsOperations. + */ + public WebAppGraphAssessmentOptionsOperations webAppGraphAssessmentOptionsOperations() { + if (this.webAppGraphAssessmentOptionsOperations == null) { + this.webAppGraphAssessmentOptionsOperations = new WebAppGraphAssessmentOptionsOperationsImpl( + clientObject.getWebAppGraphAssessmentOptionsOperations(), this); + } + return webAppGraphAssessmentOptionsOperations; + } + + /** + * Gets the resource collection API of WebAppAssessmentV3Operations. It manages WebAppAssessmentV3. + * + * @return Resource collection API of WebAppAssessmentV3Operations. + */ + public WebAppAssessmentV3Operations webAppAssessmentV3Operations() { + if (this.webAppAssessmentV3Operations == null) { + this.webAppAssessmentV3Operations + = new WebAppAssessmentV3OperationsImpl(clientObject.getWebAppAssessmentV3Operations(), this); + } + return webAppAssessmentV3Operations; + } + + /** + * Gets the resource collection API of AssessedWebAppsV3Operations. + * + * @return Resource collection API of AssessedWebAppsV3Operations. + */ + public AssessedWebAppsV3Operations assessedWebAppsV3Operations() { + if (this.assessedWebAppsV3Operations == null) { + this.assessedWebAppsV3Operations + = new AssessedWebAppsV3OperationsImpl(clientObject.getAssessedWebAppsV3Operations(), this); + } + return assessedWebAppsV3Operations; + } + + /** + * Gets the resource collection API of WebAppAssessmentV3SummaryOperations. + * + * @return Resource collection API of WebAppAssessmentV3SummaryOperations. + */ + public WebAppAssessmentV3SummaryOperations webAppAssessmentV3SummaryOperations() { + if (this.webAppAssessmentV3SummaryOperations == null) { + this.webAppAssessmentV3SummaryOperations = new WebAppAssessmentV3SummaryOperationsImpl( + clientObject.getWebAppAssessmentV3SummaryOperations(), this); + } + return webAppAssessmentV3SummaryOperations; + } + + /** + * Gets the resource collection API of WebAppServicePlansOperations. + * + * @return Resource collection API of WebAppServicePlansOperations. + */ + public WebAppServicePlansOperations webAppServicePlansOperations() { + if (this.webAppServicePlansOperations == null) { + this.webAppServicePlansOperations + = new WebAppServicePlansOperationsImpl(clientObject.getWebAppServicePlansOperations(), this); + } + return webAppServicePlansOperations; + } + + /** + * Gets the resource collection API of CompoundAssessmentOperations. It manages CompoundAssessment. + * + * @return Resource collection API of CompoundAssessmentOperations. + */ + public CompoundAssessmentOperations compoundAssessmentOperations() { + if (this.compoundAssessmentOperations == null) { + this.compoundAssessmentOperations + = new CompoundAssessmentOperationsImpl(clientObject.getCompoundAssessmentOperations(), this); + } + return compoundAssessmentOperations; + } + + /** + * Gets the resource collection API of CompoundAssessmentSummaryOperations. + * + * @return Resource collection API of CompoundAssessmentSummaryOperations. + */ + public CompoundAssessmentSummaryOperations compoundAssessmentSummaryOperations() { + if (this.compoundAssessmentSummaryOperations == null) { + this.compoundAssessmentSummaryOperations = new CompoundAssessmentSummaryOperationsImpl( + clientObject.getCompoundAssessmentSummaryOperations(), this); + } + return compoundAssessmentSummaryOperations; + } + + /** + * Gets the resource collection API of AksOptionsOperations. + * + * @return Resource collection API of AksOptionsOperations. + */ + public AksOptionsOperations aksOptionsOperations() { + if (this.aksOptionsOperations == null) { + this.aksOptionsOperations = new AksOptionsOperationsImpl(clientObject.getAksOptionsOperations(), this); + } + return aksOptionsOperations; + } + + /** + * Gets the resource collection API of AksAssessmentOperations. It manages AksAssessment. + * + * @return Resource collection API of AksAssessmentOperations. + */ + public AksAssessmentOperations aksAssessmentOperations() { + if (this.aksAssessmentOperations == null) { + this.aksAssessmentOperations + = new AksAssessmentOperationsImpl(clientObject.getAksAssessmentOperations(), this); + } + return aksAssessmentOperations; + } + + /** + * Gets the resource collection API of AssessedWebApplicationOperations. + * + * @return Resource collection API of AssessedWebApplicationOperations. + */ + public AssessedWebApplicationOperations assessedWebApplicationOperations() { + if (this.assessedWebApplicationOperations == null) { + this.assessedWebApplicationOperations + = new AssessedWebApplicationOperationsImpl(clientObject.getAssessedWebApplicationOperations(), this); + } + return assessedWebApplicationOperations; + } + + /** + * Gets the resource collection API of AksClusterOperations. + * + * @return Resource collection API of AksClusterOperations. + */ + public AksClusterOperations aksClusterOperations() { + if (this.aksClusterOperations == null) { + this.aksClusterOperations = new AksClusterOperationsImpl(clientObject.getAksClusterOperations(), this); + } + return aksClusterOperations; + } + + /** + * Gets the resource collection API of AksCostDetailOperations. + * + * @return Resource collection API of AksCostDetailOperations. + */ + public AksCostDetailOperations aksCostDetailOperations() { + if (this.aksCostDetailOperations == null) { + this.aksCostDetailOperations + = new AksCostDetailOperationsImpl(clientObject.getAksCostDetailOperations(), this); + } + return aksCostDetailOperations; + } + + /** + * Gets the resource collection API of AksSummaryOperations. + * + * @return Resource collection API of AksSummaryOperations. + */ + public AksSummaryOperations aksSummaryOperations() { + if (this.aksSummaryOperations == null) { + this.aksSummaryOperations = new AksSummaryOperationsImpl(clientObject.getAksSummaryOperations(), this); + } + return aksSummaryOperations; + } + + /** + * Gets the resource collection API of HypervCollectorsOperations. It manages HypervCollector. + * + * @return Resource collection API of HypervCollectorsOperations. + */ + public HypervCollectorsOperations hypervCollectorsOperations() { + if (this.hypervCollectorsOperations == null) { + this.hypervCollectorsOperations + = new HypervCollectorsOperationsImpl(clientObject.getHypervCollectorsOperations(), this); + } + return hypervCollectorsOperations; + } + + /** + * Gets the resource collection API of ImportSqlCollectorOperations. It manages ImportSqlCollector. + * + * @return Resource collection API of ImportSqlCollectorOperations. + */ + public ImportSqlCollectorOperations importSqlCollectorOperations() { + if (this.importSqlCollectorOperations == null) { + this.importSqlCollectorOperations + = new ImportSqlCollectorOperationsImpl(clientObject.getImportSqlCollectorOperations(), this); + } + return importSqlCollectorOperations; + } + + /** + * Gets the resource collection API of ImportCollectorsOperations. It manages ImportCollector. + * + * @return Resource collection API of ImportCollectorsOperations. + */ + public ImportCollectorsOperations importCollectorsOperations() { + if (this.importCollectorsOperations == null) { + this.importCollectorsOperations + = new ImportCollectorsOperationsImpl(clientObject.getImportCollectorsOperations(), this); + } + return importCollectorsOperations; } /** @@ -636,19 +1061,6 @@ public ServerCollectorsOperations serverCollectorsOperations() { return serverCollectorsOperations; } - /** - * Gets the resource collection API of SqlAssessmentOptionsOperations. - * - * @return Resource collection API of SqlAssessmentOptionsOperations. - */ - public SqlAssessmentOptionsOperations sqlAssessmentOptionsOperations() { - if (this.sqlAssessmentOptionsOperations == null) { - this.sqlAssessmentOptionsOperations - = new SqlAssessmentOptionsOperationsImpl(clientObject.getSqlAssessmentOptionsOperations(), this); - } - return sqlAssessmentOptionsOperations; - } - /** * Gets the resource collection API of SqlCollectorOperations. It manages SqlCollector. * @@ -675,6 +1087,19 @@ public VmwareCollectorsOperations vmwareCollectorsOperations() { return vmwareCollectorsOperations; } + /** + * Gets the resource collection API of WebAppCollectorOperations. It manages WebAppCollector. + * + * @return Resource collection API of WebAppCollectorOperations. + */ + public WebAppCollectorOperations webAppCollectorOperations() { + if (this.webAppCollectorOperations == null) { + this.webAppCollectorOperations + = new WebAppCollectorOperationsImpl(clientObject.getWebAppCollectorOperations(), this); + } + return webAppCollectorOperations; + } + /** * Gets wrapped service client MigrationAssessmentManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AksAssessmentOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AksAssessmentOperationsClient.java new file mode 100644 index 000000000000..ecaea36bdf09 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AksAssessmentOperationsClient.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AksAssessmentInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; + +/** + * An instance of this class provides access to all the operations defined in AksAssessmentOperationsClient. + */ +public interface AksAssessmentOperationsClient { + /** + * List AKSAssessment 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 AKSAssessment list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List AKSAssessment 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 AKSAssessment list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSAssessment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + Context context); + + /** + * Get a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSAssessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AksAssessmentInner get(String resourceGroupName, String projectName, String assessmentName); + + /** + * Create a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 aRM model of AKS Assessment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AksAssessmentInner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, AksAssessmentInner resource); + + /** + * Create a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 aRM model of AKS Assessment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AksAssessmentInner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, AksAssessmentInner resource, Context context); + + /** + * Create a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 aRM model of AKS Assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AksAssessmentInner create(String resourceGroupName, String projectName, String assessmentName, + AksAssessmentInner resource); + + /** + * Create a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 aRM model of AKS Assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AksAssessmentInner create(String resourceGroupName, String projectName, String assessmentName, + AksAssessmentInner resource, Context context); + + /** + * Delete a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String assessmentName, Object body); + + /** + * Get URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String assessmentName, Object body, Context context); + + /** + * Get URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object body); + + /** + * Get URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object body, + Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AksClusterOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AksClusterOperationsClient.java new file mode 100644 index 000000000000..58c4910af62c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AksClusterOperationsClient.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AksClusterInner; + +/** + * An instance of this class provides access to all the operations defined in AksClusterOperationsClient. + */ +public interface AksClusterOperationsClient { + /** + * List AKSCluster resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName); + + /** + * List AKSCluster resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName, + Context context); + + /** + * Get a AKSCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param clusterName AKS Cluster 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 AKSCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + String clusterName, Context context); + + /** + * Get a AKSCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param clusterName AKS Cluster 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 AKSCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AksClusterInner get(String resourceGroupName, String projectName, String assessmentName, String clusterName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AksCostDetailOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AksCostDetailOperationsClient.java new file mode 100644 index 000000000000..2f6978afb386 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AksCostDetailOperationsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AksCostDetailInner; + +/** + * An instance of this class provides access to all the operations defined in AksCostDetailOperationsClient. + */ +public interface AksCostDetailOperationsClient { + /** + * List AKSCostDetail resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCostDetail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName); + + /** + * List AKSCostDetail resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCostDetail 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AksOptionsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AksOptionsOperationsClient.java new file mode 100644 index 000000000000..619f21469422 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AksOptionsOperationsClient.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AksAssessmentOptionsInner; + +/** + * An instance of this class provides access to all the operations defined in AksOptionsOperationsClient. + */ +public interface AksOptionsOperationsClient { + /** + * List AKSAssessmentOptions 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 AKSAssessmentOptions list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List AKSAssessmentOptions 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 AKSAssessmentOptions list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + Context context); + + /** + * Get a AKSAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentOptionsName AKS Assessment Options 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 AKSAssessmentOptions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentOptionsName, Context context); + + /** + * Get a AKSAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentOptionsName AKS Assessment Options 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 AKSAssessmentOptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AksAssessmentOptionsInner get(String resourceGroupName, String projectName, String assessmentOptionsName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AksSummaryOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AksSummaryOperationsClient.java new file mode 100644 index 000000000000..d0bd3fd1c215 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AksSummaryOperationsClient.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AksSummaryInner; + +/** + * An instance of this class provides access to all the operations defined in AksSummaryOperationsClient. + */ +public interface AksSummaryOperationsClient { + /** + * List AKSSummary resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName); + + /** + * List AKSSummary resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName, + Context context); + + /** + * Get a AKSSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param summaryName AKS Assessment Summary 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 AKSSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + String summaryName, Context context); + + /** + * Get a AKSSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param summaryName AKS Assessment Summary 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 AKSSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AksSummaryInner get(String resourceGroupName, String projectName, String assessmentName, String summaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedMachinesOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedMachinesOperationsClient.java deleted file mode 100644 index 2f35ff739cd0..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedMachinesOperationsClient.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AssessedMachineInner; - -/** - * An instance of this class provides access to all the operations defined in AssessedMachinesOperationsClient. - */ -public interface AssessedMachinesOperationsClient { - /** - * List AssessedMachine resources by Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 AssessedMachine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessment(String resourceGroupName, String projectName, String groupName, - String assessmentName); - - /** - * List AssessedMachine resources by Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 AssessedMachine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessment(String resourceGroupName, String projectName, String groupName, - String assessmentName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, - Context context); - - /** - * Get a AssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment ARM name. - * @param assessedMachineName Machine assessment 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 AssessedMachine along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedMachineName, Context context); - - /** - * Get a AssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment ARM name. - * @param assessedMachineName Machine assessment 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 AssessedMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AssessedMachineInner get(String resourceGroupName, String projectName, String groupName, String assessmentName, - String assessedMachineName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedMachinesV2OperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedMachinesV2OperationsClient.java new file mode 100644 index 000000000000..32a4453622f6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedMachinesV2OperationsClient.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AssessedMachineV2Inner; + +/** + * An instance of this class provides access to all the operations defined in AssessedMachinesV2OperationsClient. + */ +public interface AssessedMachinesV2OperationsClient { + /** + * 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); + + /** + * 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); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlDatabaseV2OperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlDatabaseV2OperationsClient.java deleted file mode 100644 index ad400e52b56e..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlDatabaseV2OperationsClient.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AssessedSqlDatabaseV2Inner; - -/** - * An instance of this class provides access to all the operations defined in AssessedSqlDatabaseV2OperationsClient. - */ -public interface AssessedSqlDatabaseV2OperationsClient { - /** - * List AssessedSqlDatabaseV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV2 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName); - - /** - * List AssessedSqlDatabaseV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV2 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context); - - /** - * Get a AssessedSqlDatabaseV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV2 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlDatabaseName, Context context); - - /** - * Get a AssessedSqlDatabaseV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV2. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AssessedSqlDatabaseV2Inner get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlDatabaseName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlDatabaseV3OperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlDatabaseV3OperationsClient.java new file mode 100644 index 000000000000..c19910921b92 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlDatabaseV3OperationsClient.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AssessedSqlDatabaseV3Inner; + +/** + * An instance of this class provides access to all the operations defined in AssessedSqlDatabaseV3OperationsClient. + */ +public interface AssessedSqlDatabaseV3OperationsClient { + /** + * List AssessedSqlDatabaseV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV3 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List AssessedSqlDatabaseV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV3 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); + + /** + * Get a AssessedSqlDatabaseV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV3 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedSqlDatabaseName, Context context); + + /** + * Get a AssessedSqlDatabaseV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV3. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssessedSqlDatabaseV3Inner get(String resourceGroupName, String projectName, String assessmentName, + String assessedSqlDatabaseName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlInstanceV2OperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlInstanceV2OperationsClient.java deleted file mode 100644 index a0c4c1265285..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlInstanceV2OperationsClient.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AssessedSqlInstanceV2Inner; - -/** - * An instance of this class provides access to all the operations defined in AssessedSqlInstanceV2OperationsClient. - */ -public interface AssessedSqlInstanceV2OperationsClient { - /** - * List AssessedSqlInstanceV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV2 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName); - - /** - * List AssessedSqlInstanceV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV2 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context); - - /** - * Get a AssessedSqlInstanceV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV2 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlInstanceName, Context context); - - /** - * Get a AssessedSqlInstanceV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV2. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AssessedSqlInstanceV2Inner get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlInstanceName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlInstanceV3OperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlInstanceV3OperationsClient.java new file mode 100644 index 000000000000..cdba4b72ba2a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlInstanceV3OperationsClient.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AssessedSqlInstanceV3Inner; + +/** + * An instance of this class provides access to all the operations defined in AssessedSqlInstanceV3OperationsClient. + */ +public interface AssessedSqlInstanceV3OperationsClient { + /** + * List AssessedSqlInstanceV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV3 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List AssessedSqlInstanceV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV3 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); + + /** + * Get a AssessedSqlInstanceV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV3 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedSqlInstanceName, Context context); + + /** + * Get a AssessedSqlInstanceV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV3. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssessedSqlInstanceV3Inner get(String resourceGroupName, String projectName, String assessmentName, + String assessedSqlInstanceName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlMachinesOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlMachinesOperationsClient.java deleted file mode 100644 index f676d43a87b8..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlMachinesOperationsClient.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AssessedSqlMachineInner; - -/** - * An instance of this class provides access to all the operations defined in AssessedSqlMachinesOperationsClient. - */ -public interface AssessedSqlMachinesOperationsClient { - /** - * List AssessedSqlMachine resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlMachine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName); - - /** - * List AssessedSqlMachine resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlMachine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context); - - /** - * Get a AssessedSqlMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachine along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlMachineName, Context context); - - /** - * Get a AssessedSqlMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AssessedSqlMachineInner get(String resourceGroupName, String projectName, String groupName, String assessmentName, - String assessedSqlMachineName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlMachinesV3OperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlMachinesV3OperationsClient.java new file mode 100644 index 000000000000..83e4d496a339 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlMachinesV3OperationsClient.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AssessedSqlMachineV3Inner; + +/** + * An instance of this class provides access to all the operations defined in AssessedSqlMachinesV3OperationsClient. + */ +public interface AssessedSqlMachinesV3OperationsClient { + /** + * List AssessedSqlMachineV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlMachineV3 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List AssessedSqlMachineV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlMachineV3 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); + + /** + * Get a AssessedSqlMachineV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachineV3 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedSqlMachineName, Context context); + + /** + * Get a AssessedSqlMachineV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachineV3. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssessedSqlMachineV3Inner get(String resourceGroupName, String projectName, String assessmentName, + String assessedSqlMachineName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlRecommendedEntityOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlRecommendedEntityOperationsClient.java deleted file mode 100644 index 22683f66c45f..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedSqlRecommendedEntityOperationsClient.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AssessedSqlRecommendedEntityInner; - -/** - * An instance of this class provides access to all the operations defined in - * AssessedSqlRecommendedEntityOperationsClient. - */ -public interface AssessedSqlRecommendedEntityOperationsClient { - /** - * List AssessedSqlRecommendedEntity resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlRecommendedEntity list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName); - - /** - * List AssessedSqlRecommendedEntity resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlRecommendedEntity list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context); - - /** - * Get a AssessedSqlRecommendedEntity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param recommendedAssessedEntityName Sql assessment Assessed Recommended Entity 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 AssessedSqlRecommendedEntity along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String projectName, - String groupName, String assessmentName, String recommendedAssessedEntityName, Context context); - - /** - * Get a AssessedSqlRecommendedEntity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param recommendedAssessedEntityName Sql assessment Assessed Recommended Entity 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 AssessedSqlRecommendedEntity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AssessedSqlRecommendedEntityInner get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String recommendedAssessedEntityName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedWebApplicationOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedWebApplicationOperationsClient.java new file mode 100644 index 000000000000..a479d70dbe48 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedWebApplicationOperationsClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AssessedWebApplicationInner; + +/** + * An instance of this class provides access to all the operations defined in AssessedWebApplicationOperationsClient. + */ +public interface AssessedWebApplicationOperationsClient { + /** + * List AssessedWebApplication resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AssessedWebApplication list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List AssessedWebApplication resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AssessedWebApplication list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a AssessedWebApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param assessedWorkload Assessed Web Application 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 AssessedWebApplication along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedWorkload, Context context); + + /** + * Get a AssessedWebApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param assessedWorkload Assessed Web Application 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 AssessedWebApplication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssessedWebApplicationInner get(String resourceGroupName, String projectName, String assessmentName, + String assessedWorkload); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedWebAppsV3OperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedWebAppsV3OperationsClient.java new file mode 100644 index 000000000000..1fc4031b2ebe --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessedWebAppsV3OperationsClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AssessedWebAppV3Inner; + +/** + * An instance of this class provides access to all the operations defined in AssessedWebAppsV3OperationsClient. + */ +public interface AssessedWebAppsV3OperationsClient { + /** + * List AssessedWebAppV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 AssessedWebAppV3 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List AssessedWebAppV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 AssessedWebAppV3 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a AssessedWebAppV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param assessedWebAppName Assessed web app 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 AssessedWebAppV3 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + String assessedWebAppName, Context context); + + /** + * Get a AssessedWebAppV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param assessedWebAppName Assessed web app 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 AssessedWebAppV3. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssessedWebAppV3Inner get(String resourceGroupName, String projectName, String assessmentName, + String assessedWebAppName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessmentOptionsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessmentOptionsOperationsClient.java deleted file mode 100644 index a7b7acb8f35f..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessmentOptionsOperationsClient.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AssessmentOptionsInner; - -/** - * An instance of this class provides access to all the operations defined in AssessmentOptionsOperationsClient. - */ -public interface AssessmentOptionsOperationsClient { - /** - * List AssessmentOptions 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 AssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); - - /** - * List AssessmentOptions 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 AssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); - - /** - * Get a AssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName assessment options ARM name. Accepted value is 'default'. - * @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 AssessmentOptions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String projectName, - String assessmentOptionsName, Context context); - - /** - * Get a AssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName assessment options ARM name. Accepted value is 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 AssessmentOptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AssessmentOptionsInner get(String resourceGroupName, String projectName, String assessmentOptionsName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessmentProjectSummaryOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessmentProjectSummaryOperationsClient.java index 82d40c43bbba..fd85d32f2f52 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessmentProjectSummaryOperationsClient.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessmentProjectSummaryOperationsClient.java @@ -27,7 +27,7 @@ public interface AssessmentProjectSummaryOperationsClient { * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List AssessmentProjectSummary resources by AssessmentProject. @@ -42,7 +42,7 @@ public interface AssessmentProjectSummaryOperationsClient { * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** @@ -50,7 +50,7 @@ PagedIterable listByAssessmentProject(String reso * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param projectName Assessment Project Name. - * @param projectSummaryName Group ARM name. + * @param projectSummaryName Assessment project summary resource. * @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. @@ -66,7 +66,7 @@ Response getWithResponse(String resourceGroupName * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param projectName Assessment Project Name. - * @param projectSummaryName Group ARM name. + * @param projectSummaryName Assessment project summary resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessmentsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessmentsOperationsClient.java deleted file mode 100644 index 8cc3299e80c7..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AssessmentsOperationsClient.java +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AssessmentInner; -import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; - -/** - * An instance of this class provides access to all the operations defined in AssessmentsOperationsClient. - */ -public interface AssessmentsOperationsClient { - /** - * List Assessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Assessment list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName); - - /** - * List Assessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Assessment list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName, - Context context); - - /** - * Get a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 Assessment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, Context context); - - /** - * Get a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 Assessment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AssessmentInner get(String resourceGroupName, String projectName, String groupName, String assessmentName); - - /** - * Create a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AssessmentInner> beginCreate(String resourceGroupName, String projectName, - String groupName, String assessmentName, AssessmentInner resource); - - /** - * Create a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AssessmentInner> beginCreate(String resourceGroupName, String projectName, - String groupName, String assessmentName, AssessmentInner resource, Context context); - - /** - * Create a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AssessmentInner create(String resourceGroupName, String projectName, String groupName, String assessmentName, - AssessmentInner resource); - - /** - * Create a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AssessmentInner create(String resourceGroupName, String projectName, String groupName, String assessmentName, - AssessmentInner resource, Context context); - - /** - * Delete a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 groupName, - String assessmentName, Context context); - - /** - * Delete a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 groupName, 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 the URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, - String projectName, String groupName, String assessmentName, Object 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 the URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, - String projectName, String groupName, String assessmentName, Object 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String groupName, String assessmentName, - Object 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String groupName, String assessmentName, - Object body, Context context); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessedMachinesOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessedMachinesOperationsClient.java deleted file mode 100644 index 1d9f199cbb64..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessedMachinesOperationsClient.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AvsAssessedMachineInner; - -/** - * An instance of this class provides access to all the operations defined in AvsAssessedMachinesOperationsClient. - */ -public interface AvsAssessedMachinesOperationsClient { - /** - * List AvsAssessedMachine resources by AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessedMachine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAvsAssessment(String resourceGroupName, String projectName, - String groupName, String assessmentName); - - /** - * List AvsAssessedMachine resources by AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessedMachine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAvsAssessment(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context); - - /** - * Get a AvsAssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment ARM name. - * @param avsAssessedMachineName AVS assessment 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 AvsAssessedMachine along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, String avsAssessedMachineName, Context context); - - /** - * Get a AvsAssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment ARM name. - * @param avsAssessedMachineName AVS assessment 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 AvsAssessedMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvsAssessedMachineInner get(String resourceGroupName, String projectName, String groupName, String assessmentName, - String avsAssessedMachineName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessedMachinesV2OperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessedMachinesV2OperationsClient.java new file mode 100644 index 000000000000..cd419e0cd5aa --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessedMachinesV2OperationsClient.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AvsAssessedMachineV2Inner; + +/** + * An instance of this class provides access to all the operations defined in AvsAssessedMachinesV2OperationsClient. + */ +public interface AvsAssessedMachinesV2OperationsClient { + /** + * List AvsAssessedMachineV2 resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessedMachineV2 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List AvsAssessedMachineV2 resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessedMachineV2 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); + + /** + * Get a AvsAssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param avsAssessedMachineName AVS assessment Assessed Machine 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 AvsAssessedMachineV2 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String avsAssessedMachineName, Context context); + + /** + * Get a AvsAssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param avsAssessedMachineName AVS assessment Assessed Machine 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 AvsAssessedMachineV2. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvsAssessedMachineV2Inner get(String resourceGroupName, String projectName, String assessmentName, + String avsAssessedMachineName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessmentOptionsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessmentOptionsOperationsClient.java deleted file mode 100644 index 8c660a9e6bbd..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessmentOptionsOperationsClient.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AvsAssessmentOptionsInner; - -/** - * An instance of this class provides access to all the operations defined in AvsAssessmentOptionsOperationsClient. - */ -public interface AvsAssessmentOptionsOperationsClient { - /** - * List AvsAssessmentOptions 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 AvsAssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); - - /** - * List AvsAssessmentOptions 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 AvsAssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); - - /** - * Get a AvsAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param avsAssessmentOptionsName AVS Assessment options ARM name. Accepted value is 'default'. - * @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 AvsAssessmentOptions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String projectName, - String avsAssessmentOptionsName, Context context); - - /** - * Get a AvsAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param avsAssessmentOptionsName AVS Assessment options ARM name. Accepted value is 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 AvsAssessmentOptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvsAssessmentOptionsInner get(String resourceGroupName, String projectName, String avsAssessmentOptionsName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessmentV2SummaryOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessmentV2SummaryOperationsClient.java new file mode 100644 index 000000000000..75bae4d8f64b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessmentV2SummaryOperationsClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AvsAssessmentV2SummaryInner; + +/** + * An instance of this class provides access to all the operations defined in AvsAssessmentV2SummaryOperationsClient. + */ +public interface AvsAssessmentV2SummaryOperationsClient { + /** + * List AvsAssessmentV2Summary resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2Summary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List AvsAssessmentV2Summary resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2Summary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a AvsAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param summaryName Gets the Name of the AVS Assessment 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 AvsAssessmentV2Summary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String summaryName, Context context); + + /** + * Get a AvsAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param summaryName Gets the Name of the AVS Assessment 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 AvsAssessmentV2Summary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvsAssessmentV2SummaryInner get(String resourceGroupName, String projectName, String assessmentName, + String summaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessmentsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessmentsOperationsClient.java deleted file mode 100644 index 16d92ec87274..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessmentsOperationsClient.java +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AvsAssessmentInner; -import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; - -/** - * An instance of this class provides access to all the operations defined in AvsAssessmentsOperationsClient. - */ -public interface AvsAssessmentsOperationsClient { - /** - * List AvsAssessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 AvsAssessment list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName); - - /** - * List AvsAssessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 AvsAssessment list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName, - Context context); - - /** - * Get a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, Context context); - - /** - * Get a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvsAssessmentInner get(String resourceGroupName, String projectName, String groupName, String assessmentName); - - /** - * Create a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 aVS assessment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AvsAssessmentInner> beginCreate(String resourceGroupName, - String projectName, String groupName, String assessmentName, AvsAssessmentInner resource); - - /** - * Create a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 aVS assessment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AvsAssessmentInner> beginCreate(String resourceGroupName, - String projectName, String groupName, String assessmentName, AvsAssessmentInner resource, Context context); - - /** - * Create a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 aVS assessment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvsAssessmentInner create(String resourceGroupName, String projectName, String groupName, String assessmentName, - AvsAssessmentInner resource); - - /** - * Create a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 aVS assessment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvsAssessmentInner create(String resourceGroupName, String projectName, String groupName, String assessmentName, - AvsAssessmentInner resource, Context context); - - /** - * Delete a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 groupName, - String assessmentName, Context context); - - /** - * Delete a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 groupName, 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 the URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, - String projectName, String groupName, String assessmentName, Object 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 the URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, - String projectName, String groupName, String assessmentName, Object 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String groupName, String assessmentName, - Object 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String groupName, String assessmentName, - Object body, Context context); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessmentsV2OperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessmentsV2OperationsClient.java new file mode 100644 index 000000000000..7bba22eae305 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsAssessmentsV2OperationsClient.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AvsAssessmentV2Inner; +import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; + +/** + * An instance of this class provides access to all the operations defined in AvsAssessmentsV2OperationsClient. + */ +public interface AvsAssessmentsV2OperationsClient { + /** + * List AvsAssessmentV2 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 AvsAssessmentV2 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List AvsAssessmentV2 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 AvsAssessmentV2 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + Context context); + + /** + * Get a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvsAssessmentV2Inner get(String resourceGroupName, String projectName, String assessmentName); + + /** + * Create a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 aVS assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AvsAssessmentV2Inner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, AvsAssessmentV2Inner resource); + + /** + * Create a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 aVS assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AvsAssessmentV2Inner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, AvsAssessmentV2Inner resource, Context context); + + /** + * Create a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 aVS assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvsAssessmentV2Inner create(String resourceGroupName, String projectName, String assessmentName, + AvsAssessmentV2Inner resource); + + /** + * Create a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 aVS assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvsAssessmentV2Inner create(String resourceGroupName, String projectName, String assessmentName, + AvsAssessmentV2Inner resource, Context context); + + /** + * Delete a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AVS Assessment 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 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, Object 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 AVS Assessment 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 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, Object 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 AVS Assessment 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 URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object 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 AVS Assessment 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 URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object body, + Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsGraphAssessmentOptionsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsGraphAssessmentOptionsOperationsClient.java new file mode 100644 index 000000000000..5bb70ea0a273 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/AvsGraphAssessmentOptionsOperationsClient.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AvsGraphAssessmentOptionsInner; + +/** + * An instance of this class provides access to all the operations defined in AvsGraphAssessmentOptionsOperationsClient. + */ +public interface AvsGraphAssessmentOptionsOperationsClient { + /** + * List AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + Context context); + + /** + * Get a AvsGraphAssessmentOptions. + * + * @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 AvsGraphAssessmentOptions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + Context context); + + /** + * Get a AvsGraphAssessmentOptions. + * + * @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 AvsGraphAssessmentOptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvsGraphAssessmentOptionsInner get(String resourceGroupName, String projectName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/BusinessCaseAvsSummaryOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/BusinessCaseAvsSummaryOperationsClient.java new file mode 100644 index 000000000000..e3d5dcabc9a9 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/BusinessCaseAvsSummaryOperationsClient.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AvsSummaryInner; + +/** + * An instance of this class provides access to all the operations defined in BusinessCaseAvsSummaryOperationsClient. + */ +public interface BusinessCaseAvsSummaryOperationsClient { + /** + * List AvsSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 AvsSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName); + + /** + * List AvsSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 AvsSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName, + Context context); + + /** + * Get a AvsSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param avsSummaryName Gets the Name of the Avs 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 AvsSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + String avsSummaryName, Context context); + + /** + * Get a AvsSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param avsSummaryName Gets the Name of the Avs 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 AvsSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvsSummaryInner get(String resourceGroupName, String projectName, String businessCaseName, String avsSummaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/BusinessCaseIaasSummaryOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/BusinessCaseIaasSummaryOperationsClient.java new file mode 100644 index 000000000000..da6032e8b6f9 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/BusinessCaseIaasSummaryOperationsClient.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.IaasSummaryInner; + +/** + * An instance of this class provides access to all the operations defined in BusinessCaseIaasSummaryOperationsClient. + */ +public interface BusinessCaseIaasSummaryOperationsClient { + /** + * List IaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 IaasSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName); + + /** + * List IaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 IaasSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName, + Context context); + + /** + * Get a IaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param iaasSummaryName Gets the Name of the Iaas 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 IaasSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + String iaasSummaryName, Context context); + + /** + * Get a IaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param iaasSummaryName Gets the Name of the Iaas 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 IaasSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IaasSummaryInner get(String resourceGroupName, String projectName, String businessCaseName, String iaasSummaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/BusinessCaseOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/BusinessCaseOperationsClient.java new file mode 100644 index 000000000000..e449b6186171 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/BusinessCaseOperationsClient.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.BusinessCaseInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.CompareSummaryInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.ReportDownloadUrlInner; + +/** + * An instance of this class provides access to all the operations defined in BusinessCaseOperationsClient. + */ +public interface BusinessCaseOperationsClient { + /** + * List BusinessCase 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 BusinessCase list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List BusinessCase 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 BusinessCase list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 BusinessCase along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + Context context); + + /** + * Get a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 BusinessCase. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BusinessCaseInner get(String resourceGroupName, String projectName, String businessCaseName); + + /** + * Create a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 business case resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BusinessCaseInner> beginCreate(String resourceGroupName, + String projectName, String businessCaseName, BusinessCaseInner resource); + + /** + * Create a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 business case resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BusinessCaseInner> beginCreate(String resourceGroupName, + String projectName, String businessCaseName, BusinessCaseInner resource, Context context); + + /** + * Create a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 business case resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BusinessCaseInner create(String resourceGroupName, String projectName, String businessCaseName, + BusinessCaseInner resource); + + /** + * Create a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 business case resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BusinessCaseInner create(String resourceGroupName, String projectName, String businessCaseName, + BusinessCaseInner resource, Context context); + + /** + * Delete a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 businessCaseName, + Context context); + + /** + * Delete a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 businessCaseName); + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CompareSummaryInner> beginCompareSummary(String resourceGroupName, + String projectName, String businessCaseName, Object body); + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CompareSummaryInner> beginCompareSummary(String resourceGroupName, + String projectName, String businessCaseName, Object body, Context context); + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CompareSummaryInner compareSummary(String resourceGroupName, String projectName, String businessCaseName, + Object body); + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CompareSummaryInner compareSummary(String resourceGroupName, String projectName, String businessCaseName, + Object body, Context context); + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 the URL for downloading the business case in a report format. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReportDownloadUrlInner> + beginGetReportDownloadUrl(String resourceGroupName, String projectName, String businessCaseName, Object body); + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 the URL for downloading the business case in a report format. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReportDownloadUrlInner> beginGetReportDownloadUrl( + String resourceGroupName, String projectName, String businessCaseName, Object body, Context context); + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 URL for downloading the business case in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReportDownloadUrlInner getReportDownloadUrl(String resourceGroupName, String projectName, String businessCaseName, + Object body); + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 URL for downloading the business case in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReportDownloadUrlInner getReportDownloadUrl(String resourceGroupName, String projectName, String businessCaseName, + Object body, Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/BusinessCaseOverviewSummaryOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/BusinessCaseOverviewSummaryOperationsClient.java new file mode 100644 index 000000000000..c95f8fa2fc52 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/BusinessCaseOverviewSummaryOperationsClient.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.OverviewSummaryInner; + +/** + * An instance of this class provides access to all the operations defined in + * BusinessCaseOverviewSummaryOperationsClient. + */ +public interface BusinessCaseOverviewSummaryOperationsClient { + /** + * List OverviewSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 OverviewSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName); + + /** + * List OverviewSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 OverviewSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, Context context); + + /** + * Get a OverviewSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param overviewSummaryName Gets the Name of the Overview 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 OverviewSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String overviewSummaryName, Context context); + + /** + * Get a OverviewSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param overviewSummaryName Gets the Name of the Overview 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 OverviewSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OverviewSummaryInner get(String resourceGroupName, String projectName, String businessCaseName, + String overviewSummaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/BusinessCasePaasSummaryOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/BusinessCasePaasSummaryOperationsClient.java new file mode 100644 index 000000000000..0c90d3e8f0f7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/BusinessCasePaasSummaryOperationsClient.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.PaasSummaryInner; + +/** + * An instance of this class provides access to all the operations defined in BusinessCasePaasSummaryOperationsClient. + */ +public interface BusinessCasePaasSummaryOperationsClient { + /** + * List PaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 PaasSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName); + + /** + * List PaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 PaasSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName, + Context context); + + /** + * Get a PaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param paasSummaryName Gets the Name of the Paas 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 PaasSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + String paasSummaryName, Context context); + + /** + * Get a PaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param paasSummaryName Gets the Name of the Paas 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 PaasSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PaasSummaryInner get(String resourceGroupName, String projectName, String businessCaseName, String paasSummaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/CompoundAssessmentOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/CompoundAssessmentOperationsClient.java new file mode 100644 index 000000000000..fde4b95c3c92 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/CompoundAssessmentOperationsClient.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.CompoundAssessmentInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; + +/** + * An instance of this class provides access to all the operations defined in CompoundAssessmentOperationsClient. + */ +public interface CompoundAssessmentOperationsClient { + /** + * List CompoundAssessment 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 CompoundAssessment list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List CompoundAssessment 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 CompoundAssessment list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 CompoundAssessment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String compoundAssessmentName, Context context); + + /** + * Get a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 CompoundAssessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CompoundAssessmentInner get(String resourceGroupName, String projectName, String compoundAssessmentName); + + /** + * Create a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compound assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CompoundAssessmentInner> beginCreate(String resourceGroupName, + String projectName, String compoundAssessmentName, CompoundAssessmentInner resource); + + /** + * Create a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compound assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CompoundAssessmentInner> beginCreate(String resourceGroupName, + String projectName, String compoundAssessmentName, CompoundAssessmentInner resource, Context context); + + /** + * Create a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compound assessment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CompoundAssessmentInner create(String resourceGroupName, String projectName, String compoundAssessmentName, + CompoundAssessmentInner resource); + + /** + * Create a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compound assessment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CompoundAssessmentInner create(String resourceGroupName, String projectName, String compoundAssessmentName, + CompoundAssessmentInner resource, Context context); + + /** + * Delete a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compoundAssessmentName, + Context context); + + /** + * Delete a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compoundAssessmentName); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String compoundAssessmentName, Object body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String compoundAssessmentName, Object body, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String compoundAssessmentName, + Object body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String compoundAssessmentName, + Object body, Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/CompoundAssessmentSummaryOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/CompoundAssessmentSummaryOperationsClient.java new file mode 100644 index 000000000000..cee2c8a70135 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/CompoundAssessmentSummaryOperationsClient.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.WebAppCompoundAssessmentSummaryInner; + +/** + * An instance of this class provides access to all the operations defined in CompoundAssessmentSummaryOperationsClient. + */ +public interface CompoundAssessmentSummaryOperationsClient { + /** + * List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 WebAppCompoundAssessmentSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String compoundAssessmentName); + + /** + * List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 WebAppCompoundAssessmentSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String compoundAssessmentName, Context context); + + /** + * Get a WebAppCompoundAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment ARM name. + * @param summaryName Gets the Name of the WebApp compound assessment 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 WebAppCompoundAssessmentSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String compoundAssessmentName, String summaryName, Context context); + + /** + * Get a WebAppCompoundAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment ARM name. + * @param summaryName Gets the Name of the WebApp compound assessment 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 WebAppCompoundAssessmentSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebAppCompoundAssessmentSummaryInner get(String resourceGroupName, String projectName, + String compoundAssessmentName, String summaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/EvaluatedAvsMachinesOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/EvaluatedAvsMachinesOperationsClient.java new file mode 100644 index 000000000000..3e5a18ce349d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/EvaluatedAvsMachinesOperationsClient.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.EvaluatedAvsMachineInner; + +/** + * An instance of this class provides access to all the operations defined in EvaluatedAvsMachinesOperationsClient. + */ +public interface EvaluatedAvsMachinesOperationsClient { + /** + * List EvaluatedAvsMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedAvsMachine list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName); + + /** + * List EvaluatedAvsMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedAvsMachine list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context); + + /** + * Get a EvaluatedAvsMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedAvsMachineName Business case Evaluated AVS 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 EvaluatedAvsMachine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedAvsMachineName, Context context); + + /** + * Get a EvaluatedAvsMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedAvsMachineName Business case Evaluated AVS 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 EvaluatedAvsMachine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EvaluatedAvsMachineInner get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedAvsMachineName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/EvaluatedMachinesOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/EvaluatedMachinesOperationsClient.java new file mode 100644 index 000000000000..78cd01560063 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/EvaluatedMachinesOperationsClient.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.EvaluatedMachineInner; + +/** + * An instance of this class provides access to all the operations defined in EvaluatedMachinesOperationsClient. + */ +public interface EvaluatedMachinesOperationsClient { + /** + * List EvaluatedMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedMachine list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName); + + /** + * List EvaluatedMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedMachine list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context); + + /** + * Get a EvaluatedMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedMachineName Business case Evaluated 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 EvaluatedMachine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedMachineName, Context context); + + /** + * Get a EvaluatedMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedMachineName Business case Evaluated 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 EvaluatedMachine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EvaluatedMachineInner get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedMachineName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/EvaluatedSqlEntitiesOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/EvaluatedSqlEntitiesOperationsClient.java new file mode 100644 index 000000000000..7b0d5e7f8f64 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/EvaluatedSqlEntitiesOperationsClient.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.EvaluatedSqlEntityInner; + +/** + * An instance of this class provides access to all the operations defined in EvaluatedSqlEntitiesOperationsClient. + */ +public interface EvaluatedSqlEntitiesOperationsClient { + /** + * List EvaluatedSqlEntity resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedSqlEntity list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName); + + /** + * List EvaluatedSqlEntity resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedSqlEntity list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context); + + /** + * Get a EvaluatedSqlEntity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedSqlEntityName Business case Evaluated sql entity 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 EvaluatedSqlEntity along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedSqlEntityName, Context context); + + /** + * Get a EvaluatedSqlEntity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedSqlEntityName Business case Evaluated sql entity 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 EvaluatedSqlEntity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EvaluatedSqlEntityInner get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedSqlEntityName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/EvaluatedWebAppsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/EvaluatedWebAppsOperationsClient.java new file mode 100644 index 000000000000..14e8342f3cb6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/EvaluatedWebAppsOperationsClient.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.EvaluatedWebAppInner; + +/** + * An instance of this class provides access to all the operations defined in EvaluatedWebAppsOperationsClient. + */ +public interface EvaluatedWebAppsOperationsClient { + /** + * List EvaluatedWebApp resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedWebApp list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName); + + /** + * List EvaluatedWebApp resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedWebApp list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context); + + /** + * Get a EvaluatedWebApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedWebAppName Business case Evaluated web App 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 EvaluatedWebApp along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedWebAppName, Context context); + + /** + * Get a EvaluatedWebApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedWebAppName Business case Evaluated web App 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 EvaluatedWebApp. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EvaluatedWebAppInner get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedWebAppName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/GroupsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/GroupsOperationsClient.java deleted file mode 100644 index 25b4362edabd..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/GroupsOperationsClient.java +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.GroupInner; -import com.azure.resourcemanager.migration.assessment.models.UpdateGroupBody; - -/** - * An instance of this class provides access to all the operations defined in GroupsOperationsClient. - */ -public interface GroupsOperationsClient { - /** - * List Group 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 Group list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); - - /** - * List Group 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 Group list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, Context context); - - /** - * Get a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Group along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - Context context); - - /** - * Get a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupInner get(String resourceGroupName, String projectName, String groupName); - - /** - * Create a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupInner> beginCreate(String resourceGroupName, String projectName, - String groupName, GroupInner resource); - - /** - * Create a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupInner> beginCreate(String resourceGroupName, String projectName, - String groupName, GroupInner resource, Context context); - - /** - * Create a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupInner create(String resourceGroupName, String projectName, String groupName, GroupInner resource); - - /** - * Create a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupInner create(String resourceGroupName, String projectName, String groupName, GroupInner resource, - Context context); - - /** - * Delete a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 groupName, Context context); - - /** - * Delete a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 groupName); - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupInner> beginUpdateMachines(String resourceGroupName, String projectName, - String groupName, UpdateGroupBody body); - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupInner> beginUpdateMachines(String resourceGroupName, String projectName, - String groupName, UpdateGroupBody body, Context context); - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupInner updateMachines(String resourceGroupName, String projectName, String groupName, UpdateGroupBody body); - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupInner updateMachines(String resourceGroupName, String projectName, String groupName, UpdateGroupBody body, - Context context); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/HeterogeneousAssessmentOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/HeterogeneousAssessmentOperationsClient.java new file mode 100644 index 000000000000..3d5586d76be3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/HeterogeneousAssessmentOperationsClient.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.HeterogeneousAssessmentInner; + +/** + * An instance of this class provides access to all the operations defined in HeterogeneousAssessmentOperationsClient. + */ +public interface HeterogeneousAssessmentOperationsClient { + /** + * List HeterogeneousAssessment 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 HeterogeneousAssessment list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List HeterogeneousAssessment 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 HeterogeneousAssessment list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + Context context); + + /** + * Get a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HeterogeneousAssessmentInner get(String resourceGroupName, String projectName, String assessmentName); + + /** + * Create a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 heterogeneous assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HeterogeneousAssessmentInner> beginCreate( + String resourceGroupName, String projectName, String assessmentName, HeterogeneousAssessmentInner resource); + + /** + * Create a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 heterogeneous assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HeterogeneousAssessmentInner> beginCreate( + String resourceGroupName, String projectName, String assessmentName, HeterogeneousAssessmentInner resource, + Context context); + + /** + * Create a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 heterogeneous assessment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HeterogeneousAssessmentInner create(String resourceGroupName, String projectName, String assessmentName, + HeterogeneousAssessmentInner resource); + + /** + * Create a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 heterogeneous assessment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HeterogeneousAssessmentInner create(String resourceGroupName, String projectName, String assessmentName, + HeterogeneousAssessmentInner resource, Context context); + + /** + * Delete a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/HeterogeneousAssessmentSummaryOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/HeterogeneousAssessmentSummaryOperationsClient.java new file mode 100644 index 000000000000..06e485eda07c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/HeterogeneousAssessmentSummaryOperationsClient.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.HeterogeneousAssessmentSummaryInner; + +/** + * An instance of this class provides access to all the operations defined in + * HeterogeneousAssessmentSummaryOperationsClient. + */ +public interface HeterogeneousAssessmentSummaryOperationsClient { + /** + * List HeterogeneousAssessmentSummary resources by HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessmentSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List HeterogeneousAssessmentSummary resources by HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessmentSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a HeterogeneousAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment ARM name. + * @param summaryName Gets the Name of the Heterogeneous assessment 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 HeterogeneousAssessmentSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String summaryName, Context context); + + /** + * Get a HeterogeneousAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment ARM name. + * @param summaryName Gets the Name of the Heterogeneous assessment 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 HeterogeneousAssessmentSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HeterogeneousAssessmentSummaryInner get(String resourceGroupName, String projectName, String assessmentName, + String summaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/HypervCollectorsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/HypervCollectorsOperationsClient.java index 101f8478dff4..0987b1643e92 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/HypervCollectorsOperationsClient.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/HypervCollectorsOperationsClient.java @@ -28,7 +28,7 @@ public interface HypervCollectorsOperationsClient { * @return the response of a HypervCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List HypervCollector resources by AssessmentProject. @@ -42,8 +42,7 @@ public interface HypervCollectorsOperationsClient { * @return the response of a HypervCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** * Get a HypervCollector. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/ImportCollectorsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/ImportCollectorsOperationsClient.java index 4273a751dc52..a6b2782a4eab 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/ImportCollectorsOperationsClient.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/ImportCollectorsOperationsClient.java @@ -28,7 +28,7 @@ public interface ImportCollectorsOperationsClient { * @return the response of a ImportCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List ImportCollector resources by AssessmentProject. @@ -42,8 +42,7 @@ public interface ImportCollectorsOperationsClient { * @return the response of a ImportCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** * Get a ImportCollector. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/ImportSqlCollectorOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/ImportSqlCollectorOperationsClient.java new file mode 100644 index 000000000000..1cf81003f426 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/ImportSqlCollectorOperationsClient.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.ImportSqlCollectorInner; + +/** + * An instance of this class provides access to all the operations defined in ImportSqlCollectorOperationsClient. + */ +public interface ImportSqlCollectorOperationsClient { + /** + * List ImportSqlCollector 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 ImportSqlCollector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List ImportSqlCollector 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 ImportSqlCollector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 ImportSqlCollector along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String importSqlCollectorsName, Context context); + + /** + * Get a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 ImportSqlCollector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImportSqlCollectorInner get(String resourceGroupName, String projectName, String importSqlCollectorsName); + + /** + * Create a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 import SQL Collector REST resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ImportSqlCollectorInner> beginCreate(String resourceGroupName, + String projectName, String importSqlCollectorsName, ImportSqlCollectorInner resource); + + /** + * Create a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 import SQL Collector REST resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ImportSqlCollectorInner> beginCreate(String resourceGroupName, + String projectName, String importSqlCollectorsName, ImportSqlCollectorInner resource, Context context); + + /** + * Create a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 import SQL Collector REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImportSqlCollectorInner create(String resourceGroupName, String projectName, String importSqlCollectorsName, + ImportSqlCollectorInner resource); + + /** + * Create a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 import SQL Collector REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImportSqlCollectorInner create(String resourceGroupName, String projectName, String importSqlCollectorsName, + ImportSqlCollectorInner resource, Context context); + + /** + * Delete a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 importSqlCollectorsName, + Context context); + + /** + * Delete a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 importSqlCollectorsName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MachineAssessmentV2SummaryOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MachineAssessmentV2SummaryOperationsClient.java new file mode 100644 index 000000000000..b5387055395e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MachineAssessmentV2SummaryOperationsClient.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.MachineAssessmentV2SummaryInner; + +/** + * An instance of this class provides access to all the operations defined in + * MachineAssessmentV2SummaryOperationsClient. + */ +public interface MachineAssessmentV2SummaryOperationsClient { + /** + * 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); + + /** + * 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); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MachineAssessmentsV2OperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MachineAssessmentsV2OperationsClient.java new file mode 100644 index 000000000000..98fbc884dac6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MachineAssessmentsV2OperationsClient.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.MachineAssessmentV2Inner; + +/** + * An instance of this class provides access to all the operations defined in MachineAssessmentsV2OperationsClient. + */ +public interface MachineAssessmentsV2OperationsClient { + /** + * 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); + + /** + * 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); + + /** + * 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 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, Object 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 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, Object 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 the URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object 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 URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object body, + Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MachineGraphAssessmentOptionsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MachineGraphAssessmentOptionsOperationsClient.java new file mode 100644 index 000000000000..bb8886e1d171 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MachineGraphAssessmentOptionsOperationsClient.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.MachineGraphAssessmentOptionsInner; + +/** + * An instance of this class provides access to all the operations defined in + * MachineGraphAssessmentOptionsOperationsClient. + */ +public interface MachineGraphAssessmentOptionsOperationsClient { + /** + * 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); + + /** + * 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); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MachinesOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MachinesOperationsClient.java deleted file mode 100644 index 8c7db2769da6..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MachinesOperationsClient.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.MachineInner; - -/** - * An instance of this class provides access to all the operations defined in MachinesOperationsClient. - */ -public interface MachinesOperationsClient { - /** - * List Machine 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 Machine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); - - /** - * List Machine resources by AssessmentProject. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project 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 Machine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, String filter, - Integer pageSize, String continuationToken, Integer totalRecordCount, Context context); - - /** - * Get a Machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param machineName Assessible 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 Machine along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String projectName, String machineName, - Context context); - - /** - * Get a Machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param machineName Assessible 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 Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MachineInner get(String resourceGroupName, String projectName, String machineName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MigrationAssessmentManagementClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MigrationAssessmentManagementClient.java index 51c1e938e946..1834d48e030c 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MigrationAssessmentManagementClient.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/MigrationAssessmentManagementClient.java @@ -12,7 +12,7 @@ */ public interface MigrationAssessmentManagementClient { /** - * Gets The ID of the target subscription. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -61,151 +61,319 @@ public interface MigrationAssessmentManagementClient { AssessmentProjectsOperationsClient getAssessmentProjectsOperations(); /** - * Gets the AssessmentOptionsOperationsClient object to access its operations. + * Gets the PrivateEndpointConnectionOperationsClient object to access its operations. * - * @return the AssessmentOptionsOperationsClient object. + * @return the PrivateEndpointConnectionOperationsClient object. */ - AssessmentOptionsOperationsClient getAssessmentOptionsOperations(); + PrivateEndpointConnectionOperationsClient getPrivateEndpointConnectionOperations(); /** - * Gets the AvsAssessmentOptionsOperationsClient object to access its operations. + * Gets the PrivateLinkResourceOperationsClient object to access its operations. * - * @return the AvsAssessmentOptionsOperationsClient object. + * @return the PrivateLinkResourceOperationsClient object. */ - AvsAssessmentOptionsOperationsClient getAvsAssessmentOptionsOperations(); + PrivateLinkResourceOperationsClient getPrivateLinkResourceOperations(); /** - * Gets the GroupsOperationsClient object to access its operations. + * Gets the AssessmentProjectSummaryOperationsClient object to access its operations. * - * @return the GroupsOperationsClient object. + * @return the AssessmentProjectSummaryOperationsClient object. */ - GroupsOperationsClient getGroupsOperations(); + AssessmentProjectSummaryOperationsClient getAssessmentProjectSummaryOperations(); /** - * Gets the AssessmentsOperationsClient object to access its operations. + * Gets the AvsGraphAssessmentOptionsOperationsClient object to access its operations. * - * @return the AssessmentsOperationsClient object. + * @return the AvsGraphAssessmentOptionsOperationsClient object. */ - AssessmentsOperationsClient getAssessmentsOperations(); + AvsGraphAssessmentOptionsOperationsClient getAvsGraphAssessmentOptionsOperations(); /** - * Gets the AssessedMachinesOperationsClient object to access its operations. + * Gets the AvsAssessmentsV2OperationsClient object to access its operations. * - * @return the AssessedMachinesOperationsClient object. + * @return the AvsAssessmentsV2OperationsClient object. */ - AssessedMachinesOperationsClient getAssessedMachinesOperations(); + AvsAssessmentsV2OperationsClient getAvsAssessmentsV2Operations(); /** - * Gets the AvsAssessmentsOperationsClient object to access its operations. + * Gets the AvsAssessedMachinesV2OperationsClient object to access its operations. * - * @return the AvsAssessmentsOperationsClient object. + * @return the AvsAssessedMachinesV2OperationsClient object. */ - AvsAssessmentsOperationsClient getAvsAssessmentsOperations(); + AvsAssessedMachinesV2OperationsClient getAvsAssessedMachinesV2Operations(); /** - * Gets the AvsAssessedMachinesOperationsClient object to access its operations. + * Gets the AvsAssessmentV2SummaryOperationsClient object to access its operations. * - * @return the AvsAssessedMachinesOperationsClient object. + * @return the AvsAssessmentV2SummaryOperationsClient object. */ - AvsAssessedMachinesOperationsClient getAvsAssessedMachinesOperations(); + AvsAssessmentV2SummaryOperationsClient getAvsAssessmentV2SummaryOperations(); /** - * Gets the SqlAssessmentV2OperationsClient object to access its operations. + * Gets the HeterogeneousAssessmentOperationsClient object to access its operations. * - * @return the SqlAssessmentV2OperationsClient object. + * @return the HeterogeneousAssessmentOperationsClient object. */ - SqlAssessmentV2OperationsClient getSqlAssessmentV2Operations(); + HeterogeneousAssessmentOperationsClient getHeterogeneousAssessmentOperations(); /** - * Gets the AssessedSqlDatabaseV2OperationsClient object to access its operations. + * Gets the HeterogeneousAssessmentSummaryOperationsClient object to access its operations. * - * @return the AssessedSqlDatabaseV2OperationsClient object. + * @return the HeterogeneousAssessmentSummaryOperationsClient object. */ - AssessedSqlDatabaseV2OperationsClient getAssessedSqlDatabaseV2Operations(); + HeterogeneousAssessmentSummaryOperationsClient getHeterogeneousAssessmentSummaryOperations(); /** - * Gets the AssessedSqlInstanceV2OperationsClient object to access its operations. + * Gets the MachineGraphAssessmentOptionsOperationsClient object to access its operations. * - * @return the AssessedSqlInstanceV2OperationsClient object. + * @return the MachineGraphAssessmentOptionsOperationsClient object. */ - AssessedSqlInstanceV2OperationsClient getAssessedSqlInstanceV2Operations(); + MachineGraphAssessmentOptionsOperationsClient getMachineGraphAssessmentOptionsOperations(); /** - * Gets the AssessedSqlMachinesOperationsClient object to access its operations. + * Gets the MachineAssessmentsV2OperationsClient object to access its operations. * - * @return the AssessedSqlMachinesOperationsClient object. + * @return the MachineAssessmentsV2OperationsClient object. */ - AssessedSqlMachinesOperationsClient getAssessedSqlMachinesOperations(); + MachineAssessmentsV2OperationsClient getMachineAssessmentsV2Operations(); /** - * Gets the AssessedSqlRecommendedEntityOperationsClient object to access its operations. + * Gets the AssessedMachinesV2OperationsClient object to access its operations. * - * @return the AssessedSqlRecommendedEntityOperationsClient object. + * @return the AssessedMachinesV2OperationsClient object. */ - AssessedSqlRecommendedEntityOperationsClient getAssessedSqlRecommendedEntityOperations(); + AssessedMachinesV2OperationsClient getAssessedMachinesV2Operations(); /** - * Gets the SqlAssessmentV2SummaryOperationsClient object to access its operations. + * Gets the MachineAssessmentV2SummaryOperationsClient object to access its operations. * - * @return the SqlAssessmentV2SummaryOperationsClient object. + * @return the MachineAssessmentV2SummaryOperationsClient object. */ - SqlAssessmentV2SummaryOperationsClient getSqlAssessmentV2SummaryOperations(); + MachineAssessmentV2SummaryOperationsClient getMachineAssessmentV2SummaryOperations(); /** - * Gets the HypervCollectorsOperationsClient object to access its operations. + * Gets the SqlGraphAssessmentOptionsOperationsClient object to access its operations. * - * @return the HypervCollectorsOperationsClient object. + * @return the SqlGraphAssessmentOptionsOperationsClient object. */ - HypervCollectorsOperationsClient getHypervCollectorsOperations(); + SqlGraphAssessmentOptionsOperationsClient getSqlGraphAssessmentOptionsOperations(); /** - * Gets the ImportCollectorsOperationsClient object to access its operations. + * Gets the SqlAssessmentV3OperationsClient object to access its operations. * - * @return the ImportCollectorsOperationsClient object. + * @return the SqlAssessmentV3OperationsClient object. */ - ImportCollectorsOperationsClient getImportCollectorsOperations(); + SqlAssessmentV3OperationsClient getSqlAssessmentV3Operations(); /** - * Gets the MachinesOperationsClient object to access its operations. + * Gets the AssessedSqlDatabaseV3OperationsClient object to access its operations. * - * @return the MachinesOperationsClient object. + * @return the AssessedSqlDatabaseV3OperationsClient object. */ - MachinesOperationsClient getMachinesOperations(); + AssessedSqlDatabaseV3OperationsClient getAssessedSqlDatabaseV3Operations(); /** - * Gets the PrivateEndpointConnectionOperationsClient object to access its operations. + * Gets the AssessedSqlInstanceV3OperationsClient object to access its operations. * - * @return the PrivateEndpointConnectionOperationsClient object. + * @return the AssessedSqlInstanceV3OperationsClient object. */ - PrivateEndpointConnectionOperationsClient getPrivateEndpointConnectionOperations(); + AssessedSqlInstanceV3OperationsClient getAssessedSqlInstanceV3Operations(); /** - * Gets the PrivateLinkResourceOperationsClient object to access its operations. + * Gets the AssessedSqlMachinesV3OperationsClient object to access its operations. * - * @return the PrivateLinkResourceOperationsClient object. + * @return the AssessedSqlMachinesV3OperationsClient object. */ - PrivateLinkResourceOperationsClient getPrivateLinkResourceOperations(); + AssessedSqlMachinesV3OperationsClient getAssessedSqlMachinesV3Operations(); /** - * Gets the AssessmentProjectSummaryOperationsClient object to access its operations. + * Gets the SqlAssessmentV3SummaryOperationsClient object to access its operations. * - * @return the AssessmentProjectSummaryOperationsClient object. + * @return the SqlAssessmentV3SummaryOperationsClient object. */ - AssessmentProjectSummaryOperationsClient getAssessmentProjectSummaryOperations(); + SqlAssessmentV3SummaryOperationsClient getSqlAssessmentV3SummaryOperations(); /** - * Gets the ServerCollectorsOperationsClient object to access its operations. + * Gets the BusinessCaseOperationsClient object to access its operations. * - * @return the ServerCollectorsOperationsClient object. + * @return the BusinessCaseOperationsClient object. */ - ServerCollectorsOperationsClient getServerCollectorsOperations(); + BusinessCaseOperationsClient getBusinessCaseOperations(); + + /** + * Gets the BusinessCaseAvsSummaryOperationsClient object to access its operations. + * + * @return the BusinessCaseAvsSummaryOperationsClient object. + */ + BusinessCaseAvsSummaryOperationsClient getBusinessCaseAvsSummaryOperations(); + + /** + * Gets the EvaluatedAvsMachinesOperationsClient object to access its operations. + * + * @return the EvaluatedAvsMachinesOperationsClient object. + */ + EvaluatedAvsMachinesOperationsClient getEvaluatedAvsMachinesOperations(); + + /** + * Gets the EvaluatedMachinesOperationsClient object to access its operations. + * + * @return the EvaluatedMachinesOperationsClient object. + */ + EvaluatedMachinesOperationsClient getEvaluatedMachinesOperations(); + + /** + * Gets the EvaluatedSqlEntitiesOperationsClient object to access its operations. + * + * @return the EvaluatedSqlEntitiesOperationsClient object. + */ + EvaluatedSqlEntitiesOperationsClient getEvaluatedSqlEntitiesOperations(); + + /** + * Gets the EvaluatedWebAppsOperationsClient object to access its operations. + * + * @return the EvaluatedWebAppsOperationsClient object. + */ + EvaluatedWebAppsOperationsClient getEvaluatedWebAppsOperations(); + + /** + * Gets the BusinessCaseIaasSummaryOperationsClient object to access its operations. + * + * @return the BusinessCaseIaasSummaryOperationsClient object. + */ + BusinessCaseIaasSummaryOperationsClient getBusinessCaseIaasSummaryOperations(); + + /** + * Gets the BusinessCaseOverviewSummaryOperationsClient object to access its operations. + * + * @return the BusinessCaseOverviewSummaryOperationsClient object. + */ + BusinessCaseOverviewSummaryOperationsClient getBusinessCaseOverviewSummaryOperations(); + + /** + * Gets the BusinessCasePaasSummaryOperationsClient object to access its operations. + * + * @return the BusinessCasePaasSummaryOperationsClient object. + */ + BusinessCasePaasSummaryOperationsClient getBusinessCasePaasSummaryOperations(); + + /** + * Gets the WebAppGraphAssessmentOptionsOperationsClient object to access its operations. + * + * @return the WebAppGraphAssessmentOptionsOperationsClient object. + */ + WebAppGraphAssessmentOptionsOperationsClient getWebAppGraphAssessmentOptionsOperations(); + + /** + * Gets the WebAppAssessmentV3OperationsClient object to access its operations. + * + * @return the WebAppAssessmentV3OperationsClient object. + */ + WebAppAssessmentV3OperationsClient getWebAppAssessmentV3Operations(); + + /** + * Gets the AssessedWebAppsV3OperationsClient object to access its operations. + * + * @return the AssessedWebAppsV3OperationsClient object. + */ + AssessedWebAppsV3OperationsClient getAssessedWebAppsV3Operations(); + + /** + * Gets the WebAppAssessmentV3SummaryOperationsClient object to access its operations. + * + * @return the WebAppAssessmentV3SummaryOperationsClient object. + */ + WebAppAssessmentV3SummaryOperationsClient getWebAppAssessmentV3SummaryOperations(); + + /** + * Gets the WebAppServicePlansOperationsClient object to access its operations. + * + * @return the WebAppServicePlansOperationsClient object. + */ + WebAppServicePlansOperationsClient getWebAppServicePlansOperations(); + + /** + * Gets the CompoundAssessmentOperationsClient object to access its operations. + * + * @return the CompoundAssessmentOperationsClient object. + */ + CompoundAssessmentOperationsClient getCompoundAssessmentOperations(); + + /** + * Gets the CompoundAssessmentSummaryOperationsClient object to access its operations. + * + * @return the CompoundAssessmentSummaryOperationsClient object. + */ + CompoundAssessmentSummaryOperationsClient getCompoundAssessmentSummaryOperations(); + + /** + * Gets the AksOptionsOperationsClient object to access its operations. + * + * @return the AksOptionsOperationsClient object. + */ + AksOptionsOperationsClient getAksOptionsOperations(); + + /** + * Gets the AksAssessmentOperationsClient object to access its operations. + * + * @return the AksAssessmentOperationsClient object. + */ + AksAssessmentOperationsClient getAksAssessmentOperations(); + + /** + * Gets the AssessedWebApplicationOperationsClient object to access its operations. + * + * @return the AssessedWebApplicationOperationsClient object. + */ + AssessedWebApplicationOperationsClient getAssessedWebApplicationOperations(); + + /** + * Gets the AksClusterOperationsClient object to access its operations. + * + * @return the AksClusterOperationsClient object. + */ + AksClusterOperationsClient getAksClusterOperations(); + + /** + * Gets the AksCostDetailOperationsClient object to access its operations. + * + * @return the AksCostDetailOperationsClient object. + */ + AksCostDetailOperationsClient getAksCostDetailOperations(); + + /** + * Gets the AksSummaryOperationsClient object to access its operations. + * + * @return the AksSummaryOperationsClient object. + */ + AksSummaryOperationsClient getAksSummaryOperations(); + + /** + * Gets the HypervCollectorsOperationsClient object to access its operations. + * + * @return the HypervCollectorsOperationsClient object. + */ + HypervCollectorsOperationsClient getHypervCollectorsOperations(); + + /** + * Gets the ImportSqlCollectorOperationsClient object to access its operations. + * + * @return the ImportSqlCollectorOperationsClient object. + */ + ImportSqlCollectorOperationsClient getImportSqlCollectorOperations(); /** - * Gets the SqlAssessmentOptionsOperationsClient object to access its operations. + * Gets the ImportCollectorsOperationsClient object to access its operations. * - * @return the SqlAssessmentOptionsOperationsClient object. + * @return the ImportCollectorsOperationsClient object. */ - SqlAssessmentOptionsOperationsClient getSqlAssessmentOptionsOperations(); + ImportCollectorsOperationsClient getImportCollectorsOperations(); + + /** + * Gets the ServerCollectorsOperationsClient object to access its operations. + * + * @return the ServerCollectorsOperationsClient object. + */ + ServerCollectorsOperationsClient getServerCollectorsOperations(); /** * Gets the SqlCollectorOperationsClient object to access its operations. @@ -220,4 +388,11 @@ public interface MigrationAssessmentManagementClient { * @return the VmwareCollectorsOperationsClient object. */ VmwareCollectorsOperationsClient getVmwareCollectorsOperations(); + + /** + * Gets the WebAppCollectorOperationsClient object to access its operations. + * + * @return the WebAppCollectorOperationsClient object. + */ + WebAppCollectorOperationsClient getWebAppCollectorOperations(); } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/PrivateEndpointConnectionOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/PrivateEndpointConnectionOperationsClient.java index cf56d4399537..dd0ce4dd62c6 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/PrivateEndpointConnectionOperationsClient.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/PrivateEndpointConnectionOperationsClient.java @@ -29,7 +29,7 @@ public interface PrivateEndpointConnectionOperationsClient { * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List PrivateEndpointConnection resources by AssessmentProject. @@ -44,7 +44,7 @@ public interface PrivateEndpointConnectionOperationsClient { * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/PrivateLinkResourceOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/PrivateLinkResourceOperationsClient.java index 5b9aca756a73..427c94ed3c7d 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/PrivateLinkResourceOperationsClient.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/PrivateLinkResourceOperationsClient.java @@ -26,7 +26,7 @@ public interface PrivateLinkResourceOperationsClient { * @return the response of a PrivateLinkResource list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List PrivateLinkResource resources by AssessmentProject. @@ -40,8 +40,7 @@ public interface PrivateLinkResourceOperationsClient { * @return the response of a PrivateLinkResource list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** * Get a PrivateLinkResource. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/ServerCollectorsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/ServerCollectorsOperationsClient.java index 8289d03cf7e6..cfa6958543b2 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/ServerCollectorsOperationsClient.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/ServerCollectorsOperationsClient.java @@ -28,7 +28,7 @@ public interface ServerCollectorsOperationsClient { * @return the response of a ServerCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List ServerCollector resources by AssessmentProject. @@ -42,8 +42,7 @@ public interface ServerCollectorsOperationsClient { * @return the response of a ServerCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** * Get a ServerCollector. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlAssessmentOptionsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlAssessmentOptionsOperationsClient.java deleted file mode 100644 index 0c0fd604c4bf..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlAssessmentOptionsOperationsClient.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.SqlAssessmentOptionsInner; - -/** - * An instance of this class provides access to all the operations defined in SqlAssessmentOptionsOperationsClient. - */ -public interface SqlAssessmentOptionsOperationsClient { - /** - * List SqlAssessmentOptions 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 SqlAssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); - - /** - * List SqlAssessmentOptions 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 SqlAssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); - - /** - * Get a SqlAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName Sql assessment options ARM name. Accepted values is 'default'. - * @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 SqlAssessmentOptions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String projectName, - String assessmentOptionsName, Context context); - - /** - * Get a SqlAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName Sql assessment options ARM name. Accepted values is 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 SqlAssessmentOptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SqlAssessmentOptionsInner get(String resourceGroupName, String projectName, String assessmentOptionsName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlAssessmentV2OperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlAssessmentV2OperationsClient.java deleted file mode 100644 index 2aa35203f534..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlAssessmentV2OperationsClient.java +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.DownloadUrlInner; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV2Inner; - -/** - * An instance of this class provides access to all the operations defined in SqlAssessmentV2OperationsClient. - */ -public interface SqlAssessmentV2OperationsClient { - /** - * List SqlAssessmentV2 resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 SqlAssessmentV2 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName); - - /** - * List SqlAssessmentV2 resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 SqlAssessmentV2 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName, - Context context); - - /** - * Get a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, Context context); - - /** - * Get a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SqlAssessmentV2Inner get(String resourceGroupName, String projectName, String groupName, String assessmentName); - - /** - * Create a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SqlAssessmentV2Inner> beginCreate(String resourceGroupName, - String projectName, String groupName, String assessmentName, SqlAssessmentV2Inner resource); - - /** - * Create a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SqlAssessmentV2Inner> beginCreate(String resourceGroupName, - String projectName, String groupName, String assessmentName, SqlAssessmentV2Inner resource, Context context); - - /** - * Create a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SqlAssessmentV2Inner create(String resourceGroupName, String projectName, String groupName, String assessmentName, - SqlAssessmentV2Inner resource); - - /** - * Create a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SqlAssessmentV2Inner create(String resourceGroupName, String projectName, String groupName, String assessmentName, - SqlAssessmentV2Inner resource, Context context); - - /** - * Delete a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 groupName, - String assessmentName, Context context); - - /** - * Delete a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 groupName, 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 the URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, - String projectName, String groupName, String assessmentName, Object 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 the URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, - String projectName, String groupName, String assessmentName, Object 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String groupName, String assessmentName, - Object 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String groupName, String assessmentName, - Object body, Context context); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlAssessmentV2SummaryOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlAssessmentV2SummaryOperationsClient.java deleted file mode 100644 index 5ed8dd3c7c5b..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlAssessmentV2SummaryOperationsClient.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.SqlAssessmentV2SummaryInner; - -/** - * An instance of this class provides access to all the operations defined in SqlAssessmentV2SummaryOperationsClient. - */ -public interface SqlAssessmentV2SummaryOperationsClient { - /** - * List SqlAssessmentV2Summary resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2Summary list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName); - - /** - * List SqlAssessmentV2Summary resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2Summary list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, Context context); - - /** - * Get a SqlAssessmentV2Summary. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV2Summary along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String projectName, - String groupName, String assessmentName, String summaryName, Context context); - - /** - * Get a SqlAssessmentV2Summary. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV2Summary. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SqlAssessmentV2SummaryInner get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String summaryName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlAssessmentV3OperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlAssessmentV3OperationsClient.java new file mode 100644 index 000000000000..3c99dc0671a5 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlAssessmentV3OperationsClient.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV3Inner; + +/** + * An instance of this class provides access to all the operations defined in SqlAssessmentV3OperationsClient. + */ +public interface SqlAssessmentV3OperationsClient { + /** + * List SqlAssessmentV3 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 SqlAssessmentV3 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List SqlAssessmentV3 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 SqlAssessmentV3 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + Context context); + + /** + * Get a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlAssessmentV3Inner get(String resourceGroupName, String projectName, String assessmentName); + + /** + * Create a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqlAssessmentV3Inner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, SqlAssessmentV3Inner resource); + + /** + * Create a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqlAssessmentV3Inner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, SqlAssessmentV3Inner resource, Context context); + + /** + * Create a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlAssessmentV3Inner create(String resourceGroupName, String projectName, String assessmentName, + SqlAssessmentV3Inner resource); + + /** + * Create a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlAssessmentV3Inner create(String resourceGroupName, String projectName, String assessmentName, + SqlAssessmentV3Inner resource, Context context); + + /** + * Delete a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SQL Assessment 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 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, Object 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 SQL Assessment 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 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, Object 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 SQL Assessment 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 URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object 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 SQL Assessment 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 URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object body, + Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlAssessmentV3SummaryOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlAssessmentV3SummaryOperationsClient.java new file mode 100644 index 000000000000..2893bd77985b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlAssessmentV3SummaryOperationsClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.SqlAssessmentV3SummaryInner; + +/** + * An instance of this class provides access to all the operations defined in SqlAssessmentV3SummaryOperationsClient. + */ +public interface SqlAssessmentV3SummaryOperationsClient { + /** + * List SqlAssessmentV3Summary resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3Summary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List SqlAssessmentV3Summary resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3Summary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a SqlAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV3Summary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String summaryName, Context context); + + /** + * Get a SqlAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV3Summary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlAssessmentV3SummaryInner get(String resourceGroupName, String projectName, String assessmentName, + String summaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlCollectorOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlCollectorOperationsClient.java index 22ae5a0c1df5..d425971ceb02 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlCollectorOperationsClient.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlCollectorOperationsClient.java @@ -28,7 +28,7 @@ public interface SqlCollectorOperationsClient { * @return the response of a SqlCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List SqlCollector resources by AssessmentProject. @@ -42,8 +42,7 @@ public interface SqlCollectorOperationsClient { * @return the response of a SqlCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** * Get a SqlCollector. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlGraphAssessmentOptionsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlGraphAssessmentOptionsOperationsClient.java new file mode 100644 index 000000000000..20e2dcd4bd4a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/SqlGraphAssessmentOptionsOperationsClient.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.SqlGraphAssessmentOptionsInner; + +/** + * An instance of this class provides access to all the operations defined in SqlGraphAssessmentOptionsOperationsClient. + */ +public interface SqlGraphAssessmentOptionsOperationsClient { + /** + * List SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + Context context); + + /** + * Get a SqlGraphAssessmentOptions. + * + * @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 SqlGraphAssessmentOptions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + Context context); + + /** + * Get a SqlGraphAssessmentOptions. + * + * @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 SqlGraphAssessmentOptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlGraphAssessmentOptionsInner get(String resourceGroupName, String projectName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/VmwareCollectorsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/VmwareCollectorsOperationsClient.java index b74e2ff07ddb..f67607220121 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/VmwareCollectorsOperationsClient.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/VmwareCollectorsOperationsClient.java @@ -28,7 +28,7 @@ public interface VmwareCollectorsOperationsClient { * @return the response of a VmwareCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List VmwareCollector resources by AssessmentProject. @@ -42,8 +42,7 @@ public interface VmwareCollectorsOperationsClient { * @return the response of a VmwareCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** * Get a VmwareCollector. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/WebAppAssessmentV3OperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/WebAppAssessmentV3OperationsClient.java new file mode 100644 index 000000000000..14533cb9ab17 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/WebAppAssessmentV3OperationsClient.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppAssessmentV3Inner; + +/** + * An instance of this class provides access to all the operations defined in WebAppAssessmentV3OperationsClient. + */ +public interface WebAppAssessmentV3OperationsClient { + /** + * List WebAppAssessmentV3 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 WebAppAssessmentV3 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List WebAppAssessmentV3 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 WebAppAssessmentV3 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebAppAssessmentV3Inner get(String resourceGroupName, String projectName, String assessmentName); + + /** + * Create a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 webApp assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WebAppAssessmentV3Inner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, WebAppAssessmentV3Inner resource); + + /** + * Create a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 webApp assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WebAppAssessmentV3Inner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, WebAppAssessmentV3Inner resource, Context context); + + /** + * Create a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 webApp assessment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebAppAssessmentV3Inner create(String resourceGroupName, String projectName, String assessmentName, + WebAppAssessmentV3Inner resource); + + /** + * Create a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 webApp assessment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebAppAssessmentV3Inner create(String resourceGroupName, String projectName, String assessmentName, + WebAppAssessmentV3Inner resource, Context context); + + /** + * Delete a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String assessmentName, Object body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String assessmentName, Object body, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object body, + Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/WebAppAssessmentV3SummaryOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/WebAppAssessmentV3SummaryOperationsClient.java new file mode 100644 index 000000000000..15253bb299f7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/WebAppAssessmentV3SummaryOperationsClient.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.WebAppAssessmentV3SummaryInner; + +/** + * An instance of this class provides access to all the operations defined in WebAppAssessmentV3SummaryOperationsClient. + */ +public interface WebAppAssessmentV3SummaryOperationsClient { + /** + * List WebAppAssessmentV3Summary resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3Summary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List WebAppAssessmentV3Summary resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3Summary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a WebAppAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param summaryName Gets the Name of the WebApp assessment 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 WebAppAssessmentV3Summary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String summaryName, Context context); + + /** + * Get a WebAppAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param summaryName Gets the Name of the WebApp assessment 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 WebAppAssessmentV3Summary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebAppAssessmentV3SummaryInner get(String resourceGroupName, String projectName, String assessmentName, + String summaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/WebAppCollectorOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/WebAppCollectorOperationsClient.java new file mode 100644 index 000000000000..5b3f020c15ca --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/WebAppCollectorOperationsClient.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.WebAppCollectorInner; + +/** + * An instance of this class provides access to all the operations defined in WebAppCollectorOperationsClient. + */ +public interface WebAppCollectorOperationsClient { + /** + * List WebAppCollector 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 WebAppCollector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List WebAppCollector 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 WebAppCollector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 WebAppCollector along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, String collectorName, + Context context); + + /** + * Get a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 WebAppCollector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebAppCollectorInner get(String resourceGroupName, String projectName, String collectorName); + + /** + * Create a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 the web app collector REST object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WebAppCollectorInner> beginCreate(String resourceGroupName, + String projectName, String collectorName, WebAppCollectorInner resource); + + /** + * Create a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 the web app collector REST object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WebAppCollectorInner> beginCreate(String resourceGroupName, + String projectName, String collectorName, WebAppCollectorInner resource, Context context); + + /** + * Create a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 web app collector REST object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebAppCollectorInner create(String resourceGroupName, String projectName, String collectorName, + WebAppCollectorInner resource); + + /** + * Create a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 web app collector REST object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebAppCollectorInner create(String resourceGroupName, String projectName, String collectorName, + WebAppCollectorInner resource, Context context); + + /** + * Delete a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 collectorName, + Context context); + + /** + * Delete a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 collectorName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/WebAppGraphAssessmentOptionsOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/WebAppGraphAssessmentOptionsOperationsClient.java new file mode 100644 index 000000000000..ae676da30d86 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/WebAppGraphAssessmentOptionsOperationsClient.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.WepAppGraphAssessmentOptionsInner; + +/** + * An instance of this class provides access to all the operations defined in + * WebAppGraphAssessmentOptionsOperationsClient. + */ +public interface WebAppGraphAssessmentOptionsOperationsClient { + /** + * List WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + Context context); + + /** + * Get a WepAppGraphAssessmentOptions. + * + * @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 WepAppGraphAssessmentOptions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + Context context); + + /** + * Get a WepAppGraphAssessmentOptions. + * + * @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 WepAppGraphAssessmentOptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WepAppGraphAssessmentOptionsInner get(String resourceGroupName, String projectName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/WebAppServicePlansOperationsClient.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/WebAppServicePlansOperationsClient.java new file mode 100644 index 000000000000..7f68072f4ef2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/WebAppServicePlansOperationsClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.WebAppServicePlanV3Inner; + +/** + * An instance of this class provides access to all the operations defined in WebAppServicePlansOperationsClient. + */ +public interface WebAppServicePlansOperationsClient { + /** + * List WebAppServicePlanV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppServicePlanV3 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List WebAppServicePlanV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppServicePlanV3 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a WebAppServicePlanV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param servicePlanName Gets the Name of the WebApp assessment service plan. + * @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 WebAppServicePlanV3 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String servicePlanName, Context context); + + /** + * Get a WebAppServicePlanV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param servicePlanName Gets the Name of the WebApp assessment service plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 WebAppServicePlanV3. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebAppServicePlanV3Inner get(String resourceGroupName, String projectName, String assessmentName, + String servicePlanName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AksAssessmentInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AksAssessmentInner.java new file mode 100644 index 000000000000..2028a588bee0 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AksAssessmentInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AksAssessmentProperties; +import java.io.IOException; + +/** + * ARM model of AKS Assessment. + */ +@Fluent +public final class AksAssessmentInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AksAssessmentProperties 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 AksAssessmentInner class. + */ + public AksAssessmentInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AksAssessmentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AksAssessmentInner object itself. + */ + public AksAssessmentInner withProperties(AksAssessmentProperties 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 AksAssessmentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksAssessmentInner 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 AksAssessmentInner. + */ + public static AksAssessmentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksAssessmentInner deserializedAksAssessmentInner = new AksAssessmentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAksAssessmentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAksAssessmentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAksAssessmentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAksAssessmentInner.properties = AksAssessmentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAksAssessmentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAksAssessmentInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AksAssessmentOptionsInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AksAssessmentOptionsInner.java new file mode 100644 index 000000000000..7876b8b91750 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AksAssessmentOptionsInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AksAssessmentOptionsProperties; +import java.io.IOException; + +/** + * ARM model of AKS Assessment Options. + */ +@Fluent +public final class AksAssessmentOptionsInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AksAssessmentOptionsProperties 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 AksAssessmentOptionsInner class. + */ + public AksAssessmentOptionsInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AksAssessmentOptionsProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AksAssessmentOptionsInner object itself. + */ + public AksAssessmentOptionsInner withProperties(AksAssessmentOptionsProperties 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 AksAssessmentOptionsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksAssessmentOptionsInner 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 AksAssessmentOptionsInner. + */ + public static AksAssessmentOptionsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksAssessmentOptionsInner deserializedAksAssessmentOptionsInner = new AksAssessmentOptionsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAksAssessmentOptionsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAksAssessmentOptionsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAksAssessmentOptionsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAksAssessmentOptionsInner.properties = AksAssessmentOptionsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAksAssessmentOptionsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAksAssessmentOptionsInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AksClusterInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AksClusterInner.java new file mode 100644 index 000000000000..cbfc3a497178 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AksClusterInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AksClusterProperties; +import java.io.IOException; + +/** + * ARM model of AKS Cluster. + */ +@Fluent +public final class AksClusterInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AksClusterProperties 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 AksClusterInner class. + */ + public AksClusterInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AksClusterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AksClusterInner object itself. + */ + public AksClusterInner withProperties(AksClusterProperties 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 AksClusterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksClusterInner 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 AksClusterInner. + */ + public static AksClusterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksClusterInner deserializedAksClusterInner = new AksClusterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAksClusterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAksClusterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAksClusterInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAksClusterInner.properties = AksClusterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAksClusterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAksClusterInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AksCostDetailInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AksCostDetailInner.java new file mode 100644 index 000000000000..108f69a936a2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AksCostDetailInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AksCostDetailProperties; +import java.io.IOException; + +/** + * ARM model of AKS Cost Detail. + */ +@Fluent +public final class AksCostDetailInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AksCostDetailProperties 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 AksCostDetailInner class. + */ + public AksCostDetailInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AksCostDetailProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AksCostDetailInner object itself. + */ + public AksCostDetailInner withProperties(AksCostDetailProperties 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 AksCostDetailInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksCostDetailInner 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 AksCostDetailInner. + */ + public static AksCostDetailInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksCostDetailInner deserializedAksCostDetailInner = new AksCostDetailInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAksCostDetailInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAksCostDetailInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAksCostDetailInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAksCostDetailInner.properties = AksCostDetailProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAksCostDetailInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAksCostDetailInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AksSummaryInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AksSummaryInner.java new file mode 100644 index 000000000000..2e24ef326352 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AksSummaryInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AksSummaryProperties; +import java.io.IOException; + +/** + * ARM model of AKS Summary. + */ +@Fluent +public final class AksSummaryInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AksSummaryProperties 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 AksSummaryInner class. + */ + public AksSummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AksSummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AksSummaryInner object itself. + */ + public AksSummaryInner withProperties(AksSummaryProperties 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 AksSummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksSummaryInner 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 AksSummaryInner. + */ + public static AksSummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksSummaryInner deserializedAksSummaryInner = new AksSummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAksSummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAksSummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAksSummaryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAksSummaryInner.properties = AksSummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAksSummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAksSummaryInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedMachineInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedMachineInner.java deleted file mode 100644 index 54b7bc81f0a3..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedMachineInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AssessedMachineProperties; -import java.io.IOException; - -/** - * Machine assessment Assessed Machine resource. - */ -@Fluent -public final class AssessedMachineInner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private AssessedMachineProperties 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 AssessedMachineInner class. - */ - public AssessedMachineInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public AssessedMachineProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the AssessedMachineInner object itself. - */ - public AssessedMachineInner withProperties(AssessedMachineProperties 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 AssessedMachineInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedMachineInner 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 AssessedMachineInner. - */ - public static AssessedMachineInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedMachineInner deserializedAssessedMachineInner = new AssessedMachineInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAssessedMachineInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAssessedMachineInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAssessedMachineInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAssessedMachineInner.properties = AssessedMachineProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAssessedMachineInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedMachineInner; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedMachineV2Inner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedMachineV2Inner.java new file mode 100644 index 000000000000..c943f0aeede8 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedMachineV2Inner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AssessedMachineV2Properties; +import java.io.IOException; + +/** + * Machine assessment V2 Assessed Machine resource. + */ +@Fluent +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. + */ + public AssessedMachineV2Inner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AssessedMachineV2Properties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AssessedMachineV2Inner object itself. + */ + public AssessedMachineV2Inner withProperties(AssessedMachineV2Properties 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 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlDatabaseV2Inner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlDatabaseV2Inner.java deleted file mode 100644 index c9517a74c948..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlDatabaseV2Inner.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AssessedSqlDatabaseV2Properties; -import java.io.IOException; - -/** - * Assessed SQL database web model class. - */ -@Fluent -public final class AssessedSqlDatabaseV2Inner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private AssessedSqlDatabaseV2Properties 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 AssessedSqlDatabaseV2Inner class. - */ - public AssessedSqlDatabaseV2Inner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public AssessedSqlDatabaseV2Properties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the AssessedSqlDatabaseV2Inner object itself. - */ - public AssessedSqlDatabaseV2Inner withProperties(AssessedSqlDatabaseV2Properties 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 AssessedSqlDatabaseV2Inner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedSqlDatabaseV2Inner 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 AssessedSqlDatabaseV2Inner. - */ - public static AssessedSqlDatabaseV2Inner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedSqlDatabaseV2Inner deserializedAssessedSqlDatabaseV2Inner = new AssessedSqlDatabaseV2Inner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Inner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Inner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Inner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Inner.properties - = AssessedSqlDatabaseV2Properties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Inner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedSqlDatabaseV2Inner; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlDatabaseV3Inner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlDatabaseV3Inner.java new file mode 100644 index 000000000000..46c4c598f524 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlDatabaseV3Inner.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AssessedSqlDatabaseV3Properties; +import java.io.IOException; + +/** + * Assessed SQL database web model class. + */ +@Fluent +public final class AssessedSqlDatabaseV3Inner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AssessedSqlDatabaseV3Properties 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 AssessedSqlDatabaseV3Inner class. + */ + public AssessedSqlDatabaseV3Inner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AssessedSqlDatabaseV3Properties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AssessedSqlDatabaseV3Inner object itself. + */ + public AssessedSqlDatabaseV3Inner withProperties(AssessedSqlDatabaseV3Properties 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 AssessedSqlDatabaseV3Inner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedSqlDatabaseV3Inner 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 AssessedSqlDatabaseV3Inner. + */ + public static AssessedSqlDatabaseV3Inner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedSqlDatabaseV3Inner deserializedAssessedSqlDatabaseV3Inner = new AssessedSqlDatabaseV3Inner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAssessedSqlDatabaseV3Inner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAssessedSqlDatabaseV3Inner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAssessedSqlDatabaseV3Inner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAssessedSqlDatabaseV3Inner.properties + = AssessedSqlDatabaseV3Properties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAssessedSqlDatabaseV3Inner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedSqlDatabaseV3Inner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlInstanceV2Inner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlInstanceV2Inner.java deleted file mode 100644 index b73f608e07c7..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlInstanceV2Inner.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AssessedSqlInstanceV2Properties; -import java.io.IOException; - -/** - * Assessed SQL instance web model class. - */ -@Fluent -public final class AssessedSqlInstanceV2Inner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private AssessedSqlInstanceV2Properties 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 AssessedSqlInstanceV2Inner class. - */ - public AssessedSqlInstanceV2Inner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public AssessedSqlInstanceV2Properties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the AssessedSqlInstanceV2Inner object itself. - */ - public AssessedSqlInstanceV2Inner withProperties(AssessedSqlInstanceV2Properties 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 AssessedSqlInstanceV2Inner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedSqlInstanceV2Inner 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 AssessedSqlInstanceV2Inner. - */ - public static AssessedSqlInstanceV2Inner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedSqlInstanceV2Inner deserializedAssessedSqlInstanceV2Inner = new AssessedSqlInstanceV2Inner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Inner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Inner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Inner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Inner.properties - = AssessedSqlInstanceV2Properties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Inner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedSqlInstanceV2Inner; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlInstanceV3Inner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlInstanceV3Inner.java new file mode 100644 index 000000000000..eb0feb5446f5 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlInstanceV3Inner.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AssessedSqlInstanceV3Properties; +import java.io.IOException; + +/** + * Assessed SQL instance web model class. + */ +@Fluent +public final class AssessedSqlInstanceV3Inner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AssessedSqlInstanceV3Properties 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 AssessedSqlInstanceV3Inner class. + */ + public AssessedSqlInstanceV3Inner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AssessedSqlInstanceV3Properties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AssessedSqlInstanceV3Inner object itself. + */ + public AssessedSqlInstanceV3Inner withProperties(AssessedSqlInstanceV3Properties 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 AssessedSqlInstanceV3Inner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedSqlInstanceV3Inner 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 AssessedSqlInstanceV3Inner. + */ + public static AssessedSqlInstanceV3Inner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedSqlInstanceV3Inner deserializedAssessedSqlInstanceV3Inner = new AssessedSqlInstanceV3Inner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAssessedSqlInstanceV3Inner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAssessedSqlInstanceV3Inner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAssessedSqlInstanceV3Inner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAssessedSqlInstanceV3Inner.properties + = AssessedSqlInstanceV3Properties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAssessedSqlInstanceV3Inner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedSqlInstanceV3Inner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlMachineInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlMachineInner.java deleted file mode 100644 index 5488db54d19e..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlMachineInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AssessedSqlMachineProperties; -import java.io.IOException; - -/** - * SQL Assessment REST resource. - */ -@Fluent -public final class AssessedSqlMachineInner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private AssessedSqlMachineProperties 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 AssessedSqlMachineInner class. - */ - public AssessedSqlMachineInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public AssessedSqlMachineProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the AssessedSqlMachineInner object itself. - */ - public AssessedSqlMachineInner withProperties(AssessedSqlMachineProperties 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 AssessedSqlMachineInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedSqlMachineInner 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 AssessedSqlMachineInner. - */ - public static AssessedSqlMachineInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedSqlMachineInner deserializedAssessedSqlMachineInner = new AssessedSqlMachineInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAssessedSqlMachineInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAssessedSqlMachineInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAssessedSqlMachineInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAssessedSqlMachineInner.properties = AssessedSqlMachineProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAssessedSqlMachineInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedSqlMachineInner; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlMachineV3Inner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlMachineV3Inner.java new file mode 100644 index 000000000000..2ad9490318a1 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlMachineV3Inner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AssessedSqlMachineV3Properties; +import java.io.IOException; + +/** + * SQL Assessment REST resource. + */ +@Fluent +public final class AssessedSqlMachineV3Inner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AssessedSqlMachineV3Properties 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 AssessedSqlMachineV3Inner class. + */ + public AssessedSqlMachineV3Inner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AssessedSqlMachineV3Properties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AssessedSqlMachineV3Inner object itself. + */ + public AssessedSqlMachineV3Inner withProperties(AssessedSqlMachineV3Properties 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 AssessedSqlMachineV3Inner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedSqlMachineV3Inner 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 AssessedSqlMachineV3Inner. + */ + public static AssessedSqlMachineV3Inner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedSqlMachineV3Inner deserializedAssessedSqlMachineV3Inner = new AssessedSqlMachineV3Inner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAssessedSqlMachineV3Inner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAssessedSqlMachineV3Inner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAssessedSqlMachineV3Inner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAssessedSqlMachineV3Inner.properties = AssessedSqlMachineV3Properties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAssessedSqlMachineV3Inner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedSqlMachineV3Inner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlRecommendedEntityInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlRecommendedEntityInner.java deleted file mode 100644 index a71e8547dba5..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedSqlRecommendedEntityInner.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AssessedSqlRecommendedEntityProperties; -import java.io.IOException; - -/** - * SQL Assessment REST resource. - */ -@Fluent -public final class AssessedSqlRecommendedEntityInner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private AssessedSqlRecommendedEntityProperties 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 AssessedSqlRecommendedEntityInner class. - */ - public AssessedSqlRecommendedEntityInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public AssessedSqlRecommendedEntityProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the AssessedSqlRecommendedEntityInner object itself. - */ - public AssessedSqlRecommendedEntityInner withProperties(AssessedSqlRecommendedEntityProperties 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 AssessedSqlRecommendedEntityInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedSqlRecommendedEntityInner 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 AssessedSqlRecommendedEntityInner. - */ - public static AssessedSqlRecommendedEntityInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedSqlRecommendedEntityInner deserializedAssessedSqlRecommendedEntityInner - = new AssessedSqlRecommendedEntityInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityInner.properties - = AssessedSqlRecommendedEntityProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedSqlRecommendedEntityInner; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedWebAppV3Inner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedWebAppV3Inner.java new file mode 100644 index 000000000000..1b59ec2fb71a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedWebAppV3Inner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AssessedWebAppV3Properties; +import java.io.IOException; + +/** + * Assessed web app resource. + */ +@Fluent +public final class AssessedWebAppV3Inner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AssessedWebAppV3Properties 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 AssessedWebAppV3Inner class. + */ + public AssessedWebAppV3Inner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AssessedWebAppV3Properties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AssessedWebAppV3Inner object itself. + */ + public AssessedWebAppV3Inner withProperties(AssessedWebAppV3Properties 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 AssessedWebAppV3Inner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedWebAppV3Inner 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 AssessedWebAppV3Inner. + */ + public static AssessedWebAppV3Inner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedWebAppV3Inner deserializedAssessedWebAppV3Inner = new AssessedWebAppV3Inner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAssessedWebAppV3Inner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAssessedWebAppV3Inner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAssessedWebAppV3Inner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAssessedWebAppV3Inner.properties = AssessedWebAppV3Properties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAssessedWebAppV3Inner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedWebAppV3Inner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedWebApplicationInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedWebApplicationInner.java new file mode 100644 index 000000000000..27a8e32d5531 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessedWebApplicationInner.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AssessedWebApplicationProperties; +import java.io.IOException; + +/** + * ARM model of Assessed Web Application. + */ +@Fluent +public final class AssessedWebApplicationInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AssessedWebApplicationProperties 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 AssessedWebApplicationInner class. + */ + public AssessedWebApplicationInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AssessedWebApplicationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AssessedWebApplicationInner object itself. + */ + public AssessedWebApplicationInner withProperties(AssessedWebApplicationProperties 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 AssessedWebApplicationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedWebApplicationInner 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 AssessedWebApplicationInner. + */ + public static AssessedWebApplicationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedWebApplicationInner deserializedAssessedWebApplicationInner = new AssessedWebApplicationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAssessedWebApplicationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAssessedWebApplicationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAssessedWebApplicationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAssessedWebApplicationInner.properties + = AssessedWebApplicationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAssessedWebApplicationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedWebApplicationInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessmentInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessmentInner.java deleted file mode 100644 index 18d43f0acdc5..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessmentInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.MachineAssessmentProperties; -import java.io.IOException; - -/** - * Machine assessment resource. - */ -@Fluent -public final class AssessmentInner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private MachineAssessmentProperties 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 AssessmentInner class. - */ - public AssessmentInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public MachineAssessmentProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the AssessmentInner object itself. - */ - public AssessmentInner withProperties(MachineAssessmentProperties 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 AssessmentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessmentInner 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 AssessmentInner. - */ - public static AssessmentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessmentInner deserializedAssessmentInner = new AssessmentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAssessmentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAssessmentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAssessmentInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAssessmentInner.properties = MachineAssessmentProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAssessmentInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessmentInner; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessmentOptionsInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessmentOptionsInner.java deleted file mode 100644 index 2f9cd6facb61..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AssessmentOptionsInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AssessmentOptionsProperties; -import java.io.IOException; - -/** - * Assessment options resource. - */ -@Fluent -public final class AssessmentOptionsInner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private AssessmentOptionsProperties 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 AssessmentOptionsInner class. - */ - public AssessmentOptionsInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public AssessmentOptionsProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the AssessmentOptionsInner object itself. - */ - public AssessmentOptionsInner withProperties(AssessmentOptionsProperties 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 AssessmentOptionsInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessmentOptionsInner 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 AssessmentOptionsInner. - */ - public static AssessmentOptionsInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessmentOptionsInner deserializedAssessmentOptionsInner = new AssessmentOptionsInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAssessmentOptionsInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAssessmentOptionsInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAssessmentOptionsInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAssessmentOptionsInner.properties = AssessmentOptionsProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAssessmentOptionsInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessmentOptionsInner; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessedMachineInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessedMachineInner.java deleted file mode 100644 index 355b90d6e5d7..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessedMachineInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AvsAssessedMachineProperties; -import java.io.IOException; - -/** - * AVS assessment Assessed Machine resource. - */ -@Fluent -public final class AvsAssessedMachineInner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private AvsAssessedMachineProperties 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 AvsAssessedMachineInner class. - */ - public AvsAssessedMachineInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public AvsAssessedMachineProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the AvsAssessedMachineInner object itself. - */ - public AvsAssessedMachineInner withProperties(AvsAssessedMachineProperties 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 AvsAssessedMachineInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AvsAssessedMachineInner 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 AvsAssessedMachineInner. - */ - public static AvsAssessedMachineInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AvsAssessedMachineInner deserializedAvsAssessedMachineInner = new AvsAssessedMachineInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAvsAssessedMachineInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAvsAssessedMachineInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAvsAssessedMachineInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAvsAssessedMachineInner.properties = AvsAssessedMachineProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAvsAssessedMachineInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAvsAssessedMachineInner; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessedMachineV2Inner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessedMachineV2Inner.java new file mode 100644 index 000000000000..469df0e69481 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessedMachineV2Inner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AvsAssessedMachinePropertiesV2; +import java.io.IOException; + +/** + * AVS assessment V2 Assessed Machine resource. + */ +@Fluent +public final class AvsAssessedMachineV2Inner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AvsAssessedMachinePropertiesV2 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 AvsAssessedMachineV2Inner class. + */ + public AvsAssessedMachineV2Inner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AvsAssessedMachinePropertiesV2 properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AvsAssessedMachineV2Inner object itself. + */ + public AvsAssessedMachineV2Inner withProperties(AvsAssessedMachinePropertiesV2 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 AvsAssessedMachineV2Inner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessedMachineV2Inner 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 AvsAssessedMachineV2Inner. + */ + public static AvsAssessedMachineV2Inner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessedMachineV2Inner deserializedAvsAssessedMachineV2Inner = new AvsAssessedMachineV2Inner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAvsAssessedMachineV2Inner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAvsAssessedMachineV2Inner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAvsAssessedMachineV2Inner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAvsAssessedMachineV2Inner.properties = AvsAssessedMachinePropertiesV2.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAvsAssessedMachineV2Inner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessedMachineV2Inner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessmentInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessmentInner.java deleted file mode 100644 index 8424d9087c12..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessmentInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AvsAssessmentProperties; -import java.io.IOException; - -/** - * AVS assessment resource. - */ -@Fluent -public final class AvsAssessmentInner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private AvsAssessmentProperties 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 AvsAssessmentInner class. - */ - public AvsAssessmentInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public AvsAssessmentProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the AvsAssessmentInner object itself. - */ - public AvsAssessmentInner withProperties(AvsAssessmentProperties 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 AvsAssessmentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AvsAssessmentInner 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 AvsAssessmentInner. - */ - public static AvsAssessmentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AvsAssessmentInner deserializedAvsAssessmentInner = new AvsAssessmentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAvsAssessmentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAvsAssessmentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAvsAssessmentInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAvsAssessmentInner.properties = AvsAssessmentProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAvsAssessmentInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAvsAssessmentInner; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessmentOptionsInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessmentOptionsInner.java deleted file mode 100644 index 2f0b94bb8bbf..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessmentOptionsInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AvsAssessmentOptionsProperties; -import java.io.IOException; - -/** - * AVS Assessment options resource. - */ -@Fluent -public final class AvsAssessmentOptionsInner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private AvsAssessmentOptionsProperties 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 AvsAssessmentOptionsInner class. - */ - public AvsAssessmentOptionsInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public AvsAssessmentOptionsProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the AvsAssessmentOptionsInner object itself. - */ - public AvsAssessmentOptionsInner withProperties(AvsAssessmentOptionsProperties 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 AvsAssessmentOptionsInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AvsAssessmentOptionsInner 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 AvsAssessmentOptionsInner. - */ - public static AvsAssessmentOptionsInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AvsAssessmentOptionsInner deserializedAvsAssessmentOptionsInner = new AvsAssessmentOptionsInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAvsAssessmentOptionsInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAvsAssessmentOptionsInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAvsAssessmentOptionsInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAvsAssessmentOptionsInner.properties = AvsAssessmentOptionsProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAvsAssessmentOptionsInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAvsAssessmentOptionsInner; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessmentV2Inner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessmentV2Inner.java new file mode 100644 index 000000000000..8c8ac0706368 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessmentV2Inner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AvsAssessmentPropertiesV2; +import java.io.IOException; + +/** + * AVS assessment V2 resource. + */ +@Fluent +public final class AvsAssessmentV2Inner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AvsAssessmentPropertiesV2 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 AvsAssessmentV2Inner class. + */ + public AvsAssessmentV2Inner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AvsAssessmentPropertiesV2 properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AvsAssessmentV2Inner object itself. + */ + public AvsAssessmentV2Inner withProperties(AvsAssessmentPropertiesV2 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 AvsAssessmentV2Inner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessmentV2Inner 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 AvsAssessmentV2Inner. + */ + public static AvsAssessmentV2Inner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessmentV2Inner deserializedAvsAssessmentV2Inner = new AvsAssessmentV2Inner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAvsAssessmentV2Inner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAvsAssessmentV2Inner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAvsAssessmentV2Inner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAvsAssessmentV2Inner.properties = AvsAssessmentPropertiesV2.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAvsAssessmentV2Inner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessmentV2Inner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessmentV2SummaryInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessmentV2SummaryInner.java new file mode 100644 index 000000000000..19295ad9d781 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsAssessmentV2SummaryInner.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AvsAssessmentSummaryPropertiesV2; +import java.io.IOException; + +/** + * AVS Assessment Summary REST resource. + */ +@Fluent +public final class AvsAssessmentV2SummaryInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AvsAssessmentSummaryPropertiesV2 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 AvsAssessmentV2SummaryInner class. + */ + public AvsAssessmentV2SummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AvsAssessmentSummaryPropertiesV2 properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AvsAssessmentV2SummaryInner object itself. + */ + public AvsAssessmentV2SummaryInner withProperties(AvsAssessmentSummaryPropertiesV2 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 AvsAssessmentV2SummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessmentV2SummaryInner 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 AvsAssessmentV2SummaryInner. + */ + public static AvsAssessmentV2SummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessmentV2SummaryInner deserializedAvsAssessmentV2SummaryInner = new AvsAssessmentV2SummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAvsAssessmentV2SummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAvsAssessmentV2SummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAvsAssessmentV2SummaryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAvsAssessmentV2SummaryInner.properties + = AvsAssessmentSummaryPropertiesV2.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAvsAssessmentV2SummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessmentV2SummaryInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsGraphAssessmentOptionsInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsGraphAssessmentOptionsInner.java new file mode 100644 index 000000000000..6e9912464f25 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsGraphAssessmentOptionsInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AvsGraphAssessmentOptionsProperties; +import java.io.IOException; + +/** + * AVS Assessment Summary REST resource. + */ +@Fluent +public final class AvsGraphAssessmentOptionsInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AvsGraphAssessmentOptionsProperties 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 AvsGraphAssessmentOptionsInner class. + */ + public AvsGraphAssessmentOptionsInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AvsGraphAssessmentOptionsProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AvsGraphAssessmentOptionsInner object itself. + */ + public AvsGraphAssessmentOptionsInner withProperties(AvsGraphAssessmentOptionsProperties 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 AvsGraphAssessmentOptionsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsGraphAssessmentOptionsInner 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 AvsGraphAssessmentOptionsInner. + */ + public static AvsGraphAssessmentOptionsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsGraphAssessmentOptionsInner deserializedAvsGraphAssessmentOptionsInner + = new AvsGraphAssessmentOptionsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAvsGraphAssessmentOptionsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAvsGraphAssessmentOptionsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAvsGraphAssessmentOptionsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAvsGraphAssessmentOptionsInner.properties + = AvsGraphAssessmentOptionsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAvsGraphAssessmentOptionsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsGraphAssessmentOptionsInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsSummaryInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsSummaryInner.java new file mode 100644 index 000000000000..acb4765b31d0 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/AvsSummaryInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.AvsSummaryProperties; +import java.io.IOException; + +/** + * Avs summary REST resource. + */ +@Fluent +public final class AvsSummaryInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AvsSummaryProperties 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 AvsSummaryInner class. + */ + public AvsSummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AvsSummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AvsSummaryInner object itself. + */ + public AvsSummaryInner withProperties(AvsSummaryProperties 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 AvsSummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsSummaryInner 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 AvsSummaryInner. + */ + public static AvsSummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsSummaryInner deserializedAvsSummaryInner = new AvsSummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAvsSummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAvsSummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAvsSummaryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAvsSummaryInner.properties = AvsSummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAvsSummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsSummaryInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/BusinessCaseInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/BusinessCaseInner.java new file mode 100644 index 000000000000..8050a70b2a56 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/BusinessCaseInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.BusinessCaseProperties; +import java.io.IOException; + +/** + * Business case resource. + */ +@Fluent +public final class BusinessCaseInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private BusinessCaseProperties 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 BusinessCaseInner class. + */ + public BusinessCaseInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public BusinessCaseProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the BusinessCaseInner object itself. + */ + public BusinessCaseInner withProperties(BusinessCaseProperties 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 BusinessCaseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BusinessCaseInner 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 BusinessCaseInner. + */ + public static BusinessCaseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BusinessCaseInner deserializedBusinessCaseInner = new BusinessCaseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBusinessCaseInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBusinessCaseInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBusinessCaseInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedBusinessCaseInner.properties = BusinessCaseProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedBusinessCaseInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBusinessCaseInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/CompareSummaryInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/CompareSummaryInner.java new file mode 100644 index 000000000000..ed769b2659a9 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/CompareSummaryInner.java @@ -0,0 +1,485 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.CarbonEmissionsDetails; +import com.azure.resourcemanager.migration.assessment.models.CostDetails; +import java.io.IOException; + +/** + * Compare summary class. + */ +@Immutable +public final class CompareSummaryInner implements JsonSerializable { + /* + * The azure PaaS cost. + */ + private CostDetails azurePaasCostDetails; + + /* + * The azure IaaS cost. + */ + private CostDetails azureIaasCostDetails; + + /* + * The AVS cost. + */ + private CostDetails azureAvsCostDetails; + + /* + * The on premises PaaS cost. + */ + private CostDetails onPremisesPaasCostDetails; + + /* + * The on premises IaaS cost. + */ + private CostDetails onPremisesIaasCostDetails; + + /* + * The on premises AVS cost. + */ + private CostDetails onPremisesAvsCostDetails; + + /* + * The on premises PaaS decommissioned cost. + */ + private CostDetails onPremisesPaasDecommissionedCostDetails; + + /* + * The on premises IaaS decommissioned cost. + */ + private CostDetails onPremisesIaasDecommissionedCostDetails; + + /* + * The on premises AVS decommissioned cost. + */ + private CostDetails onPremisesAvsDecommissionedCostDetails; + + /* + * Future state cost which includes Azure cost and Arc enabled on-premises cost based on the final migration + * percentage. + */ + private CostDetails futureCostDetails; + + /* + * The Azure arc enabled on-premises cost. + */ + private CostDetails azureArcEnabledOnPremisesCostDetails; + + /* + * The final azure arc enabled on-premises cost based on the final migration percentage. + */ + private CostDetails futureAzureArcEnabledOnPremisesCostDetails; + + /* + * The Azure PaaS Carbon Emissions details. + */ + private CarbonEmissionsDetails azurePaasCarbonEmissionsDetails; + + /* + * The Azure IaaS Carbon Emissions details. + */ + private CarbonEmissionsDetails azureIaasCarbonEmissionsDetails; + + /* + * The Azure AvS Carbon Emissions details. + */ + private CarbonEmissionsDetails azureAvsCarbonEmissionsDetails; + + /* + * The on premises PaaS Carbon Emissions details. + */ + private CarbonEmissionsDetails onPremisesPaasCarbonEmissionsDetails; + + /* + * The on premises IaaS Carbon Emissions details. + */ + private CarbonEmissionsDetails onPremisesIaasCarbonEmissionsDetails; + + /* + * The on premises Avs Carbon Emissions details. + */ + private CarbonEmissionsDetails onPremisesAvsCarbonEmissionsDetails; + + /* + * The on premises PaaS decommissioned Carbon Emissions details. + */ + private CarbonEmissionsDetails onPremisesPaasDecommissionedCarbonEmissionsDetails; + + /* + * The on premises IaaS decommissioned Carbon Emissions details. + */ + private CarbonEmissionsDetails onPremisesIaasDecommissionedCarbonEmissionsDetails; + + /* + * The on premises Avs decommissioned Carbon Emissions details. + */ + private CarbonEmissionsDetails onPremisesAvsDecommissionedCarbonEmissionsDetails; + + /** + * Creates an instance of CompareSummaryInner class. + */ + public CompareSummaryInner() { + } + + /** + * Get the azurePaasCostDetails property: The azure PaaS cost. + * + * @return the azurePaasCostDetails value. + */ + public CostDetails azurePaasCostDetails() { + return this.azurePaasCostDetails; + } + + /** + * Get the azureIaasCostDetails property: The azure IaaS cost. + * + * @return the azureIaasCostDetails value. + */ + public CostDetails azureIaasCostDetails() { + return this.azureIaasCostDetails; + } + + /** + * Get the azureAvsCostDetails property: The AVS cost. + * + * @return the azureAvsCostDetails value. + */ + public CostDetails azureAvsCostDetails() { + return this.azureAvsCostDetails; + } + + /** + * Get the onPremisesPaasCostDetails property: The on premises PaaS cost. + * + * @return the onPremisesPaasCostDetails value. + */ + public CostDetails onPremisesPaasCostDetails() { + return this.onPremisesPaasCostDetails; + } + + /** + * Get the onPremisesIaasCostDetails property: The on premises IaaS cost. + * + * @return the onPremisesIaasCostDetails value. + */ + public CostDetails onPremisesIaasCostDetails() { + return this.onPremisesIaasCostDetails; + } + + /** + * Get the onPremisesAvsCostDetails property: The on premises AVS cost. + * + * @return the onPremisesAvsCostDetails value. + */ + public CostDetails onPremisesAvsCostDetails() { + return this.onPremisesAvsCostDetails; + } + + /** + * Get the onPremisesPaasDecommissionedCostDetails property: The on premises PaaS decommissioned cost. + * + * @return the onPremisesPaasDecommissionedCostDetails value. + */ + public CostDetails onPremisesPaasDecommissionedCostDetails() { + return this.onPremisesPaasDecommissionedCostDetails; + } + + /** + * Get the onPremisesIaasDecommissionedCostDetails property: The on premises IaaS decommissioned cost. + * + * @return the onPremisesIaasDecommissionedCostDetails value. + */ + public CostDetails onPremisesIaasDecommissionedCostDetails() { + return this.onPremisesIaasDecommissionedCostDetails; + } + + /** + * Get the onPremisesAvsDecommissionedCostDetails property: The on premises AVS decommissioned cost. + * + * @return the onPremisesAvsDecommissionedCostDetails value. + */ + public CostDetails onPremisesAvsDecommissionedCostDetails() { + return this.onPremisesAvsDecommissionedCostDetails; + } + + /** + * Get the futureCostDetails property: Future state cost which includes Azure cost and Arc enabled on-premises cost + * based on the final migration percentage. + * + * @return the futureCostDetails value. + */ + public CostDetails futureCostDetails() { + return this.futureCostDetails; + } + + /** + * Get the azureArcEnabledOnPremisesCostDetails property: The Azure arc enabled on-premises cost. + * + * @return the azureArcEnabledOnPremisesCostDetails value. + */ + public CostDetails azureArcEnabledOnPremisesCostDetails() { + return this.azureArcEnabledOnPremisesCostDetails; + } + + /** + * Get the futureAzureArcEnabledOnPremisesCostDetails property: The final azure arc enabled on-premises cost based + * on the final migration percentage. + * + * @return the futureAzureArcEnabledOnPremisesCostDetails value. + */ + public CostDetails futureAzureArcEnabledOnPremisesCostDetails() { + return this.futureAzureArcEnabledOnPremisesCostDetails; + } + + /** + * Get the azurePaasCarbonEmissionsDetails property: The Azure PaaS Carbon Emissions details. + * + * @return the azurePaasCarbonEmissionsDetails value. + */ + public CarbonEmissionsDetails azurePaasCarbonEmissionsDetails() { + return this.azurePaasCarbonEmissionsDetails; + } + + /** + * Get the azureIaasCarbonEmissionsDetails property: The Azure IaaS Carbon Emissions details. + * + * @return the azureIaasCarbonEmissionsDetails value. + */ + public CarbonEmissionsDetails azureIaasCarbonEmissionsDetails() { + return this.azureIaasCarbonEmissionsDetails; + } + + /** + * Get the azureAvsCarbonEmissionsDetails property: The Azure AvS Carbon Emissions details. + * + * @return the azureAvsCarbonEmissionsDetails value. + */ + public CarbonEmissionsDetails azureAvsCarbonEmissionsDetails() { + return this.azureAvsCarbonEmissionsDetails; + } + + /** + * Get the onPremisesPaasCarbonEmissionsDetails property: The on premises PaaS Carbon Emissions details. + * + * @return the onPremisesPaasCarbonEmissionsDetails value. + */ + public CarbonEmissionsDetails onPremisesPaasCarbonEmissionsDetails() { + return this.onPremisesPaasCarbonEmissionsDetails; + } + + /** + * Get the onPremisesIaasCarbonEmissionsDetails property: The on premises IaaS Carbon Emissions details. + * + * @return the onPremisesIaasCarbonEmissionsDetails value. + */ + public CarbonEmissionsDetails onPremisesIaasCarbonEmissionsDetails() { + return this.onPremisesIaasCarbonEmissionsDetails; + } + + /** + * Get the onPremisesAvsCarbonEmissionsDetails property: The on premises Avs Carbon Emissions details. + * + * @return the onPremisesAvsCarbonEmissionsDetails value. + */ + public CarbonEmissionsDetails onPremisesAvsCarbonEmissionsDetails() { + return this.onPremisesAvsCarbonEmissionsDetails; + } + + /** + * Get the onPremisesPaasDecommissionedCarbonEmissionsDetails property: The on premises PaaS decommissioned Carbon + * Emissions details. + * + * @return the onPremisesPaasDecommissionedCarbonEmissionsDetails value. + */ + public CarbonEmissionsDetails onPremisesPaasDecommissionedCarbonEmissionsDetails() { + return this.onPremisesPaasDecommissionedCarbonEmissionsDetails; + } + + /** + * Get the onPremisesIaasDecommissionedCarbonEmissionsDetails property: The on premises IaaS decommissioned Carbon + * Emissions details. + * + * @return the onPremisesIaasDecommissionedCarbonEmissionsDetails value. + */ + public CarbonEmissionsDetails onPremisesIaasDecommissionedCarbonEmissionsDetails() { + return this.onPremisesIaasDecommissionedCarbonEmissionsDetails; + } + + /** + * Get the onPremisesAvsDecommissionedCarbonEmissionsDetails property: The on premises Avs decommissioned Carbon + * Emissions details. + * + * @return the onPremisesAvsDecommissionedCarbonEmissionsDetails value. + */ + public CarbonEmissionsDetails onPremisesAvsDecommissionedCarbonEmissionsDetails() { + return this.onPremisesAvsDecommissionedCarbonEmissionsDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azurePaasCostDetails() != null) { + azurePaasCostDetails().validate(); + } + if (azureIaasCostDetails() != null) { + azureIaasCostDetails().validate(); + } + if (azureAvsCostDetails() != null) { + azureAvsCostDetails().validate(); + } + if (onPremisesPaasCostDetails() != null) { + onPremisesPaasCostDetails().validate(); + } + if (onPremisesIaasCostDetails() != null) { + onPremisesIaasCostDetails().validate(); + } + if (onPremisesAvsCostDetails() != null) { + onPremisesAvsCostDetails().validate(); + } + if (onPremisesPaasDecommissionedCostDetails() != null) { + onPremisesPaasDecommissionedCostDetails().validate(); + } + if (onPremisesIaasDecommissionedCostDetails() != null) { + onPremisesIaasDecommissionedCostDetails().validate(); + } + if (onPremisesAvsDecommissionedCostDetails() != null) { + onPremisesAvsDecommissionedCostDetails().validate(); + } + if (futureCostDetails() != null) { + futureCostDetails().validate(); + } + if (azureArcEnabledOnPremisesCostDetails() != null) { + azureArcEnabledOnPremisesCostDetails().validate(); + } + if (futureAzureArcEnabledOnPremisesCostDetails() != null) { + futureAzureArcEnabledOnPremisesCostDetails().validate(); + } + if (azurePaasCarbonEmissionsDetails() != null) { + azurePaasCarbonEmissionsDetails().validate(); + } + if (azureIaasCarbonEmissionsDetails() != null) { + azureIaasCarbonEmissionsDetails().validate(); + } + if (azureAvsCarbonEmissionsDetails() != null) { + azureAvsCarbonEmissionsDetails().validate(); + } + if (onPremisesPaasCarbonEmissionsDetails() != null) { + onPremisesPaasCarbonEmissionsDetails().validate(); + } + if (onPremisesIaasCarbonEmissionsDetails() != null) { + onPremisesIaasCarbonEmissionsDetails().validate(); + } + if (onPremisesAvsCarbonEmissionsDetails() != null) { + onPremisesAvsCarbonEmissionsDetails().validate(); + } + if (onPremisesPaasDecommissionedCarbonEmissionsDetails() != null) { + onPremisesPaasDecommissionedCarbonEmissionsDetails().validate(); + } + if (onPremisesIaasDecommissionedCarbonEmissionsDetails() != null) { + onPremisesIaasDecommissionedCarbonEmissionsDetails().validate(); + } + if (onPremisesAvsDecommissionedCarbonEmissionsDetails() != null) { + onPremisesAvsDecommissionedCarbonEmissionsDetails().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CompareSummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CompareSummaryInner 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 CompareSummaryInner. + */ + public static CompareSummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CompareSummaryInner deserializedCompareSummaryInner = new CompareSummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azurePaasCostDetails".equals(fieldName)) { + deserializedCompareSummaryInner.azurePaasCostDetails = CostDetails.fromJson(reader); + } else if ("azureIaasCostDetails".equals(fieldName)) { + deserializedCompareSummaryInner.azureIaasCostDetails = CostDetails.fromJson(reader); + } else if ("azureAvsCostDetails".equals(fieldName)) { + deserializedCompareSummaryInner.azureAvsCostDetails = CostDetails.fromJson(reader); + } else if ("onPremisesPaasCostDetails".equals(fieldName)) { + deserializedCompareSummaryInner.onPremisesPaasCostDetails = CostDetails.fromJson(reader); + } else if ("onPremisesIaasCostDetails".equals(fieldName)) { + deserializedCompareSummaryInner.onPremisesIaasCostDetails = CostDetails.fromJson(reader); + } else if ("onPremisesAvsCostDetails".equals(fieldName)) { + deserializedCompareSummaryInner.onPremisesAvsCostDetails = CostDetails.fromJson(reader); + } else if ("onPremisesPaasDecommissionedCostDetails".equals(fieldName)) { + deserializedCompareSummaryInner.onPremisesPaasDecommissionedCostDetails + = CostDetails.fromJson(reader); + } else if ("onPremisesIaasDecommissionedCostDetails".equals(fieldName)) { + deserializedCompareSummaryInner.onPremisesIaasDecommissionedCostDetails + = CostDetails.fromJson(reader); + } else if ("onPremisesAvsDecommissionedCostDetails".equals(fieldName)) { + deserializedCompareSummaryInner.onPremisesAvsDecommissionedCostDetails + = CostDetails.fromJson(reader); + } else if ("futureCostDetails".equals(fieldName)) { + deserializedCompareSummaryInner.futureCostDetails = CostDetails.fromJson(reader); + } else if ("azureArcEnabledOnPremisesCostDetails".equals(fieldName)) { + deserializedCompareSummaryInner.azureArcEnabledOnPremisesCostDetails = CostDetails.fromJson(reader); + } else if ("futureAzureArcEnabledOnPremisesCostDetails".equals(fieldName)) { + deserializedCompareSummaryInner.futureAzureArcEnabledOnPremisesCostDetails + = CostDetails.fromJson(reader); + } else if ("azurePaasCarbonEmissionsDetails".equals(fieldName)) { + deserializedCompareSummaryInner.azurePaasCarbonEmissionsDetails + = CarbonEmissionsDetails.fromJson(reader); + } else if ("azureIaasCarbonEmissionsDetails".equals(fieldName)) { + deserializedCompareSummaryInner.azureIaasCarbonEmissionsDetails + = CarbonEmissionsDetails.fromJson(reader); + } else if ("azureAvsCarbonEmissionsDetails".equals(fieldName)) { + deserializedCompareSummaryInner.azureAvsCarbonEmissionsDetails + = CarbonEmissionsDetails.fromJson(reader); + } else if ("onPremisesPaasCarbonEmissionsDetails".equals(fieldName)) { + deserializedCompareSummaryInner.onPremisesPaasCarbonEmissionsDetails + = CarbonEmissionsDetails.fromJson(reader); + } else if ("onPremisesIaasCarbonEmissionsDetails".equals(fieldName)) { + deserializedCompareSummaryInner.onPremisesIaasCarbonEmissionsDetails + = CarbonEmissionsDetails.fromJson(reader); + } else if ("onPremisesAvsCarbonEmissionsDetails".equals(fieldName)) { + deserializedCompareSummaryInner.onPremisesAvsCarbonEmissionsDetails + = CarbonEmissionsDetails.fromJson(reader); + } else if ("onPremisesPaasDecommissionedCarbonEmissionsDetails".equals(fieldName)) { + deserializedCompareSummaryInner.onPremisesPaasDecommissionedCarbonEmissionsDetails + = CarbonEmissionsDetails.fromJson(reader); + } else if ("onPremisesIaasDecommissionedCarbonEmissionsDetails".equals(fieldName)) { + deserializedCompareSummaryInner.onPremisesIaasDecommissionedCarbonEmissionsDetails + = CarbonEmissionsDetails.fromJson(reader); + } else if ("onPremisesAvsDecommissionedCarbonEmissionsDetails".equals(fieldName)) { + deserializedCompareSummaryInner.onPremisesAvsDecommissionedCarbonEmissionsDetails + = CarbonEmissionsDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCompareSummaryInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/CompoundAssessmentInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/CompoundAssessmentInner.java new file mode 100644 index 000000000000..5271df2bf313 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/CompoundAssessmentInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.CompoundAssessmentProperties; +import java.io.IOException; + +/** + * Compound assessment resource. + */ +@Fluent +public final class CompoundAssessmentInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private CompoundAssessmentProperties 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 CompoundAssessmentInner class. + */ + public CompoundAssessmentInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public CompoundAssessmentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the CompoundAssessmentInner object itself. + */ + public CompoundAssessmentInner withProperties(CompoundAssessmentProperties 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 CompoundAssessmentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CompoundAssessmentInner 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 CompoundAssessmentInner. + */ + public static CompoundAssessmentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CompoundAssessmentInner deserializedCompoundAssessmentInner = new CompoundAssessmentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCompoundAssessmentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCompoundAssessmentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCompoundAssessmentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCompoundAssessmentInner.properties = CompoundAssessmentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCompoundAssessmentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCompoundAssessmentInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/EvaluatedAvsMachineInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/EvaluatedAvsMachineInner.java new file mode 100644 index 000000000000..e5abba9d720b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/EvaluatedAvsMachineInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.EvaluatedAvsMachineProperties; +import java.io.IOException; + +/** + * Evaluated AVS machine resource. + */ +@Fluent +public final class EvaluatedAvsMachineInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private EvaluatedAvsMachineProperties 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 EvaluatedAvsMachineInner class. + */ + public EvaluatedAvsMachineInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EvaluatedAvsMachineProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EvaluatedAvsMachineInner object itself. + */ + public EvaluatedAvsMachineInner withProperties(EvaluatedAvsMachineProperties 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 EvaluatedAvsMachineInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatedAvsMachineInner 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 EvaluatedAvsMachineInner. + */ + public static EvaluatedAvsMachineInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EvaluatedAvsMachineInner deserializedEvaluatedAvsMachineInner = new EvaluatedAvsMachineInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEvaluatedAvsMachineInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEvaluatedAvsMachineInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEvaluatedAvsMachineInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEvaluatedAvsMachineInner.properties = EvaluatedAvsMachineProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEvaluatedAvsMachineInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEvaluatedAvsMachineInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/EvaluatedMachineInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/EvaluatedMachineInner.java new file mode 100644 index 000000000000..6a574d8289bf --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/EvaluatedMachineInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.EvaluatedMachineProperties; +import java.io.IOException; + +/** + * Evaluated machine resource. + */ +@Fluent +public final class EvaluatedMachineInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private EvaluatedMachineProperties 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 EvaluatedMachineInner class. + */ + public EvaluatedMachineInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EvaluatedMachineProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EvaluatedMachineInner object itself. + */ + public EvaluatedMachineInner withProperties(EvaluatedMachineProperties 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 EvaluatedMachineInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatedMachineInner 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 EvaluatedMachineInner. + */ + public static EvaluatedMachineInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EvaluatedMachineInner deserializedEvaluatedMachineInner = new EvaluatedMachineInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEvaluatedMachineInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEvaluatedMachineInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEvaluatedMachineInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEvaluatedMachineInner.properties = EvaluatedMachineProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEvaluatedMachineInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEvaluatedMachineInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/EvaluatedSqlEntityInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/EvaluatedSqlEntityInner.java new file mode 100644 index 000000000000..2fb35cf6dc91 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/EvaluatedSqlEntityInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.EvaluatedSqlEntityProperties; +import java.io.IOException; + +/** + * Evaluated sql entity resource. + */ +@Fluent +public final class EvaluatedSqlEntityInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private EvaluatedSqlEntityProperties 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 EvaluatedSqlEntityInner class. + */ + public EvaluatedSqlEntityInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EvaluatedSqlEntityProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EvaluatedSqlEntityInner object itself. + */ + public EvaluatedSqlEntityInner withProperties(EvaluatedSqlEntityProperties 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 EvaluatedSqlEntityInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatedSqlEntityInner 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 EvaluatedSqlEntityInner. + */ + public static EvaluatedSqlEntityInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EvaluatedSqlEntityInner deserializedEvaluatedSqlEntityInner = new EvaluatedSqlEntityInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEvaluatedSqlEntityInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEvaluatedSqlEntityInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEvaluatedSqlEntityInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEvaluatedSqlEntityInner.properties = EvaluatedSqlEntityProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEvaluatedSqlEntityInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEvaluatedSqlEntityInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/EvaluatedWebAppInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/EvaluatedWebAppInner.java new file mode 100644 index 000000000000..6f6f3564afe8 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/EvaluatedWebAppInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.EvaluatedWebAppProperties; +import java.io.IOException; + +/** + * Evaluated web app resource. + */ +@Fluent +public final class EvaluatedWebAppInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private EvaluatedWebAppProperties 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 EvaluatedWebAppInner class. + */ + public EvaluatedWebAppInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EvaluatedWebAppProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EvaluatedWebAppInner object itself. + */ + public EvaluatedWebAppInner withProperties(EvaluatedWebAppProperties 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 EvaluatedWebAppInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatedWebAppInner 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 EvaluatedWebAppInner. + */ + public static EvaluatedWebAppInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EvaluatedWebAppInner deserializedEvaluatedWebAppInner = new EvaluatedWebAppInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEvaluatedWebAppInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEvaluatedWebAppInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEvaluatedWebAppInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEvaluatedWebAppInner.properties = EvaluatedWebAppProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEvaluatedWebAppInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEvaluatedWebAppInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/GroupInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/GroupInner.java deleted file mode 100644 index 1e81fb016105..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/GroupInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.GroupProperties; -import java.io.IOException; - -/** - * Group resource. - */ -@Fluent -public final class GroupInner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private GroupProperties 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 GroupInner class. - */ - public GroupInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public GroupProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the GroupInner object itself. - */ - public GroupInner withProperties(GroupProperties 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 GroupInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupInner 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 GroupInner. - */ - public static GroupInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupInner deserializedGroupInner = new GroupInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGroupInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGroupInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGroupInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGroupInner.properties = GroupProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedGroupInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupInner; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/HeterogeneousAssessmentInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/HeterogeneousAssessmentInner.java new file mode 100644 index 000000000000..fc334b531eac --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/HeterogeneousAssessmentInner.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.HeterogeneousAssessmentProperties; +import java.io.IOException; + +/** + * Heterogeneous assessment resource. + */ +@Fluent +public final class HeterogeneousAssessmentInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private HeterogeneousAssessmentProperties 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 HeterogeneousAssessmentInner class. + */ + public HeterogeneousAssessmentInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public HeterogeneousAssessmentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the HeterogeneousAssessmentInner object itself. + */ + public HeterogeneousAssessmentInner withProperties(HeterogeneousAssessmentProperties 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 HeterogeneousAssessmentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HeterogeneousAssessmentInner 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 HeterogeneousAssessmentInner. + */ + public static HeterogeneousAssessmentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HeterogeneousAssessmentInner deserializedHeterogeneousAssessmentInner = new HeterogeneousAssessmentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHeterogeneousAssessmentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHeterogeneousAssessmentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHeterogeneousAssessmentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedHeterogeneousAssessmentInner.properties + = HeterogeneousAssessmentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedHeterogeneousAssessmentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHeterogeneousAssessmentInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/HeterogeneousAssessmentSummaryInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/HeterogeneousAssessmentSummaryInner.java new file mode 100644 index 000000000000..62659177cac3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/HeterogeneousAssessmentSummaryInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.HeterogeneousAssessmentSummaryProperties; +import java.io.IOException; + +/** + * Heterogeneous assessment summary resource. + */ +@Fluent +public final class HeterogeneousAssessmentSummaryInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private HeterogeneousAssessmentSummaryProperties 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 HeterogeneousAssessmentSummaryInner class. + */ + public HeterogeneousAssessmentSummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public HeterogeneousAssessmentSummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the HeterogeneousAssessmentSummaryInner object itself. + */ + public HeterogeneousAssessmentSummaryInner withProperties(HeterogeneousAssessmentSummaryProperties 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 HeterogeneousAssessmentSummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HeterogeneousAssessmentSummaryInner 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 HeterogeneousAssessmentSummaryInner. + */ + public static HeterogeneousAssessmentSummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HeterogeneousAssessmentSummaryInner deserializedHeterogeneousAssessmentSummaryInner + = new HeterogeneousAssessmentSummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHeterogeneousAssessmentSummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHeterogeneousAssessmentSummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHeterogeneousAssessmentSummaryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedHeterogeneousAssessmentSummaryInner.properties + = HeterogeneousAssessmentSummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedHeterogeneousAssessmentSummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHeterogeneousAssessmentSummaryInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/IaasSummaryInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/IaasSummaryInner.java new file mode 100644 index 000000000000..9bdf40513491 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/IaasSummaryInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.IaasSummaryProperties; +import java.io.IOException; + +/** + * Iaas summary REST resource. + */ +@Fluent +public final class IaasSummaryInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private IaasSummaryProperties 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 IaasSummaryInner class. + */ + public IaasSummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public IaasSummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the IaasSummaryInner object itself. + */ + public IaasSummaryInner withProperties(IaasSummaryProperties 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 IaasSummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IaasSummaryInner 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 IaasSummaryInner. + */ + public static IaasSummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IaasSummaryInner deserializedIaasSummaryInner = new IaasSummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIaasSummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIaasSummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIaasSummaryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedIaasSummaryInner.properties = IaasSummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedIaasSummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIaasSummaryInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/ImportSqlCollectorInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/ImportSqlCollectorInner.java new file mode 100644 index 000000000000..beb55bb6da4d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/ImportSqlCollectorInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.ImportSqlCollectorProperties; +import java.io.IOException; + +/** + * Import SQL Collector REST resource. + */ +@Fluent +public final class ImportSqlCollectorInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private ImportSqlCollectorProperties 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 ImportSqlCollectorInner class. + */ + public ImportSqlCollectorInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ImportSqlCollectorProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ImportSqlCollectorInner object itself. + */ + public ImportSqlCollectorInner withProperties(ImportSqlCollectorProperties 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 ImportSqlCollectorInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImportSqlCollectorInner 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 ImportSqlCollectorInner. + */ + public static ImportSqlCollectorInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImportSqlCollectorInner deserializedImportSqlCollectorInner = new ImportSqlCollectorInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedImportSqlCollectorInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedImportSqlCollectorInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedImportSqlCollectorInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedImportSqlCollectorInner.properties = ImportSqlCollectorProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedImportSqlCollectorInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImportSqlCollectorInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/MachineAssessmentV2Inner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/MachineAssessmentV2Inner.java new file mode 100644 index 000000000000..cb6c2a9129b8 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/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) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/MachineAssessmentV2SummaryInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/MachineAssessmentV2SummaryInner.java new file mode 100644 index 000000000000..779635f70952 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/MachineAssessmentV2SummaryInner.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.SummaryProperties; +import java.io.IOException; + +/** + * Machine Assessment REST resource. + */ +@Fluent +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. + */ + public MachineAssessmentV2SummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the MachineAssessmentV2SummaryInner object itself. + */ + public MachineAssessmentV2SummaryInner withProperties(SummaryProperties 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 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/MachineGraphAssessmentOptionsInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/MachineGraphAssessmentOptionsInner.java new file mode 100644 index 000000000000..06493ca9b130 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/MachineGraphAssessmentOptionsInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.MachineGraphAssessmentOptionsProperties; +import java.io.IOException; + +/** + * Machine Assessment REST resource. + */ +@Fluent +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. + */ + public MachineGraphAssessmentOptionsInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public MachineGraphAssessmentOptionsProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the MachineGraphAssessmentOptionsInner object itself. + */ + public MachineGraphAssessmentOptionsInner withProperties(MachineGraphAssessmentOptionsProperties 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 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/MachineInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/MachineInner.java deleted file mode 100644 index c707dd93181b..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/MachineInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.MachineProperties; -import java.io.IOException; - -/** - * Machine resource. - */ -@Fluent -public final class MachineInner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private MachineProperties 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 MachineInner class. - */ - public MachineInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public MachineProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the MachineInner object itself. - */ - public MachineInner withProperties(MachineProperties 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 MachineInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MachineInner 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 MachineInner. - */ - public static MachineInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MachineInner deserializedMachineInner = new MachineInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedMachineInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedMachineInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedMachineInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedMachineInner.properties = MachineProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedMachineInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMachineInner; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/OverviewSummaryInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/OverviewSummaryInner.java new file mode 100644 index 000000000000..1ca8c320382b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/OverviewSummaryInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.OverviewSummaryProperties; +import java.io.IOException; + +/** + * Overview summary REST resource. + */ +@Fluent +public final class OverviewSummaryInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private OverviewSummaryProperties 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 OverviewSummaryInner class. + */ + public OverviewSummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public OverviewSummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the OverviewSummaryInner object itself. + */ + public OverviewSummaryInner withProperties(OverviewSummaryProperties 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 OverviewSummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OverviewSummaryInner 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 OverviewSummaryInner. + */ + public static OverviewSummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OverviewSummaryInner deserializedOverviewSummaryInner = new OverviewSummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOverviewSummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOverviewSummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOverviewSummaryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedOverviewSummaryInner.properties = OverviewSummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOverviewSummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOverviewSummaryInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/PaasSummaryInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/PaasSummaryInner.java new file mode 100644 index 000000000000..b34748846338 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/PaasSummaryInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.PaasSummaryProperties; +import java.io.IOException; + +/** + * Paas summary REST resource. + */ +@Fluent +public final class PaasSummaryInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private PaasSummaryProperties 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 PaasSummaryInner class. + */ + public PaasSummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public PaasSummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the PaasSummaryInner object itself. + */ + public PaasSummaryInner withProperties(PaasSummaryProperties 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 PaasSummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PaasSummaryInner 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 PaasSummaryInner. + */ + public static PaasSummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PaasSummaryInner deserializedPaasSummaryInner = new PaasSummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPaasSummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPaasSummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPaasSummaryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPaasSummaryInner.properties = PaasSummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPaasSummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPaasSummaryInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/ReportDownloadUrlInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/ReportDownloadUrlInner.java new file mode 100644 index 000000000000..fd5c62c6a89c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/ReportDownloadUrlInner.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Download URL for assessment report. + */ +@Immutable +public final class ReportDownloadUrlInner implements JsonSerializable { + /* + * Hyperlink to download report. + */ + private String businessCaseReportUrl; + + /* + * Expiry date of download url. + */ + private OffsetDateTime expirationTime; + + /** + * Creates an instance of ReportDownloadUrlInner class. + */ + public ReportDownloadUrlInner() { + } + + /** + * Get the businessCaseReportUrl property: Hyperlink to download report. + * + * @return the businessCaseReportUrl value. + */ + public String businessCaseReportUrl() { + return this.businessCaseReportUrl; + } + + /** + * 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 ReportDownloadUrlInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReportDownloadUrlInner 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 ReportDownloadUrlInner. + */ + public static ReportDownloadUrlInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReportDownloadUrlInner deserializedReportDownloadUrlInner = new ReportDownloadUrlInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("businessCaseReportUrl".equals(fieldName)) { + deserializedReportDownloadUrlInner.businessCaseReportUrl = reader.getString(); + } else if ("expirationTime".equals(fieldName)) { + deserializedReportDownloadUrlInner.expirationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedReportDownloadUrlInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlAssessmentOptionsInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlAssessmentOptionsInner.java deleted file mode 100644 index b6d3ff5fcec0..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlAssessmentOptionsInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.SqlAssessmentOptionsProperties; -import java.io.IOException; - -/** - * SQL Assessment options web model object. - */ -@Fluent -public final class SqlAssessmentOptionsInner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private SqlAssessmentOptionsProperties 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 SqlAssessmentOptionsInner class. - */ - public SqlAssessmentOptionsInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public SqlAssessmentOptionsProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the SqlAssessmentOptionsInner object itself. - */ - public SqlAssessmentOptionsInner withProperties(SqlAssessmentOptionsProperties 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 SqlAssessmentOptionsInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlAssessmentOptionsInner 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 SqlAssessmentOptionsInner. - */ - public static SqlAssessmentOptionsInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlAssessmentOptionsInner deserializedSqlAssessmentOptionsInner = new SqlAssessmentOptionsInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSqlAssessmentOptionsInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSqlAssessmentOptionsInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSqlAssessmentOptionsInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSqlAssessmentOptionsInner.properties = SqlAssessmentOptionsProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSqlAssessmentOptionsInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlAssessmentOptionsInner; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlAssessmentV2Inner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlAssessmentV2Inner.java deleted file mode 100644 index 697451af3298..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlAssessmentV2Inner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.SqlAssessmentV2Properties; -import java.io.IOException; - -/** - * SQL Assessment REST resource. - */ -@Fluent -public final class SqlAssessmentV2Inner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private SqlAssessmentV2Properties 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 SqlAssessmentV2Inner class. - */ - public SqlAssessmentV2Inner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public SqlAssessmentV2Properties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the SqlAssessmentV2Inner object itself. - */ - public SqlAssessmentV2Inner withProperties(SqlAssessmentV2Properties 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 SqlAssessmentV2Inner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlAssessmentV2Inner 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 SqlAssessmentV2Inner. - */ - public static SqlAssessmentV2Inner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlAssessmentV2Inner deserializedSqlAssessmentV2Inner = new SqlAssessmentV2Inner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSqlAssessmentV2Inner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSqlAssessmentV2Inner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSqlAssessmentV2Inner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSqlAssessmentV2Inner.properties = SqlAssessmentV2Properties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSqlAssessmentV2Inner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlAssessmentV2Inner; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlAssessmentV2SummaryInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlAssessmentV2SummaryInner.java deleted file mode 100644 index 7acc05c96500..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlAssessmentV2SummaryInner.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.SqlAssessmentV2SummaryProperties; -import java.io.IOException; - -/** - * SQL Assessment REST resource. - */ -@Fluent -public final class SqlAssessmentV2SummaryInner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private SqlAssessmentV2SummaryProperties 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 SqlAssessmentV2SummaryInner class. - */ - public SqlAssessmentV2SummaryInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public SqlAssessmentV2SummaryProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the SqlAssessmentV2SummaryInner object itself. - */ - public SqlAssessmentV2SummaryInner withProperties(SqlAssessmentV2SummaryProperties 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 SqlAssessmentV2SummaryInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlAssessmentV2SummaryInner 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 SqlAssessmentV2SummaryInner. - */ - public static SqlAssessmentV2SummaryInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlAssessmentV2SummaryInner deserializedSqlAssessmentV2SummaryInner = new SqlAssessmentV2SummaryInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryInner.properties - = SqlAssessmentV2SummaryProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlAssessmentV2SummaryInner; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlAssessmentV3Inner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlAssessmentV3Inner.java new file mode 100644 index 000000000000..60a602e916cd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlAssessmentV3Inner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.SqlAssessmentV3Properties; +import java.io.IOException; + +/** + * SQL Assessment REST resource. + */ +@Fluent +public final class SqlAssessmentV3Inner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private SqlAssessmentV3Properties 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 SqlAssessmentV3Inner class. + */ + public SqlAssessmentV3Inner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SqlAssessmentV3Properties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SqlAssessmentV3Inner object itself. + */ + public SqlAssessmentV3Inner withProperties(SqlAssessmentV3Properties 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 SqlAssessmentV3Inner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlAssessmentV3Inner 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 SqlAssessmentV3Inner. + */ + public static SqlAssessmentV3Inner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlAssessmentV3Inner deserializedSqlAssessmentV3Inner = new SqlAssessmentV3Inner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSqlAssessmentV3Inner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSqlAssessmentV3Inner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSqlAssessmentV3Inner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSqlAssessmentV3Inner.properties = SqlAssessmentV3Properties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSqlAssessmentV3Inner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlAssessmentV3Inner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlAssessmentV3SummaryInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlAssessmentV3SummaryInner.java new file mode 100644 index 000000000000..1fcbe65823a8 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlAssessmentV3SummaryInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.SummaryProperties; +import java.io.IOException; + +/** + * SQL Assessment REST resource. + */ +@Fluent +public final class SqlAssessmentV3SummaryInner 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 SqlAssessmentV3SummaryInner class. + */ + public SqlAssessmentV3SummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SqlAssessmentV3SummaryInner object itself. + */ + public SqlAssessmentV3SummaryInner withProperties(SummaryProperties 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 SqlAssessmentV3SummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlAssessmentV3SummaryInner 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 SqlAssessmentV3SummaryInner. + */ + public static SqlAssessmentV3SummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlAssessmentV3SummaryInner deserializedSqlAssessmentV3SummaryInner = new SqlAssessmentV3SummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSqlAssessmentV3SummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSqlAssessmentV3SummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSqlAssessmentV3SummaryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSqlAssessmentV3SummaryInner.properties = SummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSqlAssessmentV3SummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlAssessmentV3SummaryInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlGraphAssessmentOptionsInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlGraphAssessmentOptionsInner.java new file mode 100644 index 000000000000..d8fa9e460499 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/SqlGraphAssessmentOptionsInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.SqlGraphAssessmentOptionsProperties; +import java.io.IOException; + +/** + * SQL Assessment REST resource. + */ +@Fluent +public final class SqlGraphAssessmentOptionsInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private SqlGraphAssessmentOptionsProperties 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 SqlGraphAssessmentOptionsInner class. + */ + public SqlGraphAssessmentOptionsInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SqlGraphAssessmentOptionsProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SqlGraphAssessmentOptionsInner object itself. + */ + public SqlGraphAssessmentOptionsInner withProperties(SqlGraphAssessmentOptionsProperties 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 SqlGraphAssessmentOptionsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlGraphAssessmentOptionsInner 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 SqlGraphAssessmentOptionsInner. + */ + public static SqlGraphAssessmentOptionsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlGraphAssessmentOptionsInner deserializedSqlGraphAssessmentOptionsInner + = new SqlGraphAssessmentOptionsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSqlGraphAssessmentOptionsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSqlGraphAssessmentOptionsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSqlGraphAssessmentOptionsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSqlGraphAssessmentOptionsInner.properties + = SqlGraphAssessmentOptionsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSqlGraphAssessmentOptionsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlGraphAssessmentOptionsInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WebAppAssessmentV3Inner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WebAppAssessmentV3Inner.java new file mode 100644 index 000000000000..8e489983be35 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WebAppAssessmentV3Inner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.WebAppAssessmentV3Properties; +import java.io.IOException; + +/** + * WebApp assessment resource. + */ +@Fluent +public final class WebAppAssessmentV3Inner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private WebAppAssessmentV3Properties 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 WebAppAssessmentV3Inner class. + */ + public WebAppAssessmentV3Inner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public WebAppAssessmentV3Properties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the WebAppAssessmentV3Inner object itself. + */ + public WebAppAssessmentV3Inner withProperties(WebAppAssessmentV3Properties 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 WebAppAssessmentV3Inner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppAssessmentV3Inner 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 WebAppAssessmentV3Inner. + */ + public static WebAppAssessmentV3Inner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppAssessmentV3Inner deserializedWebAppAssessmentV3Inner = new WebAppAssessmentV3Inner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWebAppAssessmentV3Inner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWebAppAssessmentV3Inner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWebAppAssessmentV3Inner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWebAppAssessmentV3Inner.properties = WebAppAssessmentV3Properties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedWebAppAssessmentV3Inner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppAssessmentV3Inner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WebAppAssessmentV3SummaryInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WebAppAssessmentV3SummaryInner.java new file mode 100644 index 000000000000..ed3f51f5f139 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WebAppAssessmentV3SummaryInner.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.WebAppSummaryProperties; +import java.io.IOException; + +/** + * WebApp assessment summary resource. + */ +@Fluent +public final class WebAppAssessmentV3SummaryInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private WebAppSummaryProperties 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 WebAppAssessmentV3SummaryInner class. + */ + public WebAppAssessmentV3SummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public WebAppSummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the WebAppAssessmentV3SummaryInner object itself. + */ + public WebAppAssessmentV3SummaryInner withProperties(WebAppSummaryProperties 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 WebAppAssessmentV3SummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppAssessmentV3SummaryInner 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 WebAppAssessmentV3SummaryInner. + */ + public static WebAppAssessmentV3SummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppAssessmentV3SummaryInner deserializedWebAppAssessmentV3SummaryInner + = new WebAppAssessmentV3SummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWebAppAssessmentV3SummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWebAppAssessmentV3SummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWebAppAssessmentV3SummaryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWebAppAssessmentV3SummaryInner.properties = WebAppSummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedWebAppAssessmentV3SummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppAssessmentV3SummaryInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WebAppCollectorInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WebAppCollectorInner.java new file mode 100644 index 000000000000..1285e3aa9142 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WebAppCollectorInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.CollectorPropertiesBaseWithAgent; +import java.io.IOException; + +/** + * The web app collector REST object. + */ +@Fluent +public final class WebAppCollectorInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private CollectorPropertiesBaseWithAgent 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 WebAppCollectorInner class. + */ + public WebAppCollectorInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public CollectorPropertiesBaseWithAgent properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the WebAppCollectorInner object itself. + */ + public WebAppCollectorInner withProperties(CollectorPropertiesBaseWithAgent 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 WebAppCollectorInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppCollectorInner 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 WebAppCollectorInner. + */ + public static WebAppCollectorInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppCollectorInner deserializedWebAppCollectorInner = new WebAppCollectorInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWebAppCollectorInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWebAppCollectorInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWebAppCollectorInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWebAppCollectorInner.properties = CollectorPropertiesBaseWithAgent.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedWebAppCollectorInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppCollectorInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WebAppCompoundAssessmentSummaryInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WebAppCompoundAssessmentSummaryInner.java new file mode 100644 index 000000000000..ba8ff66b9cc2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WebAppCompoundAssessmentSummaryInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.WebAppCompoundAssessmentSummaryProperties; +import java.io.IOException; + +/** + * WebApp compound assessment summary resource. + */ +@Fluent +public final class WebAppCompoundAssessmentSummaryInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private WebAppCompoundAssessmentSummaryProperties 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 WebAppCompoundAssessmentSummaryInner class. + */ + public WebAppCompoundAssessmentSummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public WebAppCompoundAssessmentSummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the WebAppCompoundAssessmentSummaryInner object itself. + */ + public WebAppCompoundAssessmentSummaryInner withProperties(WebAppCompoundAssessmentSummaryProperties 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 WebAppCompoundAssessmentSummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppCompoundAssessmentSummaryInner 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 WebAppCompoundAssessmentSummaryInner. + */ + public static WebAppCompoundAssessmentSummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppCompoundAssessmentSummaryInner deserializedWebAppCompoundAssessmentSummaryInner + = new WebAppCompoundAssessmentSummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWebAppCompoundAssessmentSummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWebAppCompoundAssessmentSummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWebAppCompoundAssessmentSummaryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWebAppCompoundAssessmentSummaryInner.properties + = WebAppCompoundAssessmentSummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedWebAppCompoundAssessmentSummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppCompoundAssessmentSummaryInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WebAppServicePlanV3Inner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WebAppServicePlanV3Inner.java new file mode 100644 index 000000000000..33e75b2dd869 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WebAppServicePlanV3Inner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.WebAppServicePlanV3Properties; +import java.io.IOException; + +/** + * WebApp assessment service plan resource. + */ +@Fluent +public final class WebAppServicePlanV3Inner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private WebAppServicePlanV3Properties 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 WebAppServicePlanV3Inner class. + */ + public WebAppServicePlanV3Inner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public WebAppServicePlanV3Properties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the WebAppServicePlanV3Inner object itself. + */ + public WebAppServicePlanV3Inner withProperties(WebAppServicePlanV3Properties 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 WebAppServicePlanV3Inner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppServicePlanV3Inner 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 WebAppServicePlanV3Inner. + */ + public static WebAppServicePlanV3Inner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppServicePlanV3Inner deserializedWebAppServicePlanV3Inner = new WebAppServicePlanV3Inner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWebAppServicePlanV3Inner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWebAppServicePlanV3Inner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWebAppServicePlanV3Inner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWebAppServicePlanV3Inner.properties = WebAppServicePlanV3Properties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedWebAppServicePlanV3Inner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppServicePlanV3Inner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WepAppGraphAssessmentOptionsInner.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WepAppGraphAssessmentOptionsInner.java new file mode 100644 index 000000000000..fb04bd7da432 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/fluent/models/WepAppGraphAssessmentOptionsInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.models.WepAppGraphAssessmentOptionsProperties; +import java.io.IOException; + +/** + * WebApp assessment resource. + */ +@Fluent +public final class WepAppGraphAssessmentOptionsInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private WepAppGraphAssessmentOptionsProperties 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 WepAppGraphAssessmentOptionsInner class. + */ + public WepAppGraphAssessmentOptionsInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public WepAppGraphAssessmentOptionsProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the WepAppGraphAssessmentOptionsInner object itself. + */ + public WepAppGraphAssessmentOptionsInner withProperties(WepAppGraphAssessmentOptionsProperties 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 WepAppGraphAssessmentOptionsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WepAppGraphAssessmentOptionsInner 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 WepAppGraphAssessmentOptionsInner. + */ + public static WepAppGraphAssessmentOptionsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WepAppGraphAssessmentOptionsInner deserializedWepAppGraphAssessmentOptionsInner + = new WepAppGraphAssessmentOptionsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWepAppGraphAssessmentOptionsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWepAppGraphAssessmentOptionsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWepAppGraphAssessmentOptionsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWepAppGraphAssessmentOptionsInner.properties + = WepAppGraphAssessmentOptionsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedWepAppGraphAssessmentOptionsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWepAppGraphAssessmentOptionsInner; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksAssessmentImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksAssessmentImpl.java new file mode 100644 index 000000000000..3535612d9845 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksAssessmentImpl.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksAssessmentInner; +import com.azure.resourcemanager.migration.assessment.models.AksAssessment; +import com.azure.resourcemanager.migration.assessment.models.AksAssessmentProperties; +import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; + +public final class AksAssessmentImpl implements AksAssessment, AksAssessment.Definition { + private AksAssessmentInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AksAssessmentImpl(AksAssessmentInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AksAssessmentProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AksAssessmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String projectName; + + private String assessmentName; + + public AksAssessmentImpl withExistingAssessmentProject(String resourceGroupName, String projectName) { + this.resourceGroupName = resourceGroupName; + this.projectName = projectName; + return this; + } + + public AksAssessment create() { + this.innerObject = serviceManager.serviceClient() + .getAksAssessmentOperations() + .create(resourceGroupName, projectName, assessmentName, this.innerModel(), Context.NONE); + return this; + } + + public AksAssessment create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAksAssessmentOperations() + .create(resourceGroupName, projectName, assessmentName, this.innerModel(), context); + return this; + } + + AksAssessmentImpl(String name, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerObject = new AksAssessmentInner(); + this.serviceManager = serviceManager; + this.assessmentName = name; + } + + public AksAssessment refresh() { + this.innerObject = serviceManager.serviceClient() + .getAksAssessmentOperations() + .getWithResponse(resourceGroupName, projectName, assessmentName, Context.NONE) + .getValue(); + return this; + } + + public AksAssessment refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAksAssessmentOperations() + .getWithResponse(resourceGroupName, projectName, assessmentName, context) + .getValue(); + return this; + } + + public DownloadUrl downloadUrl(Object body) { + return serviceManager.aksAssessmentOperations() + .downloadUrl(resourceGroupName, projectName, assessmentName, body); + } + + public DownloadUrl downloadUrl(Object body, Context context) { + return serviceManager.aksAssessmentOperations() + .downloadUrl(resourceGroupName, projectName, assessmentName, body, context); + } + + public AksAssessmentImpl withProperties(AksAssessmentProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksAssessmentOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksAssessmentOperationsClientImpl.java new file mode 100644 index 000000000000..e072e0487ccd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksAssessmentOperationsClientImpl.java @@ -0,0 +1,1076 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AksAssessmentOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksAssessmentInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.models.AksAssessmentListResult; +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 AksAssessmentOperationsClient. + */ +public final class AksAssessmentOperationsClientImpl implements AksAssessmentOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AksAssessmentOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of AksAssessmentOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AksAssessmentOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(AksAssessmentOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientAksAssessmentOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface AksAssessmentOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/aksAssessments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/aksAssessments/{assessmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/aksAssessments/{assessmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, + @BodyParam("application/json") AksAssessmentInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/aksAssessments/{assessmentName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/aksAssessments/{assessmentName}/downloadUrl") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> downloadUrl(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, @BodyParam("application/json") Object body, + @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AKSAssessment 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 AKSAssessment 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 AKSAssessment 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 AKSAssessment 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 AKSAssessment 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 AKSAssessment 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 AKSAssessment 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 AKSAssessment 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 AKSAssessment 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 AKSAssessment 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 AKSAssessment 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 AKSAssessment 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 a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSAssessment 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 AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSAssessment 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 AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSAssessment 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 AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSAssessment 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 AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSAssessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AksAssessmentInner get(String resourceGroupName, String projectName, String assessmentName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, Context.NONE).getValue(); + } + + /** + * Create a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 aRM model of AKS Assessment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, AksAssessmentInner 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 accept = "application/json"; + return FluxUtil.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 aRM model of AKS Assessment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, AksAssessmentInner 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, assessmentName, resource, accept, context); + } + + /** + * Create a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 aRM model of AKS Assessment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AksAssessmentInner> beginCreateAsync(String resourceGroupName, + String projectName, String assessmentName, AksAssessmentInner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, assessmentName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AksAssessmentInner.class, AksAssessmentInner.class, this.client.getContext()); + } + + /** + * Create a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 aRM model of AKS Assessment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AksAssessmentInner> beginCreateAsync(String resourceGroupName, + String projectName, String assessmentName, AksAssessmentInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, assessmentName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AksAssessmentInner.class, AksAssessmentInner.class, context); + } + + /** + * Create a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 aRM model of AKS Assessment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AksAssessmentInner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, AksAssessmentInner resource) { + return this.beginCreateAsync(resourceGroupName, projectName, assessmentName, resource).getSyncPoller(); + } + + /** + * Create a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 aRM model of AKS Assessment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AksAssessmentInner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, AksAssessmentInner resource, Context context) { + return this.beginCreateAsync(resourceGroupName, projectName, assessmentName, resource, context).getSyncPoller(); + } + + /** + * Create a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 aRM model of AKS Assessment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, String assessmentName, + AksAssessmentInner resource) { + return beginCreateAsync(resourceGroupName, projectName, assessmentName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 aRM model of AKS Assessment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, String assessmentName, + AksAssessmentInner resource, Context context) { + return beginCreateAsync(resourceGroupName, projectName, assessmentName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 aRM model of AKS Assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AksAssessmentInner create(String resourceGroupName, String projectName, String assessmentName, + AksAssessmentInner resource) { + return createAsync(resourceGroupName, projectName, assessmentName, resource).block(); + } + + /** + * Create a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 aRM model of AKS Assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AksAssessmentInner create(String resourceGroupName, String projectName, String assessmentName, + AksAssessmentInner resource, Context context) { + return createAsync(resourceGroupName, projectName, assessmentName, resource, context).block(); + } + + /** + * Delete a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> downloadUrlWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, Object 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.downloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> downloadUrlWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, Object 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.")); + } + 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, body, accept, context); + } + + /** + * Get URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DownloadUrlInner> beginDownloadUrlAsync(String resourceGroupName, + String projectName, String assessmentName, Object body) { + Mono>> mono + = downloadUrlWithResponseAsync(resourceGroupName, projectName, assessmentName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DownloadUrlInner.class, DownloadUrlInner.class, this.client.getContext()); + } + + /** + * Get URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DownloadUrlInner> beginDownloadUrlAsync(String resourceGroupName, + String projectName, String assessmentName, Object 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 URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String assessmentName, Object body) { + return this.beginDownloadUrlAsync(resourceGroupName, projectName, assessmentName, body).getSyncPoller(); + } + + /** + * Get URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String assessmentName, Object body, Context context) { + return this.beginDownloadUrlAsync(resourceGroupName, projectName, assessmentName, body, context) + .getSyncPoller(); + } + + /** + * Get URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono downloadUrlAsync(String resourceGroupName, String projectName, String assessmentName, + Object body) { + return beginDownloadUrlAsync(resourceGroupName, projectName, assessmentName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Get URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono downloadUrlAsync(String resourceGroupName, String projectName, String assessmentName, + Object body, Context context) { + return beginDownloadUrlAsync(resourceGroupName, projectName, assessmentName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Get URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, + Object body) { + return downloadUrlAsync(resourceGroupName, projectName, assessmentName, body).block(); + } + + /** + * Get URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, + Object 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 AKSAssessment 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 AKSAssessment 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksAssessmentOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksAssessmentOperationsImpl.java new file mode 100644 index 000000000000..37e724a23cec --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksAssessmentOperationsImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AksAssessmentOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksAssessmentInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.models.AksAssessment; +import com.azure.resourcemanager.migration.assessment.models.AksAssessmentOperations; +import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; + +public final class AksAssessmentOperationsImpl implements AksAssessmentOperations { + private static final ClientLogger LOGGER = new ClientLogger(AksAssessmentOperationsImpl.class); + + private final AksAssessmentOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public AksAssessmentOperationsImpl(AksAssessmentOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner = this.serviceClient().listByParent(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AksAssessmentImpl(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 AksAssessmentImpl(inner1, this.manager())); + } + + 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 AksAssessmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AksAssessment get(String resourceGroupName, String projectName, String assessmentName) { + AksAssessmentInner inner = this.serviceClient().get(resourceGroupName, projectName, assessmentName); + if (inner != null) { + return new AksAssessmentImpl(inner, this.manager()); + } else { + return null; + } + } + + 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, Object 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, Object 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 AksAssessment 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, "aksAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'aksAssessments'.", 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, "aksAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'aksAssessments'.", 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, "aksAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'aksAssessments'.", 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, "aksAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'aksAssessments'.", id))); + } + return this.deleteWithResponse(resourceGroupName, projectName, assessmentName, context); + } + + private AksAssessmentOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + public AksAssessmentImpl define(String name) { + return new AksAssessmentImpl(name, this.manager()); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksAssessmentOptionsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksAssessmentOptionsImpl.java new file mode 100644 index 000000000000..fbb0121f8274 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksAssessmentOptionsImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksAssessmentOptionsInner; +import com.azure.resourcemanager.migration.assessment.models.AksAssessmentOptions; +import com.azure.resourcemanager.migration.assessment.models.AksAssessmentOptionsProperties; + +public final class AksAssessmentOptionsImpl implements AksAssessmentOptions { + private AksAssessmentOptionsInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AksAssessmentOptionsImpl(AksAssessmentOptionsInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AksAssessmentOptionsProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AksAssessmentOptionsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksClusterImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksClusterImpl.java new file mode 100644 index 000000000000..a49eab79c9e2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksClusterImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksClusterInner; +import com.azure.resourcemanager.migration.assessment.models.AksCluster; +import com.azure.resourcemanager.migration.assessment.models.AksClusterProperties; + +public final class AksClusterImpl implements AksCluster { + private AksClusterInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AksClusterImpl(AksClusterInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AksClusterProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AksClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksClusterOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksClusterOperationsClientImpl.java new file mode 100644 index 000000000000..239947b197aa --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksClusterOperationsClientImpl.java @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AksClusterOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksClusterInner; +import com.azure.resourcemanager.migration.assessment.models.AksClusterListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AksClusterOperationsClient. + */ +public final class AksClusterOperationsClientImpl implements AksClusterOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AksClusterOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of AksClusterOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AksClusterOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(AksClusterOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientAksClusterOperations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface AksClusterOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/aksAssessments/{assessmentName}/clusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/aksAssessments/{assessmentName}/clusters/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, @PathParam("clusterName") String clusterName, + @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AKSCluster resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCluster 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 AKSCluster resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCluster 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 AKSCluster resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCluster 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 AKSCluster resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCluster 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 AKSCluster resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCluster 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 AKSCluster resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCluster 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 a AKSCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param clusterName AKS Cluster 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 AKSCluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, String clusterName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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, clusterName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a AKSCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param clusterName AKS Cluster 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 AKSCluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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, clusterName, accept, context); + } + + /** + * Get a AKSCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param clusterName AKS Cluster 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 AKSCluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, String assessmentName, + String clusterName) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, clusterName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a AKSCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param clusterName AKS Cluster 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 AKSCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String clusterName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, clusterName, context).block(); + } + + /** + * Get a AKSCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param clusterName AKS Cluster 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 AKSCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AksClusterInner get(String resourceGroupName, String projectName, String assessmentName, + String clusterName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, clusterName, Context.NONE).getValue(); + } + + /** + * 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 AKSCluster 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 AKSCluster 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksClusterOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksClusterOperationsImpl.java new file mode 100644 index 000000000000..73a4188b3664 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksClusterOperationsImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AksClusterOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksClusterInner; +import com.azure.resourcemanager.migration.assessment.models.AksCluster; +import com.azure.resourcemanager.migration.assessment.models.AksClusterOperations; + +public final class AksClusterOperationsImpl implements AksClusterOperations { + private static final ClientLogger LOGGER = new ClientLogger(AksClusterOperationsImpl.class); + + private final AksClusterOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public AksClusterOperationsImpl(AksClusterOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AksClusterImpl(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 AksClusterImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + String clusterName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, assessmentName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AksClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AksCluster get(String resourceGroupName, String projectName, String assessmentName, String clusterName) { + AksClusterInner inner = this.serviceClient().get(resourceGroupName, projectName, assessmentName, clusterName); + if (inner != null) { + return new AksClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + private AksClusterOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksCostDetailImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksCostDetailImpl.java new file mode 100644 index 000000000000..4149f9bff127 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksCostDetailImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksCostDetailInner; +import com.azure.resourcemanager.migration.assessment.models.AksCostDetail; +import com.azure.resourcemanager.migration.assessment.models.AksCostDetailProperties; + +public final class AksCostDetailImpl implements AksCostDetail { + private AksCostDetailInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AksCostDetailImpl(AksCostDetailInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AksCostDetailProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AksCostDetailInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksCostDetailOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksCostDetailOperationsClientImpl.java new file mode 100644 index 000000000000..9ead70904f6e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksCostDetailOperationsClientImpl.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AksCostDetailOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksCostDetailInner; +import com.azure.resourcemanager.migration.assessment.models.AksCostDetailListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AksCostDetailOperationsClient. + */ +public final class AksCostDetailOperationsClientImpl implements AksCostDetailOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AksCostDetailOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of AksCostDetailOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AksCostDetailOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(AksCostDetailOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientAksCostDetailOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface AksCostDetailOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/aksAssessments/{assessmentName}/costDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AKSCostDetail resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCostDetail 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 AKSCostDetail resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCostDetail 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 AKSCostDetail resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCostDetail 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 AKSCostDetail resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCostDetail 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 AKSCostDetail resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCostDetail 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 AKSCostDetail resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCostDetail 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 AKSCostDetail 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 AKSCostDetail 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksCostDetailOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksCostDetailOperationsImpl.java new file mode 100644 index 000000000000..a5123fca93c1 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksCostDetailOperationsImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AksCostDetailOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksCostDetailInner; +import com.azure.resourcemanager.migration.assessment.models.AksCostDetail; +import com.azure.resourcemanager.migration.assessment.models.AksCostDetailOperations; + +public final class AksCostDetailOperationsImpl implements AksCostDetailOperations { + private static final ClientLogger LOGGER = new ClientLogger(AksCostDetailOperationsImpl.class); + + private final AksCostDetailOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public AksCostDetailOperationsImpl(AksCostDetailOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AksCostDetailImpl(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 AksCostDetailImpl(inner1, this.manager())); + } + + private AksCostDetailOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksOptionsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksOptionsOperationsClientImpl.java new file mode 100644 index 000000000000..7c58194b5504 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksOptionsOperationsClientImpl.java @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AksOptionsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksAssessmentOptionsInner; +import com.azure.resourcemanager.migration.assessment.models.AksAssessmentOptionsListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AksOptionsOperationsClient. + */ +public final class AksOptionsOperationsClientImpl implements AksOptionsOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AksOptionsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of AksOptionsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AksOptionsOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(AksOptionsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientAksOptionsOperations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface AksOptionsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/aksAssessmentOptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/aksAssessmentOptions/{assessmentOptionsName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentOptionsName") String assessmentOptionsName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AKSAssessmentOptions 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 AKSAssessmentOptions 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 AKSAssessmentOptions 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 AKSAssessmentOptions 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 AKSAssessmentOptions 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 AKSAssessmentOptions 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 AKSAssessmentOptions 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 AKSAssessmentOptions 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 AKSAssessmentOptions 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 AKSAssessmentOptions 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 AKSAssessmentOptions 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 AKSAssessmentOptions 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 a AKSAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentOptionsName AKS Assessment Options 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 AKSAssessmentOptions along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentOptionsName) { + 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 (assessmentOptionsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter assessmentOptionsName 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, assessmentOptionsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a AKSAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentOptionsName AKS Assessment Options 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 AKSAssessmentOptions along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentOptionsName, 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 (assessmentOptionsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter assessmentOptionsName 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, assessmentOptionsName, accept, context); + } + + /** + * Get a AKSAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentOptionsName AKS Assessment Options 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 AKSAssessmentOptions on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, + String assessmentOptionsName) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentOptionsName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a AKSAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentOptionsName AKS Assessment Options 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 AKSAssessmentOptions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentOptionsName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentOptionsName, context).block(); + } + + /** + * Get a AKSAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentOptionsName AKS Assessment Options 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 AKSAssessmentOptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AksAssessmentOptionsInner get(String resourceGroupName, String projectName, String assessmentOptionsName) { + return getWithResponse(resourceGroupName, projectName, assessmentOptionsName, Context.NONE).getValue(); + } + + /** + * 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 AKSAssessmentOptions 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 AKSAssessmentOptions 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksOptionsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksOptionsOperationsImpl.java new file mode 100644 index 000000000000..9b77ef9facd3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksOptionsOperationsImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AksOptionsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksAssessmentOptionsInner; +import com.azure.resourcemanager.migration.assessment.models.AksAssessmentOptions; +import com.azure.resourcemanager.migration.assessment.models.AksOptionsOperations; + +public final class AksOptionsOperationsImpl implements AksOptionsOperations { + private static final ClientLogger LOGGER = new ClientLogger(AksOptionsOperationsImpl.class); + + private final AksOptionsOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public AksOptionsOperationsImpl(AksOptionsOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AksAssessmentOptionsImpl(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 AksAssessmentOptionsImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentOptionsName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, projectName, assessmentOptionsName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AksAssessmentOptionsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AksAssessmentOptions get(String resourceGroupName, String projectName, String assessmentOptionsName) { + AksAssessmentOptionsInner inner + = this.serviceClient().get(resourceGroupName, projectName, assessmentOptionsName); + if (inner != null) { + return new AksAssessmentOptionsImpl(inner, this.manager()); + } else { + return null; + } + } + + private AksOptionsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksSummaryImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksSummaryImpl.java new file mode 100644 index 000000000000..469cff30fa8f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksSummaryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.AksSummary; +import com.azure.resourcemanager.migration.assessment.models.AksSummaryProperties; + +public final class AksSummaryImpl implements AksSummary { + private AksSummaryInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AksSummaryImpl(AksSummaryInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AksSummaryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AksSummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksSummaryOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksSummaryOperationsClientImpl.java new file mode 100644 index 000000000000..4786bfc4b610 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksSummaryOperationsClientImpl.java @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AksSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.AksSummaryListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AksSummaryOperationsClient. + */ +public final class AksSummaryOperationsClientImpl implements AksSummaryOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AksSummaryOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of AksSummaryOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AksSummaryOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(AksSummaryOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientAksSummaryOperations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface AksSummaryOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/aksAssessments/{assessmentName}/summaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/aksAssessments/{assessmentName}/summaries/{summaryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParentNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AKSSummary resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSSummary 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 AKSSummary resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSSummary 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 AKSSummary resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSSummary 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 AKSSummary resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSSummary 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 AKSSummary resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSSummary 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 AKSSummary resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSSummary 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 a AKSSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param summaryName AKS Assessment Summary 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 AKSSummary 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 AKSSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param summaryName AKS Assessment Summary 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 AKSSummary 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 AKSSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param summaryName AKS Assessment Summary 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 AKSSummary 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 AKSSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param summaryName AKS Assessment Summary 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 AKSSummary 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 AKSSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param summaryName AKS Assessment Summary 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 AKSSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AksSummaryInner get(String resourceGroupName, String projectName, String assessmentName, + String summaryName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, summaryName, Context.NONE).getValue(); + } + + /** + * 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 AKSSummary 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 AKSSummary 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksSummaryOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksSummaryOperationsImpl.java new file mode 100644 index 000000000000..4b75eb1c1418 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AksSummaryOperationsImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AksSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.AksSummary; +import com.azure.resourcemanager.migration.assessment.models.AksSummaryOperations; + +public final class AksSummaryOperationsImpl implements AksSummaryOperations { + private static final ClientLogger LOGGER = new ClientLogger(AksSummaryOperationsImpl.class); + + private final AksSummaryOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public AksSummaryOperationsImpl(AksSummaryOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AksSummaryImpl(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 AksSummaryImpl(inner1, this.manager())); + } + + 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 AksSummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AksSummary get(String resourceGroupName, String projectName, String assessmentName, String summaryName) { + AksSummaryInner inner = this.serviceClient().get(resourceGroupName, projectName, assessmentName, summaryName); + if (inner != null) { + return new AksSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + private AksSummaryOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachineImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachineImpl.java deleted file mode 100644 index 48337823a02a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachineImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedMachineInner; -import com.azure.resourcemanager.migration.assessment.models.AssessedMachine; -import com.azure.resourcemanager.migration.assessment.models.AssessedMachineProperties; - -public final class AssessedMachineImpl implements AssessedMachine { - private AssessedMachineInner innerObject; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - AssessedMachineImpl(AssessedMachineInner innerObject, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AssessedMachineProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public AssessedMachineInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachineV2Impl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachineV2Impl.java new file mode 100644 index 000000000000..ca0c646f4e49 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachineV2Impl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedMachineV2Inner; +import com.azure.resourcemanager.migration.assessment.models.AssessedMachineV2; +import com.azure.resourcemanager.migration.assessment.models.AssessedMachineV2Properties; + +public final class AssessedMachineV2Impl implements AssessedMachineV2 { + private AssessedMachineV2Inner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AssessedMachineV2Impl(AssessedMachineV2Inner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachinesOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachinesOperationsClientImpl.java deleted file mode 100644 index 93b313bd3f88..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachinesOperationsClientImpl.java +++ /dev/null @@ -1,540 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedMachinesOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedMachineInner; -import com.azure.resourcemanager.migration.assessment.models.AssessedMachineListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AssessedMachinesOperationsClient. - */ -public final class AssessedMachinesOperationsClientImpl implements AssessedMachinesOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AssessedMachinesOperationsService service; - - /** - * The service client containing this operation class. - */ - private final MigrationAssessmentManagementClientImpl client; - - /** - * Initializes an instance of AssessedMachinesOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AssessedMachinesOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { - this.service = RestProxy.create(AssessedMachinesOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MigrationAssessmentManagementClientAssessedMachinesOperations to be - * used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MigrationAssessmentM") - public interface AssessedMachinesOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessment(@HostParam("$host") 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("groupName") String groupName, @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}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @PathParam("assessedMachineName") String assessedMachineName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List AssessedMachine resources by Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 AssessedMachine list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentSinglePageAsync(String resourceGroupName, - String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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.listByAssessment(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, continuationToken, - totalRecordCount, projectName, groupName, 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 AssessedMachine resources by Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 AssessedMachine list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentSinglePageAsync(String resourceGroupName, - String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 - .listByAssessment(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, filter, pageSize, continuationToken, totalRecordCount, projectName, groupName, - assessmentName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List AssessedMachine resources by Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 AssessedMachine list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount) { - return new PagedFlux<>( - () -> listByAssessmentSinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, filter, - pageSize, continuationToken, totalRecordCount), - nextLink -> listByAssessmentNextSinglePageAsync(nextLink)); - } - - /** - * List AssessedMachine resources by Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 AssessedMachine list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName) { - final String filter = null; - final Integer pageSize = null; - final String continuationToken = null; - final Integer totalRecordCount = null; - return new PagedFlux<>( - () -> listByAssessmentSinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, filter, - pageSize, continuationToken, totalRecordCount), - nextLink -> listByAssessmentNextSinglePageAsync(nextLink)); - } - - /** - * List AssessedMachine resources by Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 AssessedMachine list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context) { - return new PagedFlux<>( - () -> listByAssessmentSinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, filter, - pageSize, continuationToken, totalRecordCount, context), - nextLink -> listByAssessmentNextSinglePageAsync(nextLink, context)); - } - - /** - * List AssessedMachine resources by Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 AssessedMachine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessment(String resourceGroupName, String projectName, - String groupName, String assessmentName) { - final String filter = null; - final Integer pageSize = null; - final String continuationToken = null; - final Integer totalRecordCount = null; - return new PagedIterable<>(listByAssessmentAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount)); - } - - /** - * List AssessedMachine resources by Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 AssessedMachine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessment(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context) { - return new PagedIterable<>(listByAssessmentAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount, context)); - } - - /** - * Get a AssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment ARM name. - * @param assessedMachineName Machine assessment 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 AssessedMachine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, - assessedMachineName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a AssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment ARM name. - * @param assessedMachineName Machine assessment 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 AssessedMachine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, assessedMachineName, accept, context); - } - - /** - * Get a AssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment ARM name. - * @param assessedMachineName Machine assessment 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 AssessedMachine on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedMachineName) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, assessedMachineName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a AssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment ARM name. - * @param assessedMachineName Machine assessment 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 AssessedMachine along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String projectName, - String groupName, String assessmentName, String assessedMachineName, Context context) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, assessedMachineName, - context).block(); - } - - /** - * Get a AssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment ARM name. - * @param assessedMachineName Machine assessment 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 AssessedMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AssessedMachineInner get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedMachineName) { - return getWithResponse(resourceGroupName, projectName, groupName, assessmentName, assessedMachineName, - Context.NONE).getValue(); - } - - /** - * 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 AssessedMachine list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentNextSinglePageAsync(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.listByAssessmentNext(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 AssessedMachine list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentNextSinglePageAsync(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.listByAssessmentNext(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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachinesOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachinesOperationsImpl.java deleted file mode 100644 index 4704bf357b0d..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachinesOperationsImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedMachinesOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedMachineInner; -import com.azure.resourcemanager.migration.assessment.models.AssessedMachine; -import com.azure.resourcemanager.migration.assessment.models.AssessedMachinesOperations; - -public final class AssessedMachinesOperationsImpl implements AssessedMachinesOperations { - private static final ClientLogger LOGGER = new ClientLogger(AssessedMachinesOperationsImpl.class); - - private final AssessedMachinesOperationsClient innerClient; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - public AssessedMachinesOperationsImpl(AssessedMachinesOperationsClient innerClient, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByAssessment(String resourceGroupName, String projectName, - String groupName, String assessmentName) { - PagedIterable inner - = this.serviceClient().listByAssessment(resourceGroupName, projectName, groupName, assessmentName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessedMachineImpl(inner1, this.manager())); - } - - public PagedIterable listByAssessment(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context) { - PagedIterable inner = this.serviceClient() - .listByAssessment(resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, - continuationToken, totalRecordCount, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessedMachineImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedMachineName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, projectName, groupName, assessmentName, assessedMachineName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AssessedMachineImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AssessedMachine get(String resourceGroupName, String projectName, String groupName, String assessmentName, - String assessedMachineName) { - AssessedMachineInner inner - = this.serviceClient().get(resourceGroupName, projectName, groupName, assessmentName, assessedMachineName); - if (inner != null) { - return new AssessedMachineImpl(inner, this.manager()); - } else { - return null; - } - } - - private AssessedMachinesOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachinesV2OperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachinesV2OperationsClientImpl.java new file mode 100644 index 000000000000..21c058c9f6a1 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachinesV2OperationsClientImpl.java @@ -0,0 +1,510 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedMachinesV2OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedMachineV2Inner; +import com.azure.resourcemanager.migration.assessment.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 MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of AssessedMachinesV2OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AssessedMachinesV2OperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(AssessedMachinesV2OperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientAssessedMachinesV2Operations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface AssessedMachinesV2OperationsService { + @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("$host") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParentNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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. + * @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 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(); + } + + /** + * 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachinesV2OperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachinesV2OperationsImpl.java new file mode 100644 index 000000000000..e4d15e6ae4bb --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedMachinesV2OperationsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedMachinesV2OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedMachineV2Inner; +import com.azure.resourcemanager.migration.assessment.models.AssessedMachineV2; +import com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager serviceManager; + + public AssessedMachinesV2OperationsImpl(AssessedMachinesV2OperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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())); + } + + 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; + } + } + + private AssessedMachinesV2OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV2Impl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV2Impl.java deleted file mode 100644 index 07cbc5686efe..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV2Impl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlDatabaseV2Inner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV2; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV2Properties; - -public final class AssessedSqlDatabaseV2Impl implements AssessedSqlDatabaseV2 { - private AssessedSqlDatabaseV2Inner innerObject; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - AssessedSqlDatabaseV2Impl(AssessedSqlDatabaseV2Inner innerObject, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AssessedSqlDatabaseV2Properties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public AssessedSqlDatabaseV2Inner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV2OperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV2OperationsClientImpl.java deleted file mode 100644 index b942cccf11e8..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV2OperationsClientImpl.java +++ /dev/null @@ -1,541 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedSqlDatabaseV2OperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlDatabaseV2Inner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV2ListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AssessedSqlDatabaseV2OperationsClient. - */ -public final class AssessedSqlDatabaseV2OperationsClientImpl implements AssessedSqlDatabaseV2OperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AssessedSqlDatabaseV2OperationsService service; - - /** - * The service client containing this operation class. - */ - private final MigrationAssessmentManagementClientImpl client; - - /** - * Initializes an instance of AssessedSqlDatabaseV2OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AssessedSqlDatabaseV2OperationsClientImpl(MigrationAssessmentManagementClientImpl client) { - this.service = RestProxy.create(AssessedSqlDatabaseV2OperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MigrationAssessmentManagementClientAssessedSqlDatabaseV2Operations to - * be used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MigrationAssessmentM") - public interface AssessedSqlDatabaseV2OperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlDatabases") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySqlAssessmentV2(@HostParam("$host") 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("groupName") String groupName, @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}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlDatabases/{assessedSqlDatabaseName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @PathParam("assessedSqlDatabaseName") String assessedSqlDatabaseName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySqlAssessmentV2Next( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List AssessedSqlDatabaseV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV2 list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2SinglePageAsync( - String resourceGroupName, String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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.listBySqlAssessmentV2(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, - continuationToken, totalRecordCount, projectName, groupName, 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 AssessedSqlDatabaseV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV2 list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2SinglePageAsync( - String resourceGroupName, String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 - .listBySqlAssessmentV2(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, continuationToken, - totalRecordCount, projectName, groupName, assessmentName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List AssessedSqlDatabaseV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV2 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySqlAssessmentV2Async(String resourceGroupName, - String projectName, String groupName, String assessmentName, String filter, Integer pageSize, - String continuationToken, Integer totalRecordCount) { - return new PagedFlux<>( - () -> listBySqlAssessmentV2SinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount), - nextLink -> listBySqlAssessmentV2NextSinglePageAsync(nextLink)); - } - - /** - * List AssessedSqlDatabaseV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV2 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySqlAssessmentV2Async(String resourceGroupName, - String projectName, String groupName, String assessmentName) { - final String filter = null; - final Integer pageSize = null; - final String continuationToken = null; - final Integer totalRecordCount = null; - return new PagedFlux<>( - () -> listBySqlAssessmentV2SinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount), - nextLink -> listBySqlAssessmentV2NextSinglePageAsync(nextLink)); - } - - /** - * List AssessedSqlDatabaseV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV2 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySqlAssessmentV2Async(String resourceGroupName, - String projectName, String groupName, String assessmentName, String filter, Integer pageSize, - String continuationToken, Integer totalRecordCount, Context context) { - return new PagedFlux<>( - () -> listBySqlAssessmentV2SinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount, context), - nextLink -> listBySqlAssessmentV2NextSinglePageAsync(nextLink, context)); - } - - /** - * List AssessedSqlDatabaseV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV2 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName) { - final String filter = null; - final Integer pageSize = null; - final String continuationToken = null; - final Integer totalRecordCount = null; - return new PagedIterable<>(listBySqlAssessmentV2Async(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount)); - } - - /** - * List AssessedSqlDatabaseV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV2 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context) { - return new PagedIterable<>(listBySqlAssessmentV2Async(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount, context)); - } - - /** - * Get a AssessedSqlDatabaseV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV2 along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String projectName, String groupName, String assessmentName, String assessedSqlDatabaseName) { - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assessedSqlDatabaseName == null) { - return Mono.error( - new IllegalArgumentException("Parameter assessedSqlDatabaseName 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, groupName, assessmentName, - assessedSqlDatabaseName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a AssessedSqlDatabaseV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV2 along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String projectName, String groupName, String assessmentName, String assessedSqlDatabaseName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assessedSqlDatabaseName == null) { - return Mono.error( - new IllegalArgumentException("Parameter assessedSqlDatabaseName 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, groupName, assessmentName, assessedSqlDatabaseName, accept, context); - } - - /** - * Get a AssessedSqlDatabaseV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV2 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlDatabaseName) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, assessedSqlDatabaseName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a AssessedSqlDatabaseV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV2 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String projectName, - String groupName, String assessmentName, String assessedSqlDatabaseName, Context context) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, assessedSqlDatabaseName, - context).block(); - } - - /** - * Get a AssessedSqlDatabaseV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV2. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AssessedSqlDatabaseV2Inner get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlDatabaseName) { - return getWithResponse(resourceGroupName, projectName, groupName, assessmentName, assessedSqlDatabaseName, - Context.NONE).getValue(); - } - - /** - * 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 AssessedSqlDatabaseV2 list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2NextSinglePageAsync(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.listBySqlAssessmentV2Next(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 AssessedSqlDatabaseV2 list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2NextSinglePageAsync(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.listBySqlAssessmentV2Next(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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV2OperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV2OperationsImpl.java deleted file mode 100644 index 2157f7c23413..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV2OperationsImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedSqlDatabaseV2OperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlDatabaseV2Inner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV2; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV2Operations; - -public final class AssessedSqlDatabaseV2OperationsImpl implements AssessedSqlDatabaseV2Operations { - private static final ClientLogger LOGGER = new ClientLogger(AssessedSqlDatabaseV2OperationsImpl.class); - - private final AssessedSqlDatabaseV2OperationsClient innerClient; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - public AssessedSqlDatabaseV2OperationsImpl(AssessedSqlDatabaseV2OperationsClient innerClient, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName) { - PagedIterable inner - = this.serviceClient().listBySqlAssessmentV2(resourceGroupName, projectName, groupName, assessmentName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessedSqlDatabaseV2Impl(inner1, this.manager())); - } - - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context) { - PagedIterable inner = this.serviceClient() - .listBySqlAssessmentV2(resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, - continuationToken, totalRecordCount, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessedSqlDatabaseV2Impl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String projectName, - String groupName, String assessmentName, String assessedSqlDatabaseName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, projectName, groupName, assessmentName, assessedSqlDatabaseName, - context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AssessedSqlDatabaseV2Impl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AssessedSqlDatabaseV2 get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlDatabaseName) { - AssessedSqlDatabaseV2Inner inner = this.serviceClient() - .get(resourceGroupName, projectName, groupName, assessmentName, assessedSqlDatabaseName); - if (inner != null) { - return new AssessedSqlDatabaseV2Impl(inner, this.manager()); - } else { - return null; - } - } - - private AssessedSqlDatabaseV2OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV3Impl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV3Impl.java new file mode 100644 index 000000000000..5020465e9d27 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV3Impl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlDatabaseV3Inner; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV3; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV3Properties; + +public final class AssessedSqlDatabaseV3Impl implements AssessedSqlDatabaseV3 { + private AssessedSqlDatabaseV3Inner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AssessedSqlDatabaseV3Impl(AssessedSqlDatabaseV3Inner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AssessedSqlDatabaseV3Properties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AssessedSqlDatabaseV3Inner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV3OperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV3OperationsClientImpl.java new file mode 100644 index 000000000000..eaf1c5958b28 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV3OperationsClientImpl.java @@ -0,0 +1,510 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedSqlDatabaseV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlDatabaseV3Inner; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV3ListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AssessedSqlDatabaseV3OperationsClient. + */ +public final class AssessedSqlDatabaseV3OperationsClientImpl implements AssessedSqlDatabaseV3OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AssessedSqlDatabaseV3OperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of AssessedSqlDatabaseV3OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AssessedSqlDatabaseV3OperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(AssessedSqlDatabaseV3OperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientAssessedSqlDatabaseV3Operations to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface AssessedSqlDatabaseV3OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessments/{assessmentName}/assessedSqlDatabases") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessments/{assessmentName}/assessedSqlDatabases/{assessedSqlDatabaseName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, + @PathParam("assessedSqlDatabaseName") String assessedSqlDatabaseName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AssessedSqlDatabaseV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV3 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 AssessedSqlDatabaseV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV3 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 AssessedSqlDatabaseV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV3 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 AssessedSqlDatabaseV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV3 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 AssessedSqlDatabaseV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV3 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 AssessedSqlDatabaseV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV3 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 AssessedSqlDatabaseV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV3 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 a AssessedSqlDatabaseV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV3 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String projectName, String assessmentName, String assessedSqlDatabaseName) { + 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 (assessedSqlDatabaseName == null) { + return Mono.error( + new IllegalArgumentException("Parameter assessedSqlDatabaseName 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, + assessedSqlDatabaseName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a AssessedSqlDatabaseV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV3 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String projectName, String assessmentName, String assessedSqlDatabaseName, 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 (assessedSqlDatabaseName == null) { + return Mono.error( + new IllegalArgumentException("Parameter assessedSqlDatabaseName 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, assessedSqlDatabaseName, accept, context); + } + + /** + * Get a AssessedSqlDatabaseV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV3 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, + String assessmentName, String assessedSqlDatabaseName) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, assessedSqlDatabaseName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a AssessedSqlDatabaseV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV3 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedSqlDatabaseName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, assessedSqlDatabaseName, context) + .block(); + } + + /** + * Get a AssessedSqlDatabaseV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV3. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssessedSqlDatabaseV3Inner get(String resourceGroupName, String projectName, String assessmentName, + String assessedSqlDatabaseName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, assessedSqlDatabaseName, Context.NONE) + .getValue(); + } + + /** + * 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 AssessedSqlDatabaseV3 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 AssessedSqlDatabaseV3 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV3OperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV3OperationsImpl.java new file mode 100644 index 000000000000..e8e621f0d6f1 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlDatabaseV3OperationsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedSqlDatabaseV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlDatabaseV3Inner; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV3; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV3Operations; + +public final class AssessedSqlDatabaseV3OperationsImpl implements AssessedSqlDatabaseV3Operations { + private static final ClientLogger LOGGER = new ClientLogger(AssessedSqlDatabaseV3OperationsImpl.class); + + private final AssessedSqlDatabaseV3OperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public AssessedSqlDatabaseV3OperationsImpl(AssessedSqlDatabaseV3OperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessedSqlDatabaseV3Impl(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 AssessedSqlDatabaseV3Impl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedSqlDatabaseName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, assessmentName, assessedSqlDatabaseName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AssessedSqlDatabaseV3Impl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AssessedSqlDatabaseV3 get(String resourceGroupName, String projectName, String assessmentName, + String assessedSqlDatabaseName) { + AssessedSqlDatabaseV3Inner inner + = this.serviceClient().get(resourceGroupName, projectName, assessmentName, assessedSqlDatabaseName); + if (inner != null) { + return new AssessedSqlDatabaseV3Impl(inner, this.manager()); + } else { + return null; + } + } + + private AssessedSqlDatabaseV3OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV2Impl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV2Impl.java deleted file mode 100644 index b7ab2e3249ca..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV2Impl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlInstanceV2Inner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV2; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV2Properties; - -public final class AssessedSqlInstanceV2Impl implements AssessedSqlInstanceV2 { - private AssessedSqlInstanceV2Inner innerObject; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - AssessedSqlInstanceV2Impl(AssessedSqlInstanceV2Inner innerObject, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AssessedSqlInstanceV2Properties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public AssessedSqlInstanceV2Inner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV2OperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV2OperationsClientImpl.java deleted file mode 100644 index b2f8bba31883..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV2OperationsClientImpl.java +++ /dev/null @@ -1,541 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedSqlInstanceV2OperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlInstanceV2Inner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV2ListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AssessedSqlInstanceV2OperationsClient. - */ -public final class AssessedSqlInstanceV2OperationsClientImpl implements AssessedSqlInstanceV2OperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AssessedSqlInstanceV2OperationsService service; - - /** - * The service client containing this operation class. - */ - private final MigrationAssessmentManagementClientImpl client; - - /** - * Initializes an instance of AssessedSqlInstanceV2OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AssessedSqlInstanceV2OperationsClientImpl(MigrationAssessmentManagementClientImpl client) { - this.service = RestProxy.create(AssessedSqlInstanceV2OperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MigrationAssessmentManagementClientAssessedSqlInstanceV2Operations to - * be used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MigrationAssessmentM") - public interface AssessedSqlInstanceV2OperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlInstances") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySqlAssessmentV2(@HostParam("$host") 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("groupName") String groupName, @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}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlInstances/{assessedSqlInstanceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @PathParam("assessedSqlInstanceName") String assessedSqlInstanceName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySqlAssessmentV2Next( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List AssessedSqlInstanceV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV2 list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2SinglePageAsync( - String resourceGroupName, String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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.listBySqlAssessmentV2(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, - continuationToken, totalRecordCount, projectName, groupName, 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 AssessedSqlInstanceV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV2 list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2SinglePageAsync( - String resourceGroupName, String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 - .listBySqlAssessmentV2(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, continuationToken, - totalRecordCount, projectName, groupName, assessmentName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List AssessedSqlInstanceV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV2 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySqlAssessmentV2Async(String resourceGroupName, - String projectName, String groupName, String assessmentName, String filter, Integer pageSize, - String continuationToken, Integer totalRecordCount) { - return new PagedFlux<>( - () -> listBySqlAssessmentV2SinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount), - nextLink -> listBySqlAssessmentV2NextSinglePageAsync(nextLink)); - } - - /** - * List AssessedSqlInstanceV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV2 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySqlAssessmentV2Async(String resourceGroupName, - String projectName, String groupName, String assessmentName) { - final String filter = null; - final Integer pageSize = null; - final String continuationToken = null; - final Integer totalRecordCount = null; - return new PagedFlux<>( - () -> listBySqlAssessmentV2SinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount), - nextLink -> listBySqlAssessmentV2NextSinglePageAsync(nextLink)); - } - - /** - * List AssessedSqlInstanceV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV2 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySqlAssessmentV2Async(String resourceGroupName, - String projectName, String groupName, String assessmentName, String filter, Integer pageSize, - String continuationToken, Integer totalRecordCount, Context context) { - return new PagedFlux<>( - () -> listBySqlAssessmentV2SinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount, context), - nextLink -> listBySqlAssessmentV2NextSinglePageAsync(nextLink, context)); - } - - /** - * List AssessedSqlInstanceV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV2 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName) { - final String filter = null; - final Integer pageSize = null; - final String continuationToken = null; - final Integer totalRecordCount = null; - return new PagedIterable<>(listBySqlAssessmentV2Async(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount)); - } - - /** - * List AssessedSqlInstanceV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV2 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context) { - return new PagedIterable<>(listBySqlAssessmentV2Async(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount, context)); - } - - /** - * Get a AssessedSqlInstanceV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV2 along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String projectName, String groupName, String assessmentName, String assessedSqlInstanceName) { - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assessedSqlInstanceName == null) { - return Mono.error( - new IllegalArgumentException("Parameter assessedSqlInstanceName 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, groupName, assessmentName, - assessedSqlInstanceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a AssessedSqlInstanceV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV2 along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String projectName, String groupName, String assessmentName, String assessedSqlInstanceName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assessedSqlInstanceName == null) { - return Mono.error( - new IllegalArgumentException("Parameter assessedSqlInstanceName 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, groupName, assessmentName, assessedSqlInstanceName, accept, context); - } - - /** - * Get a AssessedSqlInstanceV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV2 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlInstanceName) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, assessedSqlInstanceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a AssessedSqlInstanceV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV2 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String projectName, - String groupName, String assessmentName, String assessedSqlInstanceName, Context context) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, assessedSqlInstanceName, - context).block(); - } - - /** - * Get a AssessedSqlInstanceV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV2. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AssessedSqlInstanceV2Inner get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlInstanceName) { - return getWithResponse(resourceGroupName, projectName, groupName, assessmentName, assessedSqlInstanceName, - Context.NONE).getValue(); - } - - /** - * 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 AssessedSqlInstanceV2 list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2NextSinglePageAsync(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.listBySqlAssessmentV2Next(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 AssessedSqlInstanceV2 list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2NextSinglePageAsync(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.listBySqlAssessmentV2Next(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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV2OperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV2OperationsImpl.java deleted file mode 100644 index eee210892584..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV2OperationsImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedSqlInstanceV2OperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlInstanceV2Inner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV2; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV2Operations; - -public final class AssessedSqlInstanceV2OperationsImpl implements AssessedSqlInstanceV2Operations { - private static final ClientLogger LOGGER = new ClientLogger(AssessedSqlInstanceV2OperationsImpl.class); - - private final AssessedSqlInstanceV2OperationsClient innerClient; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - public AssessedSqlInstanceV2OperationsImpl(AssessedSqlInstanceV2OperationsClient innerClient, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName) { - PagedIterable inner - = this.serviceClient().listBySqlAssessmentV2(resourceGroupName, projectName, groupName, assessmentName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessedSqlInstanceV2Impl(inner1, this.manager())); - } - - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context) { - PagedIterable inner = this.serviceClient() - .listBySqlAssessmentV2(resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, - continuationToken, totalRecordCount, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessedSqlInstanceV2Impl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String projectName, - String groupName, String assessmentName, String assessedSqlInstanceName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, projectName, groupName, assessmentName, assessedSqlInstanceName, - context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AssessedSqlInstanceV2Impl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AssessedSqlInstanceV2 get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlInstanceName) { - AssessedSqlInstanceV2Inner inner = this.serviceClient() - .get(resourceGroupName, projectName, groupName, assessmentName, assessedSqlInstanceName); - if (inner != null) { - return new AssessedSqlInstanceV2Impl(inner, this.manager()); - } else { - return null; - } - } - - private AssessedSqlInstanceV2OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV3Impl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV3Impl.java new file mode 100644 index 000000000000..8659a5eee5a9 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV3Impl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlInstanceV3Inner; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV3; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV3Properties; + +public final class AssessedSqlInstanceV3Impl implements AssessedSqlInstanceV3 { + private AssessedSqlInstanceV3Inner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AssessedSqlInstanceV3Impl(AssessedSqlInstanceV3Inner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AssessedSqlInstanceV3Properties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AssessedSqlInstanceV3Inner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV3OperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV3OperationsClientImpl.java new file mode 100644 index 000000000000..8b17d64f7abe --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV3OperationsClientImpl.java @@ -0,0 +1,510 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedSqlInstanceV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlInstanceV3Inner; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV3ListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AssessedSqlInstanceV3OperationsClient. + */ +public final class AssessedSqlInstanceV3OperationsClientImpl implements AssessedSqlInstanceV3OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AssessedSqlInstanceV3OperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of AssessedSqlInstanceV3OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AssessedSqlInstanceV3OperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(AssessedSqlInstanceV3OperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientAssessedSqlInstanceV3Operations to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface AssessedSqlInstanceV3OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessments/{assessmentName}/assessedSqlInstances") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessments/{assessmentName}/assessedSqlInstances/{assessedSqlInstanceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, + @PathParam("assessedSqlInstanceName") String assessedSqlInstanceName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AssessedSqlInstanceV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV3 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 AssessedSqlInstanceV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV3 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 AssessedSqlInstanceV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV3 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 AssessedSqlInstanceV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV3 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 AssessedSqlInstanceV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV3 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 AssessedSqlInstanceV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV3 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 AssessedSqlInstanceV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV3 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 a AssessedSqlInstanceV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV3 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String projectName, String assessmentName, String assessedSqlInstanceName) { + 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 (assessedSqlInstanceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter assessedSqlInstanceName 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, + assessedSqlInstanceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a AssessedSqlInstanceV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV3 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String projectName, String assessmentName, String assessedSqlInstanceName, 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 (assessedSqlInstanceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter assessedSqlInstanceName 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, assessedSqlInstanceName, accept, context); + } + + /** + * Get a AssessedSqlInstanceV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV3 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, + String assessmentName, String assessedSqlInstanceName) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, assessedSqlInstanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a AssessedSqlInstanceV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV3 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedSqlInstanceName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, assessedSqlInstanceName, context) + .block(); + } + + /** + * Get a AssessedSqlInstanceV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV3. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssessedSqlInstanceV3Inner get(String resourceGroupName, String projectName, String assessmentName, + String assessedSqlInstanceName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, assessedSqlInstanceName, Context.NONE) + .getValue(); + } + + /** + * 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 AssessedSqlInstanceV3 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 AssessedSqlInstanceV3 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV3OperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV3OperationsImpl.java new file mode 100644 index 000000000000..46a602d9071d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlInstanceV3OperationsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedSqlInstanceV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlInstanceV3Inner; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV3; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV3Operations; + +public final class AssessedSqlInstanceV3OperationsImpl implements AssessedSqlInstanceV3Operations { + private static final ClientLogger LOGGER = new ClientLogger(AssessedSqlInstanceV3OperationsImpl.class); + + private final AssessedSqlInstanceV3OperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public AssessedSqlInstanceV3OperationsImpl(AssessedSqlInstanceV3OperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessedSqlInstanceV3Impl(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 AssessedSqlInstanceV3Impl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedSqlInstanceName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, assessmentName, assessedSqlInstanceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AssessedSqlInstanceV3Impl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AssessedSqlInstanceV3 get(String resourceGroupName, String projectName, String assessmentName, + String assessedSqlInstanceName) { + AssessedSqlInstanceV3Inner inner + = this.serviceClient().get(resourceGroupName, projectName, assessmentName, assessedSqlInstanceName); + if (inner != null) { + return new AssessedSqlInstanceV3Impl(inner, this.manager()); + } else { + return null; + } + } + + private AssessedSqlInstanceV3OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachineImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachineImpl.java deleted file mode 100644 index 6e997f26e1f2..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachineImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlMachineInner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachine; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachineProperties; - -public final class AssessedSqlMachineImpl implements AssessedSqlMachine { - private AssessedSqlMachineInner innerObject; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - AssessedSqlMachineImpl(AssessedSqlMachineInner innerObject, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AssessedSqlMachineProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public AssessedSqlMachineInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachineV3Impl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachineV3Impl.java new file mode 100644 index 000000000000..9a4b6063aea4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachineV3Impl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlMachineV3Inner; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachineV3; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachineV3Properties; + +public final class AssessedSqlMachineV3Impl implements AssessedSqlMachineV3 { + private AssessedSqlMachineV3Inner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AssessedSqlMachineV3Impl(AssessedSqlMachineV3Inner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AssessedSqlMachineV3Properties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AssessedSqlMachineV3Inner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachinesOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachinesOperationsClientImpl.java deleted file mode 100644 index c00904dbe115..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachinesOperationsClientImpl.java +++ /dev/null @@ -1,541 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedSqlMachinesOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlMachineInner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachineListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AssessedSqlMachinesOperationsClient. - */ -public final class AssessedSqlMachinesOperationsClientImpl implements AssessedSqlMachinesOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AssessedSqlMachinesOperationsService service; - - /** - * The service client containing this operation class. - */ - private final MigrationAssessmentManagementClientImpl client; - - /** - * Initializes an instance of AssessedSqlMachinesOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AssessedSqlMachinesOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { - this.service = RestProxy.create(AssessedSqlMachinesOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MigrationAssessmentManagementClientAssessedSqlMachinesOperations to - * be used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MigrationAssessmentM") - public interface AssessedSqlMachinesOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlMachines") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySqlAssessmentV2(@HostParam("$host") 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("groupName") String groupName, @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}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlMachines/{assessedSqlMachineName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @PathParam("assessedSqlMachineName") String assessedSqlMachineName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySqlAssessmentV2Next( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List AssessedSqlMachine resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlMachine list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2SinglePageAsync(String resourceGroupName, - String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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.listBySqlAssessmentV2(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, - continuationToken, totalRecordCount, projectName, groupName, 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 AssessedSqlMachine resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlMachine list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2SinglePageAsync(String resourceGroupName, - String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 - .listBySqlAssessmentV2(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, continuationToken, - totalRecordCount, projectName, groupName, assessmentName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List AssessedSqlMachine resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlMachine list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySqlAssessmentV2Async(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount) { - return new PagedFlux<>( - () -> listBySqlAssessmentV2SinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount), - nextLink -> listBySqlAssessmentV2NextSinglePageAsync(nextLink)); - } - - /** - * List AssessedSqlMachine resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlMachine list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySqlAssessmentV2Async(String resourceGroupName, String projectName, - String groupName, String assessmentName) { - final String filter = null; - final Integer pageSize = null; - final String continuationToken = null; - final Integer totalRecordCount = null; - return new PagedFlux<>( - () -> listBySqlAssessmentV2SinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount), - nextLink -> listBySqlAssessmentV2NextSinglePageAsync(nextLink)); - } - - /** - * List AssessedSqlMachine resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlMachine list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySqlAssessmentV2Async(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context) { - return new PagedFlux<>( - () -> listBySqlAssessmentV2SinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount, context), - nextLink -> listBySqlAssessmentV2NextSinglePageAsync(nextLink, context)); - } - - /** - * List AssessedSqlMachine resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlMachine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName) { - final String filter = null; - final Integer pageSize = null; - final String continuationToken = null; - final Integer totalRecordCount = null; - return new PagedIterable<>(listBySqlAssessmentV2Async(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount)); - } - - /** - * List AssessedSqlMachine resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlMachine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context) { - return new PagedIterable<>(listBySqlAssessmentV2Async(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount, context)); - } - - /** - * Get a AssessedSqlMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName, String assessedSqlMachineName) { - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assessedSqlMachineName == null) { - return Mono.error( - new IllegalArgumentException("Parameter assessedSqlMachineName 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, groupName, assessmentName, - assessedSqlMachineName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a AssessedSqlMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName, String assessedSqlMachineName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assessedSqlMachineName == null) { - return Mono.error( - new IllegalArgumentException("Parameter assessedSqlMachineName 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, groupName, assessmentName, assessedSqlMachineName, accept, context); - } - - /** - * Get a AssessedSqlMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachine on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlMachineName) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, assessedSqlMachineName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a AssessedSqlMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachine along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String projectName, - String groupName, String assessmentName, String assessedSqlMachineName, Context context) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, assessedSqlMachineName, - context).block(); - } - - /** - * Get a AssessedSqlMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AssessedSqlMachineInner get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlMachineName) { - return getWithResponse(resourceGroupName, projectName, groupName, assessmentName, assessedSqlMachineName, - Context.NONE).getValue(); - } - - /** - * 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 AssessedSqlMachine list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2NextSinglePageAsync(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.listBySqlAssessmentV2Next(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 AssessedSqlMachine list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2NextSinglePageAsync(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.listBySqlAssessmentV2Next(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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachinesOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachinesOperationsImpl.java deleted file mode 100644 index 8d46a78e8c17..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachinesOperationsImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedSqlMachinesOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlMachineInner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachine; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachinesOperations; - -public final class AssessedSqlMachinesOperationsImpl implements AssessedSqlMachinesOperations { - private static final ClientLogger LOGGER = new ClientLogger(AssessedSqlMachinesOperationsImpl.class); - - private final AssessedSqlMachinesOperationsClient innerClient; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - public AssessedSqlMachinesOperationsImpl(AssessedSqlMachinesOperationsClient innerClient, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName) { - PagedIterable inner - = this.serviceClient().listBySqlAssessmentV2(resourceGroupName, projectName, groupName, assessmentName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessedSqlMachineImpl(inner1, this.manager())); - } - - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context) { - PagedIterable inner = this.serviceClient() - .listBySqlAssessmentV2(resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, - continuationToken, totalRecordCount, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessedSqlMachineImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlMachineName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, projectName, groupName, assessmentName, assessedSqlMachineName, - context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AssessedSqlMachineImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AssessedSqlMachine get(String resourceGroupName, String projectName, String groupName, String assessmentName, - String assessedSqlMachineName) { - AssessedSqlMachineInner inner = this.serviceClient() - .get(resourceGroupName, projectName, groupName, assessmentName, assessedSqlMachineName); - if (inner != null) { - return new AssessedSqlMachineImpl(inner, this.manager()); - } else { - return null; - } - } - - private AssessedSqlMachinesOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachinesV3OperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachinesV3OperationsClientImpl.java new file mode 100644 index 000000000000..c152c3d290ef --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachinesV3OperationsClientImpl.java @@ -0,0 +1,510 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedSqlMachinesV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlMachineV3Inner; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachineV3ListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AssessedSqlMachinesV3OperationsClient. + */ +public final class AssessedSqlMachinesV3OperationsClientImpl implements AssessedSqlMachinesV3OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AssessedSqlMachinesV3OperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of AssessedSqlMachinesV3OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AssessedSqlMachinesV3OperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(AssessedSqlMachinesV3OperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientAssessedSqlMachinesV3Operations to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface AssessedSqlMachinesV3OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessments/{assessmentName}/assessedSqlMachines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessments/{assessmentName}/assessedSqlMachines/{assessedSqlMachineName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, + @PathParam("assessedSqlMachineName") String assessedSqlMachineName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AssessedSqlMachineV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlMachineV3 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 AssessedSqlMachineV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlMachineV3 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 AssessedSqlMachineV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlMachineV3 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 AssessedSqlMachineV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlMachineV3 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 AssessedSqlMachineV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlMachineV3 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 AssessedSqlMachineV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlMachineV3 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 AssessedSqlMachineV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlMachineV3 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 a AssessedSqlMachineV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachineV3 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, String assessedSqlMachineName) { + 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 (assessedSqlMachineName == null) { + return Mono.error( + new IllegalArgumentException("Parameter assessedSqlMachineName 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, assessedSqlMachineName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a AssessedSqlMachineV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachineV3 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, String assessedSqlMachineName, 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 (assessedSqlMachineName == null) { + return Mono.error( + new IllegalArgumentException("Parameter assessedSqlMachineName 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, assessedSqlMachineName, accept, context); + } + + /** + * Get a AssessedSqlMachineV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachineV3 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, + String assessmentName, String assessedSqlMachineName) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, assessedSqlMachineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a AssessedSqlMachineV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachineV3 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedSqlMachineName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, assessedSqlMachineName, context) + .block(); + } + + /** + * Get a AssessedSqlMachineV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachineV3. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssessedSqlMachineV3Inner get(String resourceGroupName, String projectName, String assessmentName, + String assessedSqlMachineName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, assessedSqlMachineName, Context.NONE) + .getValue(); + } + + /** + * 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 AssessedSqlMachineV3 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 AssessedSqlMachineV3 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachinesV3OperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachinesV3OperationsImpl.java new file mode 100644 index 000000000000..a47602261c1f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlMachinesV3OperationsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedSqlMachinesV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlMachineV3Inner; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachineV3; +import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachinesV3Operations; + +public final class AssessedSqlMachinesV3OperationsImpl implements AssessedSqlMachinesV3Operations { + private static final ClientLogger LOGGER = new ClientLogger(AssessedSqlMachinesV3OperationsImpl.class); + + private final AssessedSqlMachinesV3OperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public AssessedSqlMachinesV3OperationsImpl(AssessedSqlMachinesV3OperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessedSqlMachineV3Impl(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 AssessedSqlMachineV3Impl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedSqlMachineName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, assessmentName, assessedSqlMachineName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AssessedSqlMachineV3Impl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AssessedSqlMachineV3 get(String resourceGroupName, String projectName, String assessmentName, + String assessedSqlMachineName) { + AssessedSqlMachineV3Inner inner + = this.serviceClient().get(resourceGroupName, projectName, assessmentName, assessedSqlMachineName); + if (inner != null) { + return new AssessedSqlMachineV3Impl(inner, this.manager()); + } else { + return null; + } + } + + private AssessedSqlMachinesV3OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlRecommendedEntityImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlRecommendedEntityImpl.java deleted file mode 100644 index fd9a2821c92c..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlRecommendedEntityImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlRecommendedEntityInner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlRecommendedEntity; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlRecommendedEntityProperties; - -public final class AssessedSqlRecommendedEntityImpl implements AssessedSqlRecommendedEntity { - private AssessedSqlRecommendedEntityInner innerObject; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - AssessedSqlRecommendedEntityImpl(AssessedSqlRecommendedEntityInner innerObject, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AssessedSqlRecommendedEntityProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public AssessedSqlRecommendedEntityInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlRecommendedEntityOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlRecommendedEntityOperationsClientImpl.java deleted file mode 100644 index 8b3126eaf54f..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlRecommendedEntityOperationsClientImpl.java +++ /dev/null @@ -1,552 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedSqlRecommendedEntityOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlRecommendedEntityInner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlRecommendedEntityListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * AssessedSqlRecommendedEntityOperationsClient. - */ -public final class AssessedSqlRecommendedEntityOperationsClientImpl - implements AssessedSqlRecommendedEntityOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AssessedSqlRecommendedEntityOperationsService service; - - /** - * The service client containing this operation class. - */ - private final MigrationAssessmentManagementClientImpl client; - - /** - * Initializes an instance of AssessedSqlRecommendedEntityOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AssessedSqlRecommendedEntityOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { - this.service = RestProxy.create(AssessedSqlRecommendedEntityOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for - * MigrationAssessmentManagementClientAssessedSqlRecommendedEntityOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MigrationAssessmentM") - public interface AssessedSqlRecommendedEntityOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/recommendedAssessedEntities") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySqlAssessmentV2( - @HostParam("$host") 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("groupName") String groupName, @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}/groups/{groupName}/sqlAssessments/{assessmentName}/recommendedAssessedEntities/{recommendedAssessedEntityName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @PathParam("recommendedAssessedEntityName") String recommendedAssessedEntityName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySqlAssessmentV2Next( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List AssessedSqlRecommendedEntity resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlRecommendedEntity list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2SinglePageAsync( - String resourceGroupName, String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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.listBySqlAssessmentV2(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, - continuationToken, totalRecordCount, projectName, groupName, 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 AssessedSqlRecommendedEntity resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlRecommendedEntity list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2SinglePageAsync( - String resourceGroupName, String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 - .listBySqlAssessmentV2(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, continuationToken, - totalRecordCount, projectName, groupName, assessmentName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List AssessedSqlRecommendedEntity resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlRecommendedEntity list operation as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySqlAssessmentV2Async(String resourceGroupName, - String projectName, String groupName, String assessmentName, String filter, Integer pageSize, - String continuationToken, Integer totalRecordCount) { - return new PagedFlux<>( - () -> listBySqlAssessmentV2SinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount), - nextLink -> listBySqlAssessmentV2NextSinglePageAsync(nextLink)); - } - - /** - * List AssessedSqlRecommendedEntity resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlRecommendedEntity list operation as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySqlAssessmentV2Async(String resourceGroupName, - String projectName, String groupName, String assessmentName) { - final String filter = null; - final Integer pageSize = null; - final String continuationToken = null; - final Integer totalRecordCount = null; - return new PagedFlux<>( - () -> listBySqlAssessmentV2SinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount), - nextLink -> listBySqlAssessmentV2NextSinglePageAsync(nextLink)); - } - - /** - * List AssessedSqlRecommendedEntity resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlRecommendedEntity list operation as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySqlAssessmentV2Async(String resourceGroupName, - String projectName, String groupName, String assessmentName, String filter, Integer pageSize, - String continuationToken, Integer totalRecordCount, Context context) { - return new PagedFlux<>( - () -> listBySqlAssessmentV2SinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount, context), - nextLink -> listBySqlAssessmentV2NextSinglePageAsync(nextLink, context)); - } - - /** - * List AssessedSqlRecommendedEntity resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlRecommendedEntity list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, - String projectName, String groupName, String assessmentName) { - final String filter = null; - final Integer pageSize = null; - final String continuationToken = null; - final Integer totalRecordCount = null; - return new PagedIterable<>(listBySqlAssessmentV2Async(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount)); - } - - /** - * List AssessedSqlRecommendedEntity resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlRecommendedEntity list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, - String projectName, String groupName, String assessmentName, String filter, Integer pageSize, - String continuationToken, Integer totalRecordCount, Context context) { - return new PagedIterable<>(listBySqlAssessmentV2Async(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount, context)); - } - - /** - * Get a AssessedSqlRecommendedEntity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param recommendedAssessedEntityName Sql assessment Assessed Recommended Entity 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 AssessedSqlRecommendedEntity along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String projectName, String groupName, String assessmentName, String recommendedAssessedEntityName) { - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (recommendedAssessedEntityName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter recommendedAssessedEntityName 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, groupName, assessmentName, - recommendedAssessedEntityName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a AssessedSqlRecommendedEntity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param recommendedAssessedEntityName Sql assessment Assessed Recommended Entity 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 AssessedSqlRecommendedEntity along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String projectName, String groupName, String assessmentName, String recommendedAssessedEntityName, - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (recommendedAssessedEntityName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter recommendedAssessedEntityName 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, groupName, assessmentName, recommendedAssessedEntityName, accept, context); - } - - /** - * Get a AssessedSqlRecommendedEntity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param recommendedAssessedEntityName Sql assessment Assessed Recommended Entity 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 AssessedSqlRecommendedEntity on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName, String recommendedAssessedEntityName) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, - recommendedAssessedEntityName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a AssessedSqlRecommendedEntity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param recommendedAssessedEntityName Sql assessment Assessed Recommended Entity 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 AssessedSqlRecommendedEntity along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String projectName, - String groupName, String assessmentName, String recommendedAssessedEntityName, Context context) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, - recommendedAssessedEntityName, context).block(); - } - - /** - * Get a AssessedSqlRecommendedEntity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param recommendedAssessedEntityName Sql assessment Assessed Recommended Entity 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 AssessedSqlRecommendedEntity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AssessedSqlRecommendedEntityInner get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String recommendedAssessedEntityName) { - return getWithResponse(resourceGroupName, projectName, groupName, assessmentName, recommendedAssessedEntityName, - Context.NONE).getValue(); - } - - /** - * 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 AssessedSqlRecommendedEntity list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySqlAssessmentV2NextSinglePageAsync(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.listBySqlAssessmentV2Next(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 AssessedSqlRecommendedEntity list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySqlAssessmentV2NextSinglePageAsync(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.listBySqlAssessmentV2Next(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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlRecommendedEntityOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlRecommendedEntityOperationsImpl.java deleted file mode 100644 index e29602665240..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedSqlRecommendedEntityOperationsImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedSqlRecommendedEntityOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlRecommendedEntityInner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlRecommendedEntity; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlRecommendedEntityOperations; - -public final class AssessedSqlRecommendedEntityOperationsImpl implements AssessedSqlRecommendedEntityOperations { - private static final ClientLogger LOGGER = new ClientLogger(AssessedSqlRecommendedEntityOperationsImpl.class); - - private final AssessedSqlRecommendedEntityOperationsClient innerClient; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - public AssessedSqlRecommendedEntityOperationsImpl(AssessedSqlRecommendedEntityOperationsClient innerClient, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, - String projectName, String groupName, String assessmentName) { - PagedIterable inner - = this.serviceClient().listBySqlAssessmentV2(resourceGroupName, projectName, groupName, assessmentName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new AssessedSqlRecommendedEntityImpl(inner1, this.manager())); - } - - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, - String projectName, String groupName, String assessmentName, String filter, Integer pageSize, - String continuationToken, Integer totalRecordCount, Context context) { - PagedIterable inner = this.serviceClient() - .listBySqlAssessmentV2(resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, - continuationToken, totalRecordCount, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new AssessedSqlRecommendedEntityImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String projectName, - String groupName, String assessmentName, String recommendedAssessedEntityName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, projectName, groupName, assessmentName, recommendedAssessedEntityName, - context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AssessedSqlRecommendedEntityImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AssessedSqlRecommendedEntity get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String recommendedAssessedEntityName) { - AssessedSqlRecommendedEntityInner inner = this.serviceClient() - .get(resourceGroupName, projectName, groupName, assessmentName, recommendedAssessedEntityName); - if (inner != null) { - return new AssessedSqlRecommendedEntityImpl(inner, this.manager()); - } else { - return null; - } - } - - private AssessedSqlRecommendedEntityOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebAppV3Impl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebAppV3Impl.java new file mode 100644 index 000000000000..38ff5213e56f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebAppV3Impl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedWebAppV3Inner; +import com.azure.resourcemanager.migration.assessment.models.AssessedWebAppV3; +import com.azure.resourcemanager.migration.assessment.models.AssessedWebAppV3Properties; + +public final class AssessedWebAppV3Impl implements AssessedWebAppV3 { + private AssessedWebAppV3Inner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AssessedWebAppV3Impl(AssessedWebAppV3Inner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AssessedWebAppV3Properties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AssessedWebAppV3Inner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebApplicationImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebApplicationImpl.java new file mode 100644 index 000000000000..2c3d4e274819 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebApplicationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedWebApplicationInner; +import com.azure.resourcemanager.migration.assessment.models.AssessedWebApplication; +import com.azure.resourcemanager.migration.assessment.models.AssessedWebApplicationProperties; + +public final class AssessedWebApplicationImpl implements AssessedWebApplication { + private AssessedWebApplicationInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AssessedWebApplicationImpl(AssessedWebApplicationInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AssessedWebApplicationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AssessedWebApplicationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebApplicationOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebApplicationOperationsClientImpl.java new file mode 100644 index 000000000000..e0fb583d330f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebApplicationOperationsClientImpl.java @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedWebApplicationOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedWebApplicationInner; +import com.azure.resourcemanager.migration.assessment.models.AssessedWebApplicationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AssessedWebApplicationOperationsClient. + */ +public final class AssessedWebApplicationOperationsClientImpl implements AssessedWebApplicationOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AssessedWebApplicationOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of AssessedWebApplicationOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AssessedWebApplicationOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(AssessedWebApplicationOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientAssessedWebApplicationOperations + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface AssessedWebApplicationOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/aksAssessments/{assessmentName}/assessedWebApps") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/aksAssessments/{assessmentName}/assessedWebApps/{assessedWorkload}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, @PathParam("assessedWorkload") String assessedWorkload, + @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AssessedWebApplication resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AssessedWebApplication 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 AssessedWebApplication resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AssessedWebApplication 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 AssessedWebApplication resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AssessedWebApplication 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 AssessedWebApplication resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AssessedWebApplication 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 AssessedWebApplication resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AssessedWebApplication 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 AssessedWebApplication resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AssessedWebApplication 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 a AssessedWebApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param assessedWorkload Assessed Web Application 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 AssessedWebApplication along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String projectName, String assessmentName, String assessedWorkload) { + 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 (assessedWorkload == null) { + return Mono + .error(new IllegalArgumentException("Parameter assessedWorkload 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, assessedWorkload, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a AssessedWebApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param assessedWorkload Assessed Web Application 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 AssessedWebApplication along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String projectName, String assessmentName, String assessedWorkload, 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 (assessedWorkload == null) { + return Mono + .error(new IllegalArgumentException("Parameter assessedWorkload 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, assessedWorkload, accept, context); + } + + /** + * Get a AssessedWebApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param assessedWorkload Assessed Web Application 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 AssessedWebApplication on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, + String assessmentName, String assessedWorkload) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, assessedWorkload) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a AssessedWebApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param assessedWorkload Assessed Web Application 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 AssessedWebApplication along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedWorkload, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, assessedWorkload, context).block(); + } + + /** + * Get a AssessedWebApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param assessedWorkload Assessed Web Application 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 AssessedWebApplication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssessedWebApplicationInner get(String resourceGroupName, String projectName, String assessmentName, + String assessedWorkload) { + return getWithResponse(resourceGroupName, projectName, assessmentName, assessedWorkload, Context.NONE) + .getValue(); + } + + /** + * 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 AssessedWebApplication 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 AssessedWebApplication 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebApplicationOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebApplicationOperationsImpl.java new file mode 100644 index 000000000000..65efe1241f6d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebApplicationOperationsImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedWebApplicationOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedWebApplicationInner; +import com.azure.resourcemanager.migration.assessment.models.AssessedWebApplication; +import com.azure.resourcemanager.migration.assessment.models.AssessedWebApplicationOperations; + +public final class AssessedWebApplicationOperationsImpl implements AssessedWebApplicationOperations { + private static final ClientLogger LOGGER = new ClientLogger(AssessedWebApplicationOperationsImpl.class); + + private final AssessedWebApplicationOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public AssessedWebApplicationOperationsImpl(AssessedWebApplicationOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessedWebApplicationImpl(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 AssessedWebApplicationImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedWorkload, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, assessmentName, assessedWorkload, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AssessedWebApplicationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AssessedWebApplication get(String resourceGroupName, String projectName, String assessmentName, + String assessedWorkload) { + AssessedWebApplicationInner inner + = this.serviceClient().get(resourceGroupName, projectName, assessmentName, assessedWorkload); + if (inner != null) { + return new AssessedWebApplicationImpl(inner, this.manager()); + } else { + return null; + } + } + + private AssessedWebApplicationOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebAppsV3OperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebAppsV3OperationsClientImpl.java new file mode 100644 index 000000000000..33d2cf7014c9 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebAppsV3OperationsClientImpl.java @@ -0,0 +1,453 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedWebAppsV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedWebAppV3Inner; +import com.azure.resourcemanager.migration.assessment.models.AssessedWebAppV3ListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AssessedWebAppsV3OperationsClient. + */ +public final class AssessedWebAppsV3OperationsClientImpl implements AssessedWebAppsV3OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AssessedWebAppsV3OperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of AssessedWebAppsV3OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AssessedWebAppsV3OperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(AssessedWebAppsV3OperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientAssessedWebAppsV3Operations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface AssessedWebAppsV3OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppAssessments/{assessmentName}/assessedWebApps") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/webAppAssessments/{assessmentName}/assessedWebApps/{assessedWebAppName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, + @PathParam("assessedWebAppName") String assessedWebAppName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AssessedWebAppV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 AssessedWebAppV3 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 AssessedWebAppV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 AssessedWebAppV3 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 AssessedWebAppV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 AssessedWebAppV3 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 AssessedWebAppV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 AssessedWebAppV3 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 AssessedWebAppV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 AssessedWebAppV3 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 AssessedWebAppV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 AssessedWebAppV3 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 a AssessedWebAppV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param assessedWebAppName Assessed web app 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 AssessedWebAppV3 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, String assessedWebAppName) { + 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 (assessedWebAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter assessedWebAppName 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, assessedWebAppName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a AssessedWebAppV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param assessedWebAppName Assessed web app 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 AssessedWebAppV3 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, String assessedWebAppName, 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 (assessedWebAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter assessedWebAppName 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, assessedWebAppName, accept, context); + } + + /** + * Get a AssessedWebAppV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param assessedWebAppName Assessed web app 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 AssessedWebAppV3 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, String assessmentName, + String assessedWebAppName) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, assessedWebAppName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a AssessedWebAppV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param assessedWebAppName Assessed web app 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 AssessedWebAppV3 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedWebAppName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, assessedWebAppName, context) + .block(); + } + + /** + * Get a AssessedWebAppV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param assessedWebAppName Assessed web app 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 AssessedWebAppV3. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssessedWebAppV3Inner get(String resourceGroupName, String projectName, String assessmentName, + String assessedWebAppName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, assessedWebAppName, Context.NONE) + .getValue(); + } + + /** + * 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 AssessedWebAppV3 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 AssessedWebAppV3 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebAppsV3OperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebAppsV3OperationsImpl.java new file mode 100644 index 000000000000..ec60103c4598 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessedWebAppsV3OperationsImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessedWebAppsV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedWebAppV3Inner; +import com.azure.resourcemanager.migration.assessment.models.AssessedWebAppV3; +import com.azure.resourcemanager.migration.assessment.models.AssessedWebAppsV3Operations; + +public final class AssessedWebAppsV3OperationsImpl implements AssessedWebAppsV3Operations { + private static final ClientLogger LOGGER = new ClientLogger(AssessedWebAppsV3OperationsImpl.class); + + private final AssessedWebAppsV3OperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public AssessedWebAppsV3OperationsImpl(AssessedWebAppsV3OperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessedWebAppV3Impl(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 AssessedWebAppV3Impl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedWebAppName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, assessmentName, assessedWebAppName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AssessedWebAppV3Impl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AssessedWebAppV3 get(String resourceGroupName, String projectName, String assessmentName, + String assessedWebAppName) { + AssessedWebAppV3Inner inner + = this.serviceClient().get(resourceGroupName, projectName, assessmentName, assessedWebAppName); + if (inner != null) { + return new AssessedWebAppV3Impl(inner, this.manager()); + } else { + return null; + } + } + + private AssessedWebAppsV3OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentImpl.java deleted file mode 100644 index defecb496ac0..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessmentInner; -import com.azure.resourcemanager.migration.assessment.models.Assessment; -import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; -import com.azure.resourcemanager.migration.assessment.models.MachineAssessmentProperties; - -public final class AssessmentImpl implements Assessment, Assessment.Definition { - private AssessmentInner innerObject; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - AssessmentImpl(AssessmentInner innerObject, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 MachineAssessmentProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public AssessmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String projectName; - - private String groupName; - - private String assessmentName; - - public AssessmentImpl withExistingGroup(String resourceGroupName, String projectName, String groupName) { - this.resourceGroupName = resourceGroupName; - this.projectName = projectName; - this.groupName = groupName; - return this; - } - - public Assessment create() { - this.innerObject = serviceManager.serviceClient() - .getAssessmentsOperations() - .create(resourceGroupName, projectName, groupName, assessmentName, this.innerModel(), Context.NONE); - return this; - } - - public Assessment create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAssessmentsOperations() - .create(resourceGroupName, projectName, groupName, assessmentName, this.innerModel(), context); - return this; - } - - AssessmentImpl(String name, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerObject = new AssessmentInner(); - this.serviceManager = serviceManager; - this.assessmentName = name; - } - - public Assessment refresh() { - this.innerObject = serviceManager.serviceClient() - .getAssessmentsOperations() - .getWithResponse(resourceGroupName, projectName, groupName, assessmentName, Context.NONE) - .getValue(); - return this; - } - - public Assessment refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAssessmentsOperations() - .getWithResponse(resourceGroupName, projectName, groupName, assessmentName, context) - .getValue(); - return this; - } - - public DownloadUrl downloadUrl(Object body) { - return serviceManager.assessmentsOperations() - .downloadUrl(resourceGroupName, projectName, groupName, assessmentName, body); - } - - public DownloadUrl downloadUrl(Object body, Context context) { - return serviceManager.assessmentsOperations() - .downloadUrl(resourceGroupName, projectName, groupName, assessmentName, body, context); - } - - public AssessmentImpl withProperties(MachineAssessmentProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentOptionsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentOptionsImpl.java deleted file mode 100644 index 26bf0205990a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentOptionsImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessmentOptionsInner; -import com.azure.resourcemanager.migration.assessment.models.AssessmentOptions; -import com.azure.resourcemanager.migration.assessment.models.AssessmentOptionsProperties; - -public final class AssessmentOptionsImpl implements AssessmentOptions { - private AssessmentOptionsInner innerObject; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - AssessmentOptionsImpl(AssessmentOptionsInner innerObject, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AssessmentOptionsProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public AssessmentOptionsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentOptionsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentOptionsOperationsClientImpl.java deleted file mode 100644 index 215d34b565d1..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentOptionsOperationsClientImpl.java +++ /dev/null @@ -1,424 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessmentOptionsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessmentOptionsInner; -import com.azure.resourcemanager.migration.assessment.models.AssessmentOptionsListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AssessmentOptionsOperationsClient. - */ -public final class AssessmentOptionsOperationsClientImpl implements AssessmentOptionsOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AssessmentOptionsOperationsService service; - - /** - * The service client containing this operation class. - */ - private final MigrationAssessmentManagementClientImpl client; - - /** - * Initializes an instance of AssessmentOptionsOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AssessmentOptionsOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { - this.service = RestProxy.create(AssessmentOptionsOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MigrationAssessmentManagementClientAssessmentOptionsOperations to be - * used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MigrationAssessmentM") - public interface AssessmentOptionsOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProject(@HostParam("$host") 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/{assessmentOptionsName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("assessmentOptionsName") String assessmentOptionsName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProjectNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List AssessmentOptions 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 AssessmentOptions list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(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.listByAssessmentProject(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 AssessmentOptions 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 AssessmentOptions list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(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 - .listByAssessmentProject(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 AssessmentOptions 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 AssessmentOptions list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, - String projectName) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink)); - } - - /** - * List AssessmentOptions 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 AssessmentOptions list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName, - Context context) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName, context), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink, context)); - } - - /** - * List AssessmentOptions 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 AssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName)); - } - - /** - * List AssessmentOptions 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 AssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName, context)); - } - - /** - * Get a AssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName assessment options ARM name. Accepted value is 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a AssessmentOptions along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String assessmentOptionsName) { - 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 (assessmentOptionsName == null) { - return Mono - .error(new IllegalArgumentException("Parameter assessmentOptionsName 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, assessmentOptionsName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a AssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName assessment options ARM name. Accepted value is 'default'. - * @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 AssessmentOptions along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String assessmentOptionsName, 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 (assessmentOptionsName == null) { - return Mono - .error(new IllegalArgumentException("Parameter assessmentOptionsName 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, assessmentOptionsName, accept, context); - } - - /** - * Get a AssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName assessment options ARM name. Accepted value is 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a AssessmentOptions on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String projectName, - String assessmentOptionsName) { - return getWithResponseAsync(resourceGroupName, projectName, assessmentOptionsName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a AssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName assessment options ARM name. Accepted value is 'default'. - * @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 AssessmentOptions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String projectName, - String assessmentOptionsName, Context context) { - return getWithResponseAsync(resourceGroupName, projectName, assessmentOptionsName, context).block(); - } - - /** - * Get a AssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName assessment options ARM name. Accepted value is 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a AssessmentOptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AssessmentOptionsInner get(String resourceGroupName, String projectName, String assessmentOptionsName) { - return getWithResponse(resourceGroupName, projectName, assessmentOptionsName, Context.NONE).getValue(); - } - - /** - * 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 AssessmentOptions list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(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.listByAssessmentProjectNext(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 AssessmentOptions list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(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.listByAssessmentProjectNext(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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentOptionsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentOptionsOperationsImpl.java deleted file mode 100644 index 65b062939663..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentOptionsOperationsImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessmentOptionsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessmentOptionsInner; -import com.azure.resourcemanager.migration.assessment.models.AssessmentOptions; -import com.azure.resourcemanager.migration.assessment.models.AssessmentOptionsOperations; - -public final class AssessmentOptionsOperationsImpl implements AssessmentOptionsOperations { - private static final ClientLogger LOGGER = new ClientLogger(AssessmentOptionsOperationsImpl.class); - - private final AssessmentOptionsOperationsClient innerClient; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - public AssessmentOptionsOperationsImpl(AssessmentOptionsOperationsClient innerClient, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessmentOptionsImpl(inner1, this.manager())); - } - - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context) { - PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessmentOptionsImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String projectName, - String assessmentOptionsName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, projectName, assessmentOptionsName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AssessmentOptionsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AssessmentOptions get(String resourceGroupName, String projectName, String assessmentOptionsName) { - AssessmentOptionsInner inner = this.serviceClient().get(resourceGroupName, projectName, assessmentOptionsName); - if (inner != null) { - return new AssessmentOptionsImpl(inner, this.manager()); - } else { - return null; - } - } - - private AssessmentOptionsOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectImpl.java index a799360049d1..24b1a560e2bf 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectImpl.java @@ -10,7 +10,6 @@ import com.azure.resourcemanager.migration.assessment.fluent.models.AssessmentProjectInner; import com.azure.resourcemanager.migration.assessment.models.AssessmentProject; import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectUpdate; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectUpdateProperties; import com.azure.resourcemanager.migration.assessment.models.ProjectProperties; import java.util.Collections; import java.util.Map; @@ -170,13 +169,13 @@ public AssessmentProjectImpl withTags(Map tags) { } public AssessmentProjectImpl withProperties(ProjectProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - - public AssessmentProjectImpl withProperties(AssessmentProjectUpdateProperties properties) { - this.updateProperties.withProperties(properties); - return this; + if (isInCreateMode()) { + this.innerModel().withProperties(properties); + return this; + } else { + this.updateProperties.withProperties(properties); + return this; + } } private boolean isInCreateMode() { diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectSummaryOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectSummaryOperationsClientImpl.java index f3ede7a19730..8e13a7502c00 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectSummaryOperationsClientImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectSummaryOperationsClientImpl.java @@ -66,7 +66,7 @@ public interface AssessmentProjectSummaryOperationsService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/projectSummary") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProject(@HostParam("$host") String endpoint, + Mono> listByParent(@HostParam("$host") 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); @@ -85,7 +85,7 @@ Mono> get(@HostParam("$host") String end @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProjectNext( + Mono> listByParentNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -102,8 +102,8 @@ Mono> listByAssessmentProjectNext( * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAssessmentProjectSinglePageAsync(String resourceGroupName, String projectName) { + 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.")); @@ -121,9 +121,8 @@ Mono> listByAssessmentProjectNext( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context)) + .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())); @@ -142,8 +141,8 @@ Mono> listByAssessmentProjectNext( * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAssessmentProjectSinglePageAsync(String resourceGroupName, String projectName, Context context) { + 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.")); @@ -162,8 +161,8 @@ Mono> listByAssessmentProjectNext( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context) + .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)); } @@ -179,10 +178,9 @@ Mono> listByAssessmentProjectNext( * @return the response of a AssessmentProjectSummary list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, - String projectName) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink)); + private PagedFlux listByParentAsync(String resourceGroupName, String projectName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); } /** @@ -197,10 +195,10 @@ private PagedFlux listByAssessmentProjectAsync(St * @return the response of a AssessmentProjectSummary list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, - String projectName, Context context) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName, context), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink, context)); + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + Context context) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); } /** @@ -215,9 +213,8 @@ private PagedFlux listByAssessmentProjectAsync(St * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, - String projectName) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName)); + public PagedIterable listByParent(String resourceGroupName, String projectName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName)); } /** @@ -233,9 +230,9 @@ public PagedIterable listByAssessmentProject(Stri * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, - String projectName, Context context) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName, context)); + public PagedIterable listByParent(String resourceGroupName, String projectName, + Context context) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, context)); } /** @@ -243,7 +240,7 @@ public PagedIterable listByAssessmentProject(Stri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param projectName Assessment Project Name. - * @param projectSummaryName Group ARM name. + * @param projectSummaryName Assessment project summary resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -283,7 +280,7 @@ private Mono> getWithResponseAsync(Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param projectName Assessment Project Name. - * @param projectSummaryName Group ARM name. + * @param projectSummaryName Assessment project summary resource. * @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. @@ -323,7 +320,7 @@ private Mono> getWithResponseAsync(Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param projectName Assessment Project Name. - * @param projectSummaryName Group ARM name. + * @param projectSummaryName Assessment project summary resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -341,7 +338,7 @@ private Mono getAsync(String resourceGroupName, S * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param projectName Assessment Project Name. - * @param projectSummaryName Group ARM name. + * @param projectSummaryName Assessment project summary resource. * @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. @@ -359,7 +356,7 @@ public Response getWithResponse(String resourceGr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param projectName Assessment Project Name. - * @param projectSummaryName Group ARM name. + * @param projectSummaryName Assessment project summary resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -381,8 +378,7 @@ public AssessmentProjectSummaryInner get(String resourceGroupName, String projec * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAssessmentProjectNextSinglePageAsync(String nextLink) { + private Mono> listByParentNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -392,8 +388,7 @@ public AssessmentProjectSummaryInner get(String resourceGroupName, String projec } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, context)) + .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())); @@ -411,8 +406,8 @@ public AssessmentProjectSummaryInner get(String resourceGroupName, String projec * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAssessmentProjectNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByParentNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -422,7 +417,7 @@ public AssessmentProjectSummaryInner get(String resourceGroupName, String projec } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectSummaryOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectSummaryOperationsImpl.java index 9580bbc7f81b..09f34b3bfbd2 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectSummaryOperationsImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectSummaryOperationsImpl.java @@ -27,17 +27,16 @@ public AssessmentProjectSummaryOperationsImpl(AssessmentProjectSummaryOperations this.serviceManager = serviceManager; } - public PagedIterable listByAssessmentProject(String resourceGroupName, - String projectName) { + public PagedIterable listByParent(String resourceGroupName, String projectName) { PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName); + = this.serviceClient().listByParent(resourceGroupName, projectName); return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessmentProjectSummaryImpl(inner1, this.manager())); } - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, + public PagedIterable listByParent(String resourceGroupName, String projectName, Context context) { PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName, context); + = this.serviceClient().listByParent(resourceGroupName, projectName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessmentProjectSummaryImpl(inner1, this.manager())); } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectsOperationsClientImpl.java index 43664812a74d..aecc9d452aeb 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectsOperationsClientImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentProjectsOperationsClientImpl.java @@ -139,7 +139,7 @@ Mono> listBySubscriptionNext( @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listByParentNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -334,7 +334,7 @@ private Mono> listByResourceGroupSinglePag @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + nextLink -> listByParentNextSinglePageAsync(nextLink)); } /** @@ -350,7 +350,7 @@ private PagedFlux listByResourceGroupAsync(String resour @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); } /** @@ -1143,7 +1143,7 @@ private Mono> listBySubscriptionNextSingle * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listByParentNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1153,8 +1153,7 @@ private Mono> listByResourceGroupNextSingl } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .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())); @@ -1172,7 +1171,7 @@ private Mono> listByResourceGroupNextSingl * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + private Mono> listByParentNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1183,7 +1182,7 @@ private Mono> listByResourceGroupNextSingl } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentsOperationsClientImpl.java deleted file mode 100644 index 2c3a04d9f5cf..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentsOperationsClientImpl.java +++ /dev/null @@ -1,1177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessmentsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessmentInner; -import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; -import com.azure.resourcemanager.migration.assessment.models.AssessmentListResult; -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 AssessmentsOperationsClient. - */ -public final class AssessmentsOperationsClientImpl implements AssessmentsOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AssessmentsOperationsService service; - - /** - * The service client containing this operation class. - */ - private final MigrationAssessmentManagementClientImpl client; - - /** - * Initializes an instance of AssessmentsOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AssessmentsOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { - this.service = RestProxy.create(AssessmentsOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MigrationAssessmentManagementClientAssessmentsOperations to be used - * by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MigrationAssessmentM") - public interface AssessmentsOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByGroup(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @BodyParam("application/json") AssessmentInner resource, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/downloadUrl") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> downloadUrl(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @BodyParam("application/json") Object body, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List Assessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Assessment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGroupSinglePageAsync(String resourceGroupName, - String projectName, String groupName) { - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, 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 Assessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Assessment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGroupSinglePageAsync(String resourceGroupName, - String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, projectName, groupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List Assessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Assessment list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByGroupAsync(String resourceGroupName, String projectName, - String groupName) { - return new PagedFlux<>(() -> listByGroupSinglePageAsync(resourceGroupName, projectName, groupName), - nextLink -> listByGroupNextSinglePageAsync(nextLink)); - } - - /** - * List Assessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Assessment list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByGroupAsync(String resourceGroupName, String projectName, String groupName, - Context context) { - return new PagedFlux<>(() -> listByGroupSinglePageAsync(resourceGroupName, projectName, groupName, context), - nextLink -> listByGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List Assessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Assessment list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName) { - return new PagedIterable<>(listByGroupAsync(resourceGroupName, projectName, groupName)); - } - - /** - * List Assessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Assessment list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName, - Context context) { - return new PagedIterable<>(listByGroupAsync(resourceGroupName, projectName, groupName, context)); - } - - /** - * Get a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 Assessment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 Assessment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, accept, context); - } - - /** - * Get a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 Assessment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String projectName, String groupName, - String assessmentName) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 Assessment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, Context context) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, context).block(); - } - - /** - * Get a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 Assessment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AssessmentInner get(String resourceGroupName, String projectName, String groupName, String assessmentName) { - return getWithResponse(resourceGroupName, projectName, groupName, assessmentName, Context.NONE).getValue(); - } - - /** - * Create a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName, AssessmentInner 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, assessmentName, resource, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName, AssessmentInner 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, projectName, groupName, assessmentName, resource, accept, context); - } - - /** - * Create a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AssessmentInner> beginCreateAsync(String resourceGroupName, - String projectName, String groupName, String assessmentName, AssessmentInner resource) { - Mono>> mono - = createWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AssessmentInner.class, AssessmentInner.class, this.client.getContext()); - } - - /** - * Create a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AssessmentInner> beginCreateAsync(String resourceGroupName, - String projectName, String groupName, String assessmentName, AssessmentInner resource, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, resource, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AssessmentInner.class, AssessmentInner.class, context); - } - - /** - * Create a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AssessmentInner> beginCreate(String resourceGroupName, - String projectName, String groupName, String assessmentName, AssessmentInner resource) { - return this.beginCreateAsync(resourceGroupName, projectName, groupName, assessmentName, resource) - .getSyncPoller(); - } - - /** - * Create a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AssessmentInner> beginCreate(String resourceGroupName, - String projectName, String groupName, String assessmentName, AssessmentInner resource, Context context) { - return this.beginCreateAsync(resourceGroupName, projectName, groupName, assessmentName, resource, context) - .getSyncPoller(); - } - - /** - * Create a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String projectName, String groupName, - String assessmentName, AssessmentInner resource) { - return beginCreateAsync(resourceGroupName, projectName, groupName, assessmentName, resource).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String projectName, String groupName, - String assessmentName, AssessmentInner resource, Context context) { - return beginCreateAsync(resourceGroupName, projectName, groupName, assessmentName, resource, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AssessmentInner create(String resourceGroupName, String projectName, String groupName, String assessmentName, - AssessmentInner resource) { - return createAsync(resourceGroupName, projectName, groupName, assessmentName, resource).block(); - } - - /** - * Create a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AssessmentInner create(String resourceGroupName, String projectName, String groupName, String assessmentName, - AssessmentInner resource, Context context) { - return createAsync(resourceGroupName, projectName, groupName, assessmentName, resource, context).block(); - } - - /** - * Delete a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 groupName, - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 groupName, - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, accept, context); - } - - /** - * Delete a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 groupName, - String assessmentName) { - return deleteWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 groupName, - String assessmentName, Context context) { - return deleteWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, context).block(); - } - - /** - * Delete a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 groupName, String assessmentName) { - deleteWithResponse(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 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 groupName, String assessmentName, Object 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.downloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, assessmentName, body, - accept, 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 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 groupName, String assessmentName, Object 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.downloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, assessmentName, body, accept, - 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 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 groupName, String assessmentName, Object body) { - Mono>> mono - = downloadUrlWithResponseAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 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 groupName, String assessmentName, Object body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = downloadUrlWithResponseAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 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 groupName, String assessmentName, Object body) { - return this.beginDownloadUrlAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 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 groupName, String assessmentName, Object body, Context context) { - return this.beginDownloadUrlAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 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 groupName, - String assessmentName, Object body) { - return beginDownloadUrlAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 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 groupName, - String assessmentName, Object body, Context context) { - return beginDownloadUrlAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String groupName, - String assessmentName, Object body) { - return downloadUrlAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String groupName, - String assessmentName, Object body, Context context) { - return downloadUrlAsync(resourceGroupName, projectName, groupName, 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 Assessment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGroupNextSinglePageAsync(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.listByGroupNext(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 Assessment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGroupNextSinglePageAsync(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.listByGroupNext(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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentsOperationsImpl.java deleted file mode 100644 index 0cd9f8d900a6..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AssessmentsOperationsImpl.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AssessmentsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessmentInner; -import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; -import com.azure.resourcemanager.migration.assessment.models.Assessment; -import com.azure.resourcemanager.migration.assessment.models.AssessmentsOperations; -import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; - -public final class AssessmentsOperationsImpl implements AssessmentsOperations { - private static final ClientLogger LOGGER = new ClientLogger(AssessmentsOperationsImpl.class); - - private final AssessmentsOperationsClient innerClient; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - public AssessmentsOperationsImpl(AssessmentsOperationsClient innerClient, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName) { - PagedIterable inner - = this.serviceClient().listByGroup(resourceGroupName, projectName, groupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessmentImpl(inner1, this.manager())); - } - - public PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName, - Context context) { - PagedIterable inner - = this.serviceClient().listByGroup(resourceGroupName, projectName, groupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessmentImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, projectName, groupName, assessmentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AssessmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Assessment get(String resourceGroupName, String projectName, String groupName, String assessmentName) { - AssessmentInner inner = this.serviceClient().get(resourceGroupName, projectName, groupName, assessmentName); - if (inner != null) { - return new AssessmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, Context context) { - return this.serviceClient() - .deleteWithResponse(resourceGroupName, projectName, groupName, assessmentName, context); - } - - public void delete(String resourceGroupName, String projectName, String groupName, String assessmentName) { - this.serviceClient().delete(resourceGroupName, projectName, groupName, assessmentName); - } - - public DownloadUrl downloadUrl(String resourceGroupName, String projectName, String groupName, - String assessmentName, Object body) { - DownloadUrlInner inner - = this.serviceClient().downloadUrl(resourceGroupName, projectName, groupName, assessmentName, body); - if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); - } else { - return null; - } - } - - public DownloadUrl downloadUrl(String resourceGroupName, String projectName, String groupName, - String assessmentName, Object body, Context context) { - DownloadUrlInner inner = this.serviceClient() - .downloadUrl(resourceGroupName, projectName, groupName, assessmentName, body, context); - if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); - } else { - return null; - } - } - - public Assessment 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", 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, groupName, 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", 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, groupName, 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", 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, groupName, 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", 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, groupName, assessmentName, context); - } - - private AssessmentsOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } - - public AssessmentImpl define(String name) { - return new AssessmentImpl(name, this.manager()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachineImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachineImpl.java deleted file mode 100644 index 2b08ddca045f..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachineImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessedMachineInner; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessedMachine; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessedMachineProperties; - -public final class AvsAssessedMachineImpl implements AvsAssessedMachine { - private AvsAssessedMachineInner innerObject; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - AvsAssessedMachineImpl(AvsAssessedMachineInner innerObject, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AvsAssessedMachineProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public AvsAssessedMachineInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachineV2Impl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachineV2Impl.java new file mode 100644 index 000000000000..e1fed32f980f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachineV2Impl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessedMachineV2Inner; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessedMachinePropertiesV2; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessedMachineV2; + +public final class AvsAssessedMachineV2Impl implements AvsAssessedMachineV2 { + private AvsAssessedMachineV2Inner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AvsAssessedMachineV2Impl(AvsAssessedMachineV2Inner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AvsAssessedMachinePropertiesV2 properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AvsAssessedMachineV2Inner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachinesOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachinesOperationsClientImpl.java deleted file mode 100644 index 0d1198782cc6..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachinesOperationsClientImpl.java +++ /dev/null @@ -1,541 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AvsAssessedMachinesOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessedMachineInner; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessedMachineListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AvsAssessedMachinesOperationsClient. - */ -public final class AvsAssessedMachinesOperationsClientImpl implements AvsAssessedMachinesOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AvsAssessedMachinesOperationsService service; - - /** - * The service client containing this operation class. - */ - private final MigrationAssessmentManagementClientImpl client; - - /** - * Initializes an instance of AvsAssessedMachinesOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AvsAssessedMachinesOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { - this.service = RestProxy.create(AvsAssessedMachinesOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MigrationAssessmentManagementClientAvsAssessedMachinesOperations to - * be used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MigrationAssessmentM") - public interface AvsAssessedMachinesOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/avsAssessedMachines") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAvsAssessment(@HostParam("$host") 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("groupName") String groupName, @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}/groups/{groupName}/avsAssessments/{assessmentName}/avsAssessedMachines/{avsAssessedMachineName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @PathParam("avsAssessedMachineName") String avsAssessedMachineName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAvsAssessmentNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List AvsAssessedMachine resources by AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessedMachine list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAvsAssessmentSinglePageAsync(String resourceGroupName, - String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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.listByAvsAssessment(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, continuationToken, - totalRecordCount, projectName, groupName, 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 AvsAssessedMachine resources by AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessedMachine list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAvsAssessmentSinglePageAsync(String resourceGroupName, - String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 - .listByAvsAssessment(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, continuationToken, - totalRecordCount, projectName, groupName, assessmentName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List AvsAssessedMachine resources by AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessedMachine list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAvsAssessmentAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount) { - return new PagedFlux<>( - () -> listByAvsAssessmentSinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, filter, - pageSize, continuationToken, totalRecordCount), - nextLink -> listByAvsAssessmentNextSinglePageAsync(nextLink)); - } - - /** - * List AvsAssessedMachine resources by AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessedMachine list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAvsAssessmentAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName) { - final String filter = null; - final Integer pageSize = null; - final String continuationToken = null; - final Integer totalRecordCount = null; - return new PagedFlux<>( - () -> listByAvsAssessmentSinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, filter, - pageSize, continuationToken, totalRecordCount), - nextLink -> listByAvsAssessmentNextSinglePageAsync(nextLink)); - } - - /** - * List AvsAssessedMachine resources by AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessedMachine list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAvsAssessmentAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context) { - return new PagedFlux<>( - () -> listByAvsAssessmentSinglePageAsync(resourceGroupName, projectName, groupName, assessmentName, filter, - pageSize, continuationToken, totalRecordCount, context), - nextLink -> listByAvsAssessmentNextSinglePageAsync(nextLink, context)); - } - - /** - * List AvsAssessedMachine resources by AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessedMachine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAvsAssessment(String resourceGroupName, String projectName, - String groupName, String assessmentName) { - final String filter = null; - final Integer pageSize = null; - final String continuationToken = null; - final Integer totalRecordCount = null; - return new PagedIterable<>(listByAvsAssessmentAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount)); - } - - /** - * List AvsAssessedMachine resources by AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessedMachine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAvsAssessment(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context) { - return new PagedIterable<>(listByAvsAssessmentAsync(resourceGroupName, projectName, groupName, assessmentName, - filter, pageSize, continuationToken, totalRecordCount, context)); - } - - /** - * Get a AvsAssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment ARM name. - * @param avsAssessedMachineName AVS assessment 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 AvsAssessedMachine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName, String avsAssessedMachineName) { - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (avsAssessedMachineName == null) { - return Mono.error( - new IllegalArgumentException("Parameter avsAssessedMachineName 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, groupName, assessmentName, - avsAssessedMachineName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a AvsAssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment ARM name. - * @param avsAssessedMachineName AVS assessment 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 AvsAssessedMachine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName, String avsAssessedMachineName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (avsAssessedMachineName == null) { - return Mono.error( - new IllegalArgumentException("Parameter avsAssessedMachineName 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, groupName, assessmentName, avsAssessedMachineName, accept, context); - } - - /** - * Get a AvsAssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment ARM name. - * @param avsAssessedMachineName AVS assessment 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 AvsAssessedMachine on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String projectName, String groupName, - String assessmentName, String avsAssessedMachineName) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, avsAssessedMachineName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a AvsAssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment ARM name. - * @param avsAssessedMachineName AVS assessment 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 AvsAssessedMachine along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String projectName, - String groupName, String assessmentName, String avsAssessedMachineName, Context context) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, avsAssessedMachineName, - context).block(); - } - - /** - * Get a AvsAssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment ARM name. - * @param avsAssessedMachineName AVS assessment 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 AvsAssessedMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvsAssessedMachineInner get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String avsAssessedMachineName) { - return getWithResponse(resourceGroupName, projectName, groupName, assessmentName, avsAssessedMachineName, - Context.NONE).getValue(); - } - - /** - * 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 AvsAssessedMachine list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAvsAssessmentNextSinglePageAsync(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.listByAvsAssessmentNext(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 AvsAssessedMachine list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAvsAssessmentNextSinglePageAsync(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.listByAvsAssessmentNext(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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachinesOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachinesOperationsImpl.java deleted file mode 100644 index 4132ced59d4a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachinesOperationsImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AvsAssessedMachinesOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessedMachineInner; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessedMachine; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessedMachinesOperations; - -public final class AvsAssessedMachinesOperationsImpl implements AvsAssessedMachinesOperations { - private static final ClientLogger LOGGER = new ClientLogger(AvsAssessedMachinesOperationsImpl.class); - - private final AvsAssessedMachinesOperationsClient innerClient; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - public AvsAssessedMachinesOperationsImpl(AvsAssessedMachinesOperationsClient innerClient, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByAvsAssessment(String resourceGroupName, String projectName, - String groupName, String assessmentName) { - PagedIterable inner - = this.serviceClient().listByAvsAssessment(resourceGroupName, projectName, groupName, assessmentName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AvsAssessedMachineImpl(inner1, this.manager())); - } - - public PagedIterable listByAvsAssessment(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context) { - PagedIterable inner = this.serviceClient() - .listByAvsAssessment(resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, - continuationToken, totalRecordCount, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AvsAssessedMachineImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, String avsAssessedMachineName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, projectName, groupName, assessmentName, avsAssessedMachineName, - context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AvsAssessedMachineImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AvsAssessedMachine get(String resourceGroupName, String projectName, String groupName, String assessmentName, - String avsAssessedMachineName) { - AvsAssessedMachineInner inner = this.serviceClient() - .get(resourceGroupName, projectName, groupName, assessmentName, avsAssessedMachineName); - if (inner != null) { - return new AvsAssessedMachineImpl(inner, this.manager()); - } else { - return null; - } - } - - private AvsAssessedMachinesOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachinesV2OperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachinesV2OperationsClientImpl.java new file mode 100644 index 000000000000..1de24e28c640 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachinesV2OperationsClientImpl.java @@ -0,0 +1,510 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AvsAssessedMachinesV2OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessedMachineV2Inner; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessedMachineV2ListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AvsAssessedMachinesV2OperationsClient. + */ +public final class AvsAssessedMachinesV2OperationsClientImpl implements AvsAssessedMachinesV2OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AvsAssessedMachinesV2OperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of AvsAssessedMachinesV2OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvsAssessedMachinesV2OperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(AvsAssessedMachinesV2OperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientAvsAssessedMachinesV2Operations to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface AvsAssessedMachinesV2OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessments/{assessmentName}/avsAssessedMachines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessments/{assessmentName}/avsAssessedMachines/{avsAssessedMachineName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, + @PathParam("avsAssessedMachineName") String avsAssessedMachineName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AvsAssessedMachineV2 resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessedMachineV2 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 AvsAssessedMachineV2 resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessedMachineV2 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 AvsAssessedMachineV2 resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessedMachineV2 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 AvsAssessedMachineV2 resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessedMachineV2 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 AvsAssessedMachineV2 resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessedMachineV2 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 AvsAssessedMachineV2 resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessedMachineV2 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 AvsAssessedMachineV2 resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessedMachineV2 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 a AvsAssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param avsAssessedMachineName AVS assessment Assessed Machine 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 AvsAssessedMachineV2 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, String avsAssessedMachineName) { + 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 (avsAssessedMachineName == null) { + return Mono.error( + new IllegalArgumentException("Parameter avsAssessedMachineName 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, avsAssessedMachineName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a AvsAssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param avsAssessedMachineName AVS assessment Assessed Machine 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 AvsAssessedMachineV2 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, String avsAssessedMachineName, 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 (avsAssessedMachineName == null) { + return Mono.error( + new IllegalArgumentException("Parameter avsAssessedMachineName 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, avsAssessedMachineName, accept, context); + } + + /** + * Get a AvsAssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param avsAssessedMachineName AVS assessment Assessed Machine 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 AvsAssessedMachineV2 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, + String assessmentName, String avsAssessedMachineName) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, avsAssessedMachineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a AvsAssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param avsAssessedMachineName AVS assessment Assessed Machine 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 AvsAssessedMachineV2 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String avsAssessedMachineName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, avsAssessedMachineName, context) + .block(); + } + + /** + * Get a AvsAssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param avsAssessedMachineName AVS assessment Assessed Machine 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 AvsAssessedMachineV2. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvsAssessedMachineV2Inner get(String resourceGroupName, String projectName, String assessmentName, + String avsAssessedMachineName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, avsAssessedMachineName, Context.NONE) + .getValue(); + } + + /** + * 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 AvsAssessedMachineV2 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 AvsAssessedMachineV2 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachinesV2OperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachinesV2OperationsImpl.java new file mode 100644 index 000000000000..a4922ad83d08 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessedMachinesV2OperationsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AvsAssessedMachinesV2OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessedMachineV2Inner; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessedMachineV2; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessedMachinesV2Operations; + +public final class AvsAssessedMachinesV2OperationsImpl implements AvsAssessedMachinesV2Operations { + private static final ClientLogger LOGGER = new ClientLogger(AvsAssessedMachinesV2OperationsImpl.class); + + private final AvsAssessedMachinesV2OperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public AvsAssessedMachinesV2OperationsImpl(AvsAssessedMachinesV2OperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvsAssessedMachineV2Impl(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 AvsAssessedMachineV2Impl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String avsAssessedMachineName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, assessmentName, avsAssessedMachineName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AvsAssessedMachineV2Impl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AvsAssessedMachineV2 get(String resourceGroupName, String projectName, String assessmentName, + String avsAssessedMachineName) { + AvsAssessedMachineV2Inner inner + = this.serviceClient().get(resourceGroupName, projectName, assessmentName, avsAssessedMachineName); + if (inner != null) { + return new AvsAssessedMachineV2Impl(inner, this.manager()); + } else { + return null; + } + } + + private AvsAssessedMachinesV2OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentImpl.java deleted file mode 100644 index e8ab52e4f9ad..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentInner; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessment; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentProperties; -import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; - -public final class AvsAssessmentImpl implements AvsAssessment, AvsAssessment.Definition { - private AvsAssessmentInner innerObject; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - AvsAssessmentImpl(AvsAssessmentInner innerObject, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AvsAssessmentProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public AvsAssessmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String projectName; - - private String groupName; - - private String assessmentName; - - public AvsAssessmentImpl withExistingGroup(String resourceGroupName, String projectName, String groupName) { - this.resourceGroupName = resourceGroupName; - this.projectName = projectName; - this.groupName = groupName; - return this; - } - - public AvsAssessment create() { - this.innerObject = serviceManager.serviceClient() - .getAvsAssessmentsOperations() - .create(resourceGroupName, projectName, groupName, assessmentName, this.innerModel(), Context.NONE); - return this; - } - - public AvsAssessment create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAvsAssessmentsOperations() - .create(resourceGroupName, projectName, groupName, assessmentName, this.innerModel(), context); - return this; - } - - AvsAssessmentImpl(String name, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerObject = new AvsAssessmentInner(); - this.serviceManager = serviceManager; - this.assessmentName = name; - } - - public AvsAssessment refresh() { - this.innerObject = serviceManager.serviceClient() - .getAvsAssessmentsOperations() - .getWithResponse(resourceGroupName, projectName, groupName, assessmentName, Context.NONE) - .getValue(); - return this; - } - - public AvsAssessment refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAvsAssessmentsOperations() - .getWithResponse(resourceGroupName, projectName, groupName, assessmentName, context) - .getValue(); - return this; - } - - public DownloadUrl downloadUrl(Object body) { - return serviceManager.avsAssessmentsOperations() - .downloadUrl(resourceGroupName, projectName, groupName, assessmentName, body); - } - - public DownloadUrl downloadUrl(Object body, Context context) { - return serviceManager.avsAssessmentsOperations() - .downloadUrl(resourceGroupName, projectName, groupName, assessmentName, body, context); - } - - public AvsAssessmentImpl withProperties(AvsAssessmentProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentOptionsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentOptionsImpl.java deleted file mode 100644 index 5e49b4d51a43..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentOptionsImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentOptionsInner; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentOptions; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentOptionsProperties; - -public final class AvsAssessmentOptionsImpl implements AvsAssessmentOptions { - private AvsAssessmentOptionsInner innerObject; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - AvsAssessmentOptionsImpl(AvsAssessmentOptionsInner innerObject, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AvsAssessmentOptionsProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public AvsAssessmentOptionsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentOptionsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentOptionsOperationsClientImpl.java deleted file mode 100644 index d2669de8699a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentOptionsOperationsClientImpl.java +++ /dev/null @@ -1,426 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AvsAssessmentOptionsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentOptionsInner; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentOptionsListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AvsAssessmentOptionsOperationsClient. - */ -public final class AvsAssessmentOptionsOperationsClientImpl implements AvsAssessmentOptionsOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AvsAssessmentOptionsOperationsService service; - - /** - * The service client containing this operation class. - */ - private final MigrationAssessmentManagementClientImpl client; - - /** - * Initializes an instance of AvsAssessmentOptionsOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AvsAssessmentOptionsOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { - this.service = RestProxy.create(AvsAssessmentOptionsOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MigrationAssessmentManagementClientAvsAssessmentOptionsOperations to - * be used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MigrationAssessmentM") - public interface AvsAssessmentOptionsOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessmentOptions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProject(@HostParam("$host") 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}/avsAssessmentOptions/{avsAssessmentOptionsName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("avsAssessmentOptionsName") String avsAssessmentOptionsName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProjectNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List AvsAssessmentOptions 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 AvsAssessmentOptions list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAssessmentProjectSinglePageAsync(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.listByAssessmentProject(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 AvsAssessmentOptions 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 AvsAssessmentOptions list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAssessmentProjectSinglePageAsync(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 - .listByAssessmentProject(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 AvsAssessmentOptions 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 AvsAssessmentOptions list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, - String projectName) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink)); - } - - /** - * List AvsAssessmentOptions 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 AvsAssessmentOptions list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, - String projectName, Context context) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName, context), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink, context)); - } - - /** - * List AvsAssessmentOptions 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 AvsAssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, - String projectName) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName)); - } - - /** - * List AvsAssessmentOptions 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 AvsAssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, - String projectName, Context context) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName, context)); - } - - /** - * Get a AvsAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param avsAssessmentOptionsName AVS Assessment options ARM name. Accepted value is 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a AvsAssessmentOptions along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String avsAssessmentOptionsName) { - 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 (avsAssessmentOptionsName == null) { - return Mono.error( - new IllegalArgumentException("Parameter avsAssessmentOptionsName 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, avsAssessmentOptionsName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a AvsAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param avsAssessmentOptionsName AVS Assessment options ARM name. Accepted value is 'default'. - * @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 AvsAssessmentOptions along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String avsAssessmentOptionsName, 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 (avsAssessmentOptionsName == null) { - return Mono.error( - new IllegalArgumentException("Parameter avsAssessmentOptionsName 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, avsAssessmentOptionsName, accept, context); - } - - /** - * Get a AvsAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param avsAssessmentOptionsName AVS Assessment options ARM name. Accepted value is 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a AvsAssessmentOptions on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String projectName, - String avsAssessmentOptionsName) { - return getWithResponseAsync(resourceGroupName, projectName, avsAssessmentOptionsName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a AvsAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param avsAssessmentOptionsName AVS Assessment options ARM name. Accepted value is 'default'. - * @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 AvsAssessmentOptions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String projectName, - String avsAssessmentOptionsName, Context context) { - return getWithResponseAsync(resourceGroupName, projectName, avsAssessmentOptionsName, context).block(); - } - - /** - * Get a AvsAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param avsAssessmentOptionsName AVS Assessment options ARM name. Accepted value is 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a AvsAssessmentOptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvsAssessmentOptionsInner get(String resourceGroupName, String projectName, - String avsAssessmentOptionsName) { - return getWithResponse(resourceGroupName, projectName, avsAssessmentOptionsName, Context.NONE).getValue(); - } - - /** - * 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 AvsAssessmentOptions list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(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.listByAssessmentProjectNext(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 AvsAssessmentOptions list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(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.listByAssessmentProjectNext(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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentOptionsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentOptionsOperationsImpl.java deleted file mode 100644 index e055c8b717e7..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentOptionsOperationsImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AvsAssessmentOptionsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentOptionsInner; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentOptions; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentOptionsOperations; - -public final class AvsAssessmentOptionsOperationsImpl implements AvsAssessmentOptionsOperations { - private static final ClientLogger LOGGER = new ClientLogger(AvsAssessmentOptionsOperationsImpl.class); - - private final AvsAssessmentOptionsOperationsClient innerClient; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - public AvsAssessmentOptionsOperationsImpl(AvsAssessmentOptionsOperationsClient innerClient, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AvsAssessmentOptionsImpl(inner1, this.manager())); - } - - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context) { - PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AvsAssessmentOptionsImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String projectName, - String avsAssessmentOptionsName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, projectName, avsAssessmentOptionsName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AvsAssessmentOptionsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AvsAssessmentOptions get(String resourceGroupName, String projectName, String avsAssessmentOptionsName) { - AvsAssessmentOptionsInner inner - = this.serviceClient().get(resourceGroupName, projectName, avsAssessmentOptionsName); - if (inner != null) { - return new AvsAssessmentOptionsImpl(inner, this.manager()); - } else { - return null; - } - } - - private AvsAssessmentOptionsOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentV2Impl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentV2Impl.java new file mode 100644 index 000000000000..9d0efaf3f261 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentV2Impl.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentV2Inner; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentPropertiesV2; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentV2; +import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; + +public final class AvsAssessmentV2Impl implements AvsAssessmentV2, AvsAssessmentV2.Definition { + private AvsAssessmentV2Inner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AvsAssessmentV2Impl(AvsAssessmentV2Inner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AvsAssessmentPropertiesV2 properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AvsAssessmentV2Inner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String projectName; + + private String assessmentName; + + public AvsAssessmentV2Impl withExistingAssessmentProject(String resourceGroupName, String projectName) { + this.resourceGroupName = resourceGroupName; + this.projectName = projectName; + return this; + } + + public AvsAssessmentV2 create() { + this.innerObject = serviceManager.serviceClient() + .getAvsAssessmentsV2Operations() + .create(resourceGroupName, projectName, assessmentName, this.innerModel(), Context.NONE); + return this; + } + + public AvsAssessmentV2 create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAvsAssessmentsV2Operations() + .create(resourceGroupName, projectName, assessmentName, this.innerModel(), context); + return this; + } + + AvsAssessmentV2Impl(String name, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerObject = new AvsAssessmentV2Inner(); + this.serviceManager = serviceManager; + this.assessmentName = name; + } + + public AvsAssessmentV2 refresh() { + this.innerObject = serviceManager.serviceClient() + .getAvsAssessmentsV2Operations() + .getWithResponse(resourceGroupName, projectName, assessmentName, Context.NONE) + .getValue(); + return this; + } + + public AvsAssessmentV2 refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAvsAssessmentsV2Operations() + .getWithResponse(resourceGroupName, projectName, assessmentName, context) + .getValue(); + return this; + } + + public DownloadUrl downloadUrl(Object body) { + return serviceManager.avsAssessmentsV2Operations() + .downloadUrl(resourceGroupName, projectName, assessmentName, body); + } + + public DownloadUrl downloadUrl(Object body, Context context) { + return serviceManager.avsAssessmentsV2Operations() + .downloadUrl(resourceGroupName, projectName, assessmentName, body, context); + } + + public AvsAssessmentV2Impl withProperties(AvsAssessmentPropertiesV2 properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentV2SummaryImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentV2SummaryImpl.java new file mode 100644 index 000000000000..3cfbf3be2436 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentV2SummaryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentV2SummaryInner; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentSummaryPropertiesV2; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentV2Summary; + +public final class AvsAssessmentV2SummaryImpl implements AvsAssessmentV2Summary { + private AvsAssessmentV2SummaryInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AvsAssessmentV2SummaryImpl(AvsAssessmentV2SummaryInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AvsAssessmentSummaryPropertiesV2 properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AvsAssessmentV2SummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentV2SummaryOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentV2SummaryOperationsClientImpl.java new file mode 100644 index 000000000000..cffe26adb81f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentV2SummaryOperationsClientImpl.java @@ -0,0 +1,448 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AvsAssessmentV2SummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentV2SummaryInner; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentV2SummaryListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AvsAssessmentV2SummaryOperationsClient. + */ +public final class AvsAssessmentV2SummaryOperationsClientImpl implements AvsAssessmentV2SummaryOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AvsAssessmentV2SummaryOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of AvsAssessmentV2SummaryOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvsAssessmentV2SummaryOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(AvsAssessmentV2SummaryOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientAvsAssessmentV2SummaryOperations + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface AvsAssessmentV2SummaryOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessments/{assessmentName}/summaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/avsAssessments/{assessmentName}/summaries/{summaryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParentNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AvsAssessmentV2Summary resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2Summary 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 AvsAssessmentV2Summary resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2Summary 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 AvsAssessmentV2Summary resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2Summary 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 AvsAssessmentV2Summary resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2Summary 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 AvsAssessmentV2Summary resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2Summary 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 AvsAssessmentV2Summary resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2Summary 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 a AvsAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param summaryName Gets the Name of the AVS Assessment 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 AvsAssessmentV2Summary 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 AvsAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param summaryName Gets the Name of the AVS Assessment 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 AvsAssessmentV2Summary 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 AvsAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param summaryName Gets the Name of the AVS Assessment 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 AvsAssessmentV2Summary 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 AvsAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param summaryName Gets the Name of the AVS Assessment 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 AvsAssessmentV2Summary 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 AvsAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param summaryName Gets the Name of the AVS Assessment 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 AvsAssessmentV2Summary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvsAssessmentV2SummaryInner get(String resourceGroupName, String projectName, String assessmentName, + String summaryName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, summaryName, Context.NONE).getValue(); + } + + /** + * 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 AvsAssessmentV2Summary 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 AvsAssessmentV2Summary 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentV2SummaryOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentV2SummaryOperationsImpl.java new file mode 100644 index 000000000000..ed0fa86c2ca6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentV2SummaryOperationsImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AvsAssessmentV2SummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentV2SummaryInner; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentV2Summary; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentV2SummaryOperations; + +public final class AvsAssessmentV2SummaryOperationsImpl implements AvsAssessmentV2SummaryOperations { + private static final ClientLogger LOGGER = new ClientLogger(AvsAssessmentV2SummaryOperationsImpl.class); + + private final AvsAssessmentV2SummaryOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public AvsAssessmentV2SummaryOperationsImpl(AvsAssessmentV2SummaryOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvsAssessmentV2SummaryImpl(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 AvsAssessmentV2SummaryImpl(inner1, this.manager())); + } + + 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 AvsAssessmentV2SummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AvsAssessmentV2Summary get(String resourceGroupName, String projectName, String assessmentName, + String summaryName) { + AvsAssessmentV2SummaryInner inner + = this.serviceClient().get(resourceGroupName, projectName, assessmentName, summaryName); + if (inner != null) { + return new AvsAssessmentV2SummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + private AvsAssessmentV2SummaryOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentsOperationsClientImpl.java deleted file mode 100644 index f0246ce5ab3d..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentsOperationsClientImpl.java +++ /dev/null @@ -1,1179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AvsAssessmentsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentInner; -import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentListResult; -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 AvsAssessmentsOperationsClient. - */ -public final class AvsAssessmentsOperationsClientImpl implements AvsAssessmentsOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AvsAssessmentsOperationsService service; - - /** - * The service client containing this operation class. - */ - private final MigrationAssessmentManagementClientImpl client; - - /** - * Initializes an instance of AvsAssessmentsOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AvsAssessmentsOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { - this.service = RestProxy.create(AvsAssessmentsOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MigrationAssessmentManagementClientAvsAssessmentsOperations to be - * used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MigrationAssessmentM") - public interface AvsAssessmentsOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByGroup(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @BodyParam("application/json") AvsAssessmentInner resource, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/downloadUrl") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> downloadUrl(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @BodyParam("application/json") Object body, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List AvsAssessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 AvsAssessment list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGroupSinglePageAsync(String resourceGroupName, - String projectName, String groupName) { - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, 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 AvsAssessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 AvsAssessment list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGroupSinglePageAsync(String resourceGroupName, - String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, projectName, groupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List AvsAssessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 AvsAssessment list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByGroupAsync(String resourceGroupName, String projectName, - String groupName) { - return new PagedFlux<>(() -> listByGroupSinglePageAsync(resourceGroupName, projectName, groupName), - nextLink -> listByGroupNextSinglePageAsync(nextLink)); - } - - /** - * List AvsAssessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 AvsAssessment list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByGroupAsync(String resourceGroupName, String projectName, - String groupName, Context context) { - return new PagedFlux<>(() -> listByGroupSinglePageAsync(resourceGroupName, projectName, groupName, context), - nextLink -> listByGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List AvsAssessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 AvsAssessment list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByGroup(String resourceGroupName, String projectName, - String groupName) { - return new PagedIterable<>(listByGroupAsync(resourceGroupName, projectName, groupName)); - } - - /** - * List AvsAssessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 AvsAssessment list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName, - Context context) { - return new PagedIterable<>(listByGroupAsync(resourceGroupName, projectName, groupName, context)); - } - - /** - * Get a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, accept, context); - } - - /** - * Get a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String projectName, String groupName, - String assessmentName) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, Context context) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, context).block(); - } - - /** - * Get a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvsAssessmentInner get(String resourceGroupName, String projectName, String groupName, - String assessmentName) { - return getWithResponse(resourceGroupName, projectName, groupName, assessmentName, Context.NONE).getValue(); - } - - /** - * Create a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 aVS assessment resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName, AvsAssessmentInner 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, assessmentName, resource, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 aVS assessment resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName, AvsAssessmentInner 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, projectName, groupName, assessmentName, resource, accept, context); - } - - /** - * Create a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 aVS assessment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AvsAssessmentInner> beginCreateAsync(String resourceGroupName, - String projectName, String groupName, String assessmentName, AvsAssessmentInner resource) { - Mono>> mono - = createWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AvsAssessmentInner.class, AvsAssessmentInner.class, this.client.getContext()); - } - - /** - * Create a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 aVS assessment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AvsAssessmentInner> beginCreateAsync(String resourceGroupName, - String projectName, String groupName, String assessmentName, AvsAssessmentInner resource, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, resource, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AvsAssessmentInner.class, AvsAssessmentInner.class, context); - } - - /** - * Create a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 aVS assessment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AvsAssessmentInner> beginCreate(String resourceGroupName, - String projectName, String groupName, String assessmentName, AvsAssessmentInner resource) { - return this.beginCreateAsync(resourceGroupName, projectName, groupName, assessmentName, resource) - .getSyncPoller(); - } - - /** - * Create a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 aVS assessment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AvsAssessmentInner> beginCreate(String resourceGroupName, - String projectName, String groupName, String assessmentName, AvsAssessmentInner resource, Context context) { - return this.beginCreateAsync(resourceGroupName, projectName, groupName, assessmentName, resource, context) - .getSyncPoller(); - } - - /** - * Create a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 aVS assessment resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String projectName, String groupName, - String assessmentName, AvsAssessmentInner resource) { - return beginCreateAsync(resourceGroupName, projectName, groupName, assessmentName, resource).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 aVS assessment resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String projectName, String groupName, - String assessmentName, AvsAssessmentInner resource, Context context) { - return beginCreateAsync(resourceGroupName, projectName, groupName, assessmentName, resource, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 aVS assessment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvsAssessmentInner create(String resourceGroupName, String projectName, String groupName, - String assessmentName, AvsAssessmentInner resource) { - return createAsync(resourceGroupName, projectName, groupName, assessmentName, resource).block(); - } - - /** - * Create a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 aVS assessment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvsAssessmentInner create(String resourceGroupName, String projectName, String groupName, - String assessmentName, AvsAssessmentInner resource, Context context) { - return createAsync(resourceGroupName, projectName, groupName, assessmentName, resource, context).block(); - } - - /** - * Delete a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 groupName, - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 groupName, - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, accept, context); - } - - /** - * Delete a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 groupName, - String assessmentName) { - return deleteWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 groupName, - String assessmentName, Context context) { - return deleteWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, context).block(); - } - - /** - * Delete a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 groupName, String assessmentName) { - deleteWithResponse(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 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 groupName, String assessmentName, Object 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.downloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, assessmentName, body, - accept, 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 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 groupName, String assessmentName, Object 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.downloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, assessmentName, body, accept, - 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 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 groupName, String assessmentName, Object body) { - Mono>> mono - = downloadUrlWithResponseAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 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 groupName, String assessmentName, Object body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = downloadUrlWithResponseAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 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 groupName, String assessmentName, Object body) { - return this.beginDownloadUrlAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 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 groupName, String assessmentName, Object body, Context context) { - return this.beginDownloadUrlAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 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 groupName, - String assessmentName, Object body) { - return beginDownloadUrlAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 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 groupName, - String assessmentName, Object body, Context context) { - return beginDownloadUrlAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String groupName, - String assessmentName, Object body) { - return downloadUrlAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String groupName, - String assessmentName, Object body, Context context) { - return downloadUrlAsync(resourceGroupName, projectName, groupName, 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 AvsAssessment list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGroupNextSinglePageAsync(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.listByGroupNext(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 AvsAssessment list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGroupNextSinglePageAsync(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.listByGroupNext(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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentsOperationsImpl.java deleted file mode 100644 index 6b94e0766eea..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentsOperationsImpl.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AvsAssessmentsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentInner; -import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessment; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentsOperations; -import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; - -public final class AvsAssessmentsOperationsImpl implements AvsAssessmentsOperations { - private static final ClientLogger LOGGER = new ClientLogger(AvsAssessmentsOperationsImpl.class); - - private final AvsAssessmentsOperationsClient innerClient; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - public AvsAssessmentsOperationsImpl(AvsAssessmentsOperationsClient innerClient, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName) { - PagedIterable inner - = this.serviceClient().listByGroup(resourceGroupName, projectName, groupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AvsAssessmentImpl(inner1, this.manager())); - } - - public PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName, - Context context) { - PagedIterable inner - = this.serviceClient().listByGroup(resourceGroupName, projectName, groupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AvsAssessmentImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, projectName, groupName, assessmentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AvsAssessmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AvsAssessment get(String resourceGroupName, String projectName, String groupName, String assessmentName) { - AvsAssessmentInner inner = this.serviceClient().get(resourceGroupName, projectName, groupName, assessmentName); - if (inner != null) { - return new AvsAssessmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, Context context) { - return this.serviceClient() - .deleteWithResponse(resourceGroupName, projectName, groupName, assessmentName, context); - } - - public void delete(String resourceGroupName, String projectName, String groupName, String assessmentName) { - this.serviceClient().delete(resourceGroupName, projectName, groupName, assessmentName); - } - - public DownloadUrl downloadUrl(String resourceGroupName, String projectName, String groupName, - String assessmentName, Object body) { - DownloadUrlInner inner - = this.serviceClient().downloadUrl(resourceGroupName, projectName, groupName, assessmentName, body); - if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); - } else { - return null; - } - } - - public DownloadUrl downloadUrl(String resourceGroupName, String projectName, String groupName, - String assessmentName, Object body, Context context) { - DownloadUrlInner inner = this.serviceClient() - .downloadUrl(resourceGroupName, projectName, groupName, assessmentName, body, context); - if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); - } else { - return null; - } - } - - public AvsAssessment 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByName(id, "avsAssessments"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'avsAssessments'.", id))); - } - return this.getWithResponse(resourceGroupName, projectName, groupName, 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByName(id, "avsAssessments"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'avsAssessments'.", id))); - } - return this.getWithResponse(resourceGroupName, projectName, groupName, 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByName(id, "avsAssessments"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'avsAssessments'.", id))); - } - this.deleteWithResponse(resourceGroupName, projectName, groupName, 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByName(id, "avsAssessments"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'avsAssessments'.", id))); - } - return this.deleteWithResponse(resourceGroupName, projectName, groupName, assessmentName, context); - } - - private AvsAssessmentsOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } - - public AvsAssessmentImpl define(String name) { - return new AvsAssessmentImpl(name, this.manager()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentsV2OperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentsV2OperationsClientImpl.java new file mode 100644 index 000000000000..05280b9e91bf --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentsV2OperationsClientImpl.java @@ -0,0 +1,1098 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AvsAssessmentsV2OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentV2Inner; +import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentV2ListResult; +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 AvsAssessmentsV2OperationsClient. + */ +public final class AvsAssessmentsV2OperationsClientImpl implements AvsAssessmentsV2OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AvsAssessmentsV2OperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of AvsAssessmentsV2OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvsAssessmentsV2OperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(AvsAssessmentsV2OperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientAvsAssessmentsV2Operations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface AvsAssessmentsV2OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/avsAssessments/{assessmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessments/{assessmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, + @BodyParam("application/json") AvsAssessmentV2Inner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessments/{assessmentName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessments/{assessmentName}/downloadUrl") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> downloadUrl(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, @BodyParam("application/json") Object body, + @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AvsAssessmentV2 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 AvsAssessmentV2 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 AvsAssessmentV2 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 AvsAssessmentV2 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 AvsAssessmentV2 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 AvsAssessmentV2 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 AvsAssessmentV2 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 AvsAssessmentV2 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 AvsAssessmentV2 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 AvsAssessmentV2 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 AvsAssessmentV2 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 AvsAssessmentV2 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 a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2 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 AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2 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 AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2 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 AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2 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 AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvsAssessmentV2Inner get(String resourceGroupName, String projectName, String assessmentName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, Context.NONE).getValue(); + } + + /** + * Create a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 aVS 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, AvsAssessmentV2Inner 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 accept = "application/json"; + return FluxUtil.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 aVS 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, AvsAssessmentV2Inner 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, assessmentName, resource, accept, context); + } + + /** + * Create a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 aVS assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AvsAssessmentV2Inner> beginCreateAsync( + String resourceGroupName, String projectName, String assessmentName, AvsAssessmentV2Inner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, assessmentName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AvsAssessmentV2Inner.class, AvsAssessmentV2Inner.class, this.client.getContext()); + } + + /** + * Create a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 aVS assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AvsAssessmentV2Inner> beginCreateAsync( + String resourceGroupName, String projectName, String assessmentName, AvsAssessmentV2Inner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, assessmentName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AvsAssessmentV2Inner.class, AvsAssessmentV2Inner.class, context); + } + + /** + * Create a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 aVS assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AvsAssessmentV2Inner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, AvsAssessmentV2Inner resource) { + return this.beginCreateAsync(resourceGroupName, projectName, assessmentName, resource).getSyncPoller(); + } + + /** + * Create a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 aVS assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AvsAssessmentV2Inner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, AvsAssessmentV2Inner resource, Context context) { + return this.beginCreateAsync(resourceGroupName, projectName, assessmentName, resource, context).getSyncPoller(); + } + + /** + * Create a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 aVS assessment V2 resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, String assessmentName, + AvsAssessmentV2Inner resource) { + return beginCreateAsync(resourceGroupName, projectName, assessmentName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 aVS assessment V2 resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, String assessmentName, + AvsAssessmentV2Inner resource, Context context) { + return beginCreateAsync(resourceGroupName, projectName, assessmentName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 aVS assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvsAssessmentV2Inner create(String resourceGroupName, String projectName, String assessmentName, + AvsAssessmentV2Inner resource) { + return createAsync(resourceGroupName, projectName, assessmentName, resource).block(); + } + + /** + * Create a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 aVS assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvsAssessmentV2Inner create(String resourceGroupName, String projectName, String assessmentName, + AvsAssessmentV2Inner resource, Context context) { + return createAsync(resourceGroupName, projectName, assessmentName, resource, context).block(); + } + + /** + * Delete a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AVS Assessment 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 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, Object 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.downloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, body, accept, 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 AVS Assessment 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 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, Object 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.")); + } + 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, body, accept, 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 AVS Assessment 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 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, Object 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 AVS Assessment 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 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, Object 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 AVS Assessment 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 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, Object 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 AVS Assessment 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 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, Object 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 AVS Assessment 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 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, + Object 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 AVS Assessment 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 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, + Object 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 AVS Assessment 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 URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, + Object 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 AVS Assessment 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 URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, + Object 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 AvsAssessmentV2 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 AvsAssessmentV2 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentsV2OperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentsV2OperationsImpl.java new file mode 100644 index 000000000000..23a3a7d6dc66 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsAssessmentsV2OperationsImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AvsAssessmentsV2OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentV2Inner; +import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentV2; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentsV2Operations; +import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; + +public final class AvsAssessmentsV2OperationsImpl implements AvsAssessmentsV2Operations { + private static final ClientLogger LOGGER = new ClientLogger(AvsAssessmentsV2OperationsImpl.class); + + private final AvsAssessmentsV2OperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public AvsAssessmentsV2OperationsImpl(AvsAssessmentsV2OperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner = this.serviceClient().listByParent(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvsAssessmentV2Impl(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 AvsAssessmentV2Impl(inner1, this.manager())); + } + + 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 AvsAssessmentV2Impl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AvsAssessmentV2 get(String resourceGroupName, String projectName, String assessmentName) { + AvsAssessmentV2Inner inner = this.serviceClient().get(resourceGroupName, projectName, assessmentName); + if (inner != null) { + return new AvsAssessmentV2Impl(inner, this.manager()); + } else { + return null; + } + } + + 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, Object 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, Object 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 AvsAssessmentV2 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, "avsAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'avsAssessments'.", 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, "avsAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'avsAssessments'.", 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, "avsAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'avsAssessments'.", 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, "avsAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'avsAssessments'.", id))); + } + return this.deleteWithResponse(resourceGroupName, projectName, assessmentName, context); + } + + private AvsAssessmentsV2OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + public AvsAssessmentV2Impl define(String name) { + return new AvsAssessmentV2Impl(name, this.manager()); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsGraphAssessmentOptionsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsGraphAssessmentOptionsImpl.java new file mode 100644 index 000000000000..37f424b612ba --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsGraphAssessmentOptionsImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsGraphAssessmentOptionsInner; +import com.azure.resourcemanager.migration.assessment.models.AvsGraphAssessmentOptions; +import com.azure.resourcemanager.migration.assessment.models.AvsGraphAssessmentOptionsProperties; + +public final class AvsGraphAssessmentOptionsImpl implements AvsGraphAssessmentOptions { + private AvsGraphAssessmentOptionsInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AvsGraphAssessmentOptionsImpl(AvsGraphAssessmentOptionsInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AvsGraphAssessmentOptionsProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AvsGraphAssessmentOptionsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsGraphAssessmentOptionsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsGraphAssessmentOptionsOperationsClientImpl.java new file mode 100644 index 000000000000..ff08d7a730fd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsGraphAssessmentOptionsOperationsClientImpl.java @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AvsGraphAssessmentOptionsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsGraphAssessmentOptionsInner; +import com.azure.resourcemanager.migration.assessment.models.AvsGraphAssessmentOptionsListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AvsGraphAssessmentOptionsOperationsClient. + */ +public final class AvsGraphAssessmentOptionsOperationsClientImpl implements AvsGraphAssessmentOptionsOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AvsGraphAssessmentOptionsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of AvsGraphAssessmentOptionsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvsGraphAssessmentOptionsOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(AvsGraphAssessmentOptionsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * MigrationAssessmentManagementClientAvsGraphAssessmentOptionsOperations to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface AvsGraphAssessmentOptionsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessmentOptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/avsAssessmentOptions/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions 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 a AvsGraphAssessmentOptions. + * + * @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 AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions. + * + * @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 AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions. + * + * @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 AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions. + * + * @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 AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions. + * + * @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 AvsGraphAssessmentOptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvsGraphAssessmentOptionsInner get(String resourceGroupName, String projectName) { + return getWithResponse(resourceGroupName, projectName, Context.NONE).getValue(); + } + + /** + * 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 AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsGraphAssessmentOptionsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsGraphAssessmentOptionsOperationsImpl.java new file mode 100644 index 000000000000..3b49fb799d3a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsGraphAssessmentOptionsOperationsImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.AvsGraphAssessmentOptionsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsGraphAssessmentOptionsInner; +import com.azure.resourcemanager.migration.assessment.models.AvsGraphAssessmentOptions; +import com.azure.resourcemanager.migration.assessment.models.AvsGraphAssessmentOptionsOperations; + +public final class AvsGraphAssessmentOptionsOperationsImpl implements AvsGraphAssessmentOptionsOperations { + private static final ClientLogger LOGGER = new ClientLogger(AvsGraphAssessmentOptionsOperationsImpl.class); + + private final AvsGraphAssessmentOptionsOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public AvsGraphAssessmentOptionsOperationsImpl(AvsGraphAssessmentOptionsOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvsGraphAssessmentOptionsImpl(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 AvsGraphAssessmentOptionsImpl(inner1, this.manager())); + } + + 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 AvsGraphAssessmentOptionsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AvsGraphAssessmentOptions get(String resourceGroupName, String projectName) { + AvsGraphAssessmentOptionsInner inner = this.serviceClient().get(resourceGroupName, projectName); + if (inner != null) { + return new AvsGraphAssessmentOptionsImpl(inner, this.manager()); + } else { + return null; + } + } + + private AvsGraphAssessmentOptionsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsSummaryImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsSummaryImpl.java new file mode 100644 index 000000000000..519b850ce19a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/AvsSummaryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.AvsSummary; +import com.azure.resourcemanager.migration.assessment.models.AvsSummaryProperties; + +public final class AvsSummaryImpl implements AvsSummary { + private AvsSummaryInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + AvsSummaryImpl(AvsSummaryInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 AvsSummaryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AvsSummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseAvsSummaryOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseAvsSummaryOperationsClientImpl.java new file mode 100644 index 000000000000..6673ed78a374 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseAvsSummaryOperationsClientImpl.java @@ -0,0 +1,453 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.BusinessCaseAvsSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.AvsSummaryListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BusinessCaseAvsSummaryOperationsClient. + */ +public final class BusinessCaseAvsSummaryOperationsClientImpl implements BusinessCaseAvsSummaryOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BusinessCaseAvsSummaryOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of BusinessCaseAvsSummaryOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BusinessCaseAvsSummaryOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(BusinessCaseAvsSummaryOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientBusinessCaseAvsSummaryOperations + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface BusinessCaseAvsSummaryOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/avsSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/avsSummaries/{avsSummaryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, @PathParam("avsSummaryName") String avsSummaryName, + @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AvsSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 AvsSummary list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName) { + 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, 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 AvsSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 AvsSummary list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List AvsSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 AvsSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List AvsSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 AvsSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName, Context context) { + return new PagedFlux<>( + () -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); + } + + /** + * List AvsSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 AvsSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName)); + } + + /** + * List AvsSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 AvsSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, Context context) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName, context)); + } + + /** + * Get a AvsSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param avsSummaryName Gets the Name of the Avs 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 AvsSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String avsSummaryName) { + 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (avsSummaryName == null) { + return Mono.error(new IllegalArgumentException("Parameter avsSummaryName 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, businessCaseName, avsSummaryName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a AvsSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param avsSummaryName Gets the Name of the Avs 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 AvsSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String avsSummaryName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (avsSummaryName == null) { + return Mono.error(new IllegalArgumentException("Parameter avsSummaryName 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, businessCaseName, avsSummaryName, accept, context); + } + + /** + * Get a AvsSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param avsSummaryName Gets the Name of the Avs 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 AvsSummary on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, String businessCaseName, + String avsSummaryName) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, avsSummaryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a AvsSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param avsSummaryName Gets the Name of the Avs 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 AvsSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String avsSummaryName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, avsSummaryName, context).block(); + } + + /** + * Get a AvsSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param avsSummaryName Gets the Name of the Avs 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 AvsSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvsSummaryInner get(String resourceGroupName, String projectName, String businessCaseName, + String avsSummaryName) { + return getWithResponse(resourceGroupName, projectName, businessCaseName, avsSummaryName, Context.NONE) + .getValue(); + } + + /** + * 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 AvsSummary 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 AvsSummary 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseAvsSummaryOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseAvsSummaryOperationsImpl.java new file mode 100644 index 000000000000..f8a872238d33 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseAvsSummaryOperationsImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.BusinessCaseAvsSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.AvsSummary; +import com.azure.resourcemanager.migration.assessment.models.BusinessCaseAvsSummaryOperations; + +public final class BusinessCaseAvsSummaryOperationsImpl implements BusinessCaseAvsSummaryOperations { + private static final ClientLogger LOGGER = new ClientLogger(BusinessCaseAvsSummaryOperationsImpl.class); + + private final BusinessCaseAvsSummaryOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public BusinessCaseAvsSummaryOperationsImpl(BusinessCaseAvsSummaryOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, businessCaseName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvsSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName, + Context context) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, businessCaseName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvsSummaryImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + String avsSummaryName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, businessCaseName, avsSummaryName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AvsSummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AvsSummary get(String resourceGroupName, String projectName, String businessCaseName, + String avsSummaryName) { + AvsSummaryInner inner + = this.serviceClient().get(resourceGroupName, projectName, businessCaseName, avsSummaryName); + if (inner != null) { + return new AvsSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + private BusinessCaseAvsSummaryOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseIaasSummaryOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseIaasSummaryOperationsClientImpl.java new file mode 100644 index 000000000000..30261cbcb01d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseIaasSummaryOperationsClientImpl.java @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.BusinessCaseIaasSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.IaasSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.IaasSummaryListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BusinessCaseIaasSummaryOperationsClient. + */ +public final class BusinessCaseIaasSummaryOperationsClientImpl implements BusinessCaseIaasSummaryOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BusinessCaseIaasSummaryOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of BusinessCaseIaasSummaryOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BusinessCaseIaasSummaryOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(BusinessCaseIaasSummaryOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientBusinessCaseIaasSummaryOperations + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface BusinessCaseIaasSummaryOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/iaasSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/iaasSummaries/{iaasSummaryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, + @PathParam("iaasSummaryName") String iaasSummaryName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List IaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 IaasSummary list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName) { + 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, 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 IaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 IaasSummary list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 IaasSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List IaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 IaasSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName, Context context) { + return new PagedFlux<>( + () -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); + } + + /** + * List IaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 IaasSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName)); + } + + /** + * List IaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 IaasSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, Context context) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName, context)); + } + + /** + * Get a IaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param iaasSummaryName Gets the Name of the Iaas 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 IaasSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String iaasSummaryName) { + 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (iaasSummaryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iaasSummaryName 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, businessCaseName, iaasSummaryName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a IaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param iaasSummaryName Gets the Name of the Iaas 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 IaasSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String iaasSummaryName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (iaasSummaryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iaasSummaryName 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, businessCaseName, iaasSummaryName, accept, context); + } + + /** + * Get a IaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param iaasSummaryName Gets the Name of the Iaas 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 IaasSummary on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, String businessCaseName, + String iaasSummaryName) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, iaasSummaryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a IaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param iaasSummaryName Gets the Name of the Iaas 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 IaasSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String iaasSummaryName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, iaasSummaryName, context).block(); + } + + /** + * Get a IaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param iaasSummaryName Gets the Name of the Iaas 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 IaasSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IaasSummaryInner get(String resourceGroupName, String projectName, String businessCaseName, + String iaasSummaryName) { + return getWithResponse(resourceGroupName, projectName, businessCaseName, iaasSummaryName, Context.NONE) + .getValue(); + } + + /** + * 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 IaasSummary 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 IaasSummary 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseIaasSummaryOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseIaasSummaryOperationsImpl.java new file mode 100644 index 000000000000..8d5d5eee0c77 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseIaasSummaryOperationsImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.BusinessCaseIaasSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.IaasSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.BusinessCaseIaasSummaryOperations; +import com.azure.resourcemanager.migration.assessment.models.IaasSummary; + +public final class BusinessCaseIaasSummaryOperationsImpl implements BusinessCaseIaasSummaryOperations { + private static final ClientLogger LOGGER = new ClientLogger(BusinessCaseIaasSummaryOperationsImpl.class); + + private final BusinessCaseIaasSummaryOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public BusinessCaseIaasSummaryOperationsImpl(BusinessCaseIaasSummaryOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, businessCaseName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IaasSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, Context context) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, businessCaseName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IaasSummaryImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + String iaasSummaryName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, businessCaseName, iaasSummaryName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IaasSummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IaasSummary get(String resourceGroupName, String projectName, String businessCaseName, + String iaasSummaryName) { + IaasSummaryInner inner + = this.serviceClient().get(resourceGroupName, projectName, businessCaseName, iaasSummaryName); + if (inner != null) { + return new IaasSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + private BusinessCaseIaasSummaryOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseImpl.java new file mode 100644 index 000000000000..43bf46ff5aa2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseImpl.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.BusinessCaseInner; +import com.azure.resourcemanager.migration.assessment.models.BusinessCase; +import com.azure.resourcemanager.migration.assessment.models.BusinessCaseProperties; +import com.azure.resourcemanager.migration.assessment.models.CompareSummary; +import com.azure.resourcemanager.migration.assessment.models.ReportDownloadUrl; + +public final class BusinessCaseImpl implements BusinessCase, BusinessCase.Definition { + private BusinessCaseInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + BusinessCaseImpl(BusinessCaseInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 BusinessCaseProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public BusinessCaseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String projectName; + + private String businessCaseName; + + public BusinessCaseImpl withExistingAssessmentProject(String resourceGroupName, String projectName) { + this.resourceGroupName = resourceGroupName; + this.projectName = projectName; + return this; + } + + public BusinessCase create() { + this.innerObject = serviceManager.serviceClient() + .getBusinessCaseOperations() + .create(resourceGroupName, projectName, businessCaseName, this.innerModel(), Context.NONE); + return this; + } + + public BusinessCase create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBusinessCaseOperations() + .create(resourceGroupName, projectName, businessCaseName, this.innerModel(), context); + return this; + } + + BusinessCaseImpl(String name, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerObject = new BusinessCaseInner(); + this.serviceManager = serviceManager; + this.businessCaseName = name; + } + + public BusinessCase refresh() { + this.innerObject = serviceManager.serviceClient() + .getBusinessCaseOperations() + .getWithResponse(resourceGroupName, projectName, businessCaseName, Context.NONE) + .getValue(); + return this; + } + + public BusinessCase refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBusinessCaseOperations() + .getWithResponse(resourceGroupName, projectName, businessCaseName, context) + .getValue(); + return this; + } + + public CompareSummary compareSummary(Object body) { + return serviceManager.businessCaseOperations() + .compareSummary(resourceGroupName, projectName, businessCaseName, body); + } + + public CompareSummary compareSummary(Object body, Context context) { + return serviceManager.businessCaseOperations() + .compareSummary(resourceGroupName, projectName, businessCaseName, body, context); + } + + public ReportDownloadUrl getReportDownloadUrl(Object body) { + return serviceManager.businessCaseOperations() + .getReportDownloadUrl(resourceGroupName, projectName, businessCaseName, body); + } + + public ReportDownloadUrl getReportDownloadUrl(Object body, Context context) { + return serviceManager.businessCaseOperations() + .getReportDownloadUrl(resourceGroupName, projectName, businessCaseName, body, context); + } + + public BusinessCaseImpl withProperties(BusinessCaseProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseOperationsClientImpl.java new file mode 100644 index 000000000000..9207b4cc6182 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseOperationsClientImpl.java @@ -0,0 +1,1391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.BusinessCaseOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.BusinessCaseInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.CompareSummaryInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.ReportDownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.models.BusinessCaseListResult; +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 BusinessCaseOperationsClient. + */ +public final class BusinessCaseOperationsClientImpl implements BusinessCaseOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BusinessCaseOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of BusinessCaseOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BusinessCaseOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(BusinessCaseOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientBusinessCaseOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface BusinessCaseOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/businessCases/{businessCaseName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, + @BodyParam("application/json") BusinessCaseInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/compareSummary") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> compareSummary(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, @BodyParam("application/json") Object body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/getReportDownloadUrl") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getReportDownloadUrl(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, @BodyParam("application/json") Object body, + @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List BusinessCase 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 BusinessCase 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 BusinessCase 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 BusinessCase 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 BusinessCase 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 BusinessCase 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 BusinessCase 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 BusinessCase 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 BusinessCase 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 BusinessCase 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 BusinessCase 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 BusinessCase 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 a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 BusinessCase along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName) { + 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 BusinessCase along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, accept, context); + } + + /** + * Get a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 BusinessCase on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, String businessCaseName) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 BusinessCase along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, context).block(); + } + + /** + * Get a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 BusinessCase. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BusinessCaseInner get(String resourceGroupName, String projectName, String businessCaseName) { + return getWithResponse(resourceGroupName, projectName, businessCaseName, Context.NONE).getValue(); + } + + /** + * Create a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 business case resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, BusinessCaseInner 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, businessCaseName, resource, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 business case resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, BusinessCaseInner 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, businessCaseName, resource, accept, context); + } + + /** + * Create a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 business case resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BusinessCaseInner> beginCreateAsync(String resourceGroupName, + String projectName, String businessCaseName, BusinessCaseInner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, businessCaseName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BusinessCaseInner.class, BusinessCaseInner.class, this.client.getContext()); + } + + /** + * Create a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 business case resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BusinessCaseInner> beginCreateAsync(String resourceGroupName, + String projectName, String businessCaseName, BusinessCaseInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, businessCaseName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BusinessCaseInner.class, BusinessCaseInner.class, context); + } + + /** + * Create a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 business case resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BusinessCaseInner> beginCreate(String resourceGroupName, + String projectName, String businessCaseName, BusinessCaseInner resource) { + return this.beginCreateAsync(resourceGroupName, projectName, businessCaseName, resource).getSyncPoller(); + } + + /** + * Create a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 business case resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BusinessCaseInner> beginCreate(String resourceGroupName, + String projectName, String businessCaseName, BusinessCaseInner resource, Context context) { + return this.beginCreateAsync(resourceGroupName, projectName, businessCaseName, resource, context) + .getSyncPoller(); + } + + /** + * Create a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 business case resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, String businessCaseName, + BusinessCaseInner resource) { + return beginCreateAsync(resourceGroupName, projectName, businessCaseName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 business case resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, String businessCaseName, + BusinessCaseInner resource, Context context) { + return beginCreateAsync(resourceGroupName, projectName, businessCaseName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 business case resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BusinessCaseInner create(String resourceGroupName, String projectName, String businessCaseName, + BusinessCaseInner resource) { + return createAsync(resourceGroupName, projectName, businessCaseName, resource).block(); + } + + /** + * Create a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 business case resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BusinessCaseInner create(String resourceGroupName, String projectName, String businessCaseName, + BusinessCaseInner resource, Context context) { + return createAsync(resourceGroupName, projectName, businessCaseName, resource, context).block(); + } + + /** + * Delete a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 businessCaseName) { + 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 businessCaseName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, accept, context); + } + + /** + * Delete a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 businessCaseName) { + return deleteWithResponseAsync(resourceGroupName, projectName, businessCaseName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 businessCaseName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, projectName, businessCaseName, context).block(); + } + + /** + * Delete a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 businessCaseName) { + deleteWithResponse(resourceGroupName, projectName, businessCaseName, Context.NONE); + } + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> compareSummaryWithResponseAsync(String resourceGroupName, + String projectName, String businessCaseName, Object 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.compareSummary(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, businessCaseName, body, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> compareSummaryWithResponseAsync(String resourceGroupName, + String projectName, String businessCaseName, Object 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.compareSummary(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, businessCaseName, body, accept, context); + } + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CompareSummaryInner> + beginCompareSummaryAsync(String resourceGroupName, String projectName, String businessCaseName, Object body) { + Mono>> mono + = compareSummaryWithResponseAsync(resourceGroupName, projectName, businessCaseName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CompareSummaryInner.class, CompareSummaryInner.class, this.client.getContext()); + } + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CompareSummaryInner> beginCompareSummaryAsync( + String resourceGroupName, String projectName, String businessCaseName, Object body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = compareSummaryWithResponseAsync(resourceGroupName, projectName, businessCaseName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CompareSummaryInner.class, CompareSummaryInner.class, context); + } + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CompareSummaryInner> + beginCompareSummary(String resourceGroupName, String projectName, String businessCaseName, Object body) { + return this.beginCompareSummaryAsync(resourceGroupName, projectName, businessCaseName, body).getSyncPoller(); + } + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CompareSummaryInner> beginCompareSummary( + String resourceGroupName, String projectName, String businessCaseName, Object body, Context context) { + return this.beginCompareSummaryAsync(resourceGroupName, projectName, businessCaseName, body, context) + .getSyncPoller(); + } + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono compareSummaryAsync(String resourceGroupName, String projectName, + String businessCaseName, Object body) { + return beginCompareSummaryAsync(resourceGroupName, projectName, businessCaseName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono compareSummaryAsync(String resourceGroupName, String projectName, + String businessCaseName, Object body, Context context) { + return beginCompareSummaryAsync(resourceGroupName, projectName, businessCaseName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CompareSummaryInner compareSummary(String resourceGroupName, String projectName, String businessCaseName, + Object body) { + return compareSummaryAsync(resourceGroupName, projectName, businessCaseName, body).block(); + } + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CompareSummaryInner compareSummary(String resourceGroupName, String projectName, String businessCaseName, + Object body, Context context) { + return compareSummaryAsync(resourceGroupName, projectName, businessCaseName, body, context).block(); + } + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 URL for downloading the business case in a report format along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getReportDownloadUrlWithResponseAsync(String resourceGroupName, + String projectName, String businessCaseName, Object 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getReportDownloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, businessCaseName, body, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 URL for downloading the business case in a report format along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getReportDownloadUrlWithResponseAsync(String resourceGroupName, + String projectName, String businessCaseName, Object 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getReportDownloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, businessCaseName, body, accept, context); + } + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 the URL for downloading the business case in a report format. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReportDownloadUrlInner> beginGetReportDownloadUrlAsync( + String resourceGroupName, String projectName, String businessCaseName, Object body) { + Mono>> mono + = getReportDownloadUrlWithResponseAsync(resourceGroupName, projectName, businessCaseName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ReportDownloadUrlInner.class, ReportDownloadUrlInner.class, + this.client.getContext()); + } + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 the URL for downloading the business case in a report format. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReportDownloadUrlInner> beginGetReportDownloadUrlAsync( + String resourceGroupName, String projectName, String businessCaseName, Object body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = getReportDownloadUrlWithResponseAsync(resourceGroupName, projectName, businessCaseName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ReportDownloadUrlInner.class, ReportDownloadUrlInner.class, context); + } + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 the URL for downloading the business case in a report format. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReportDownloadUrlInner> + beginGetReportDownloadUrl(String resourceGroupName, String projectName, String businessCaseName, Object body) { + return this.beginGetReportDownloadUrlAsync(resourceGroupName, projectName, businessCaseName, body) + .getSyncPoller(); + } + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 the URL for downloading the business case in a report format. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReportDownloadUrlInner> beginGetReportDownloadUrl( + String resourceGroupName, String projectName, String businessCaseName, Object body, Context context) { + return this.beginGetReportDownloadUrlAsync(resourceGroupName, projectName, businessCaseName, body, context) + .getSyncPoller(); + } + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 URL for downloading the business case in a report format on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getReportDownloadUrlAsync(String resourceGroupName, String projectName, + String businessCaseName, Object body) { + return beginGetReportDownloadUrlAsync(resourceGroupName, projectName, businessCaseName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 URL for downloading the business case in a report format on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getReportDownloadUrlAsync(String resourceGroupName, String projectName, + String businessCaseName, Object body, Context context) { + return beginGetReportDownloadUrlAsync(resourceGroupName, projectName, businessCaseName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 URL for downloading the business case in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReportDownloadUrlInner getReportDownloadUrl(String resourceGroupName, String projectName, + String businessCaseName, Object body) { + return getReportDownloadUrlAsync(resourceGroupName, projectName, businessCaseName, body).block(); + } + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 URL for downloading the business case in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReportDownloadUrlInner getReportDownloadUrl(String resourceGroupName, String projectName, + String businessCaseName, Object body, Context context) { + return getReportDownloadUrlAsync(resourceGroupName, projectName, businessCaseName, 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 BusinessCase 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 BusinessCase 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseOperationsImpl.java new file mode 100644 index 000000000000..16ada2cb4725 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseOperationsImpl.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.BusinessCaseOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.BusinessCaseInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.CompareSummaryInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.ReportDownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.models.BusinessCase; +import com.azure.resourcemanager.migration.assessment.models.BusinessCaseOperations; +import com.azure.resourcemanager.migration.assessment.models.CompareSummary; +import com.azure.resourcemanager.migration.assessment.models.ReportDownloadUrl; + +public final class BusinessCaseOperationsImpl implements BusinessCaseOperations { + private static final ClientLogger LOGGER = new ClientLogger(BusinessCaseOperationsImpl.class); + + private final BusinessCaseOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public BusinessCaseOperationsImpl(BusinessCaseOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner = this.serviceClient().listByParent(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BusinessCaseImpl(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 BusinessCaseImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, projectName, businessCaseName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BusinessCaseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BusinessCase get(String resourceGroupName, String projectName, String businessCaseName) { + BusinessCaseInner inner = this.serviceClient().get(resourceGroupName, projectName, businessCaseName); + if (inner != null) { + return new BusinessCaseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String projectName, String businessCaseName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, projectName, businessCaseName, context); + } + + public void delete(String resourceGroupName, String projectName, String businessCaseName) { + this.serviceClient().delete(resourceGroupName, projectName, businessCaseName); + } + + public CompareSummary compareSummary(String resourceGroupName, String projectName, String businessCaseName, + Object body) { + CompareSummaryInner inner + = this.serviceClient().compareSummary(resourceGroupName, projectName, businessCaseName, body); + if (inner != null) { + return new CompareSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + public CompareSummary compareSummary(String resourceGroupName, String projectName, String businessCaseName, + Object body, Context context) { + CompareSummaryInner inner + = this.serviceClient().compareSummary(resourceGroupName, projectName, businessCaseName, body, context); + if (inner != null) { + return new CompareSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReportDownloadUrl getReportDownloadUrl(String resourceGroupName, String projectName, String businessCaseName, + Object body) { + ReportDownloadUrlInner inner + = this.serviceClient().getReportDownloadUrl(resourceGroupName, projectName, businessCaseName, body); + if (inner != null) { + return new ReportDownloadUrlImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReportDownloadUrl getReportDownloadUrl(String resourceGroupName, String projectName, String businessCaseName, + Object body, Context context) { + ReportDownloadUrlInner inner = this.serviceClient() + .getReportDownloadUrl(resourceGroupName, projectName, businessCaseName, body, context); + if (inner != null) { + return new ReportDownloadUrlImpl(inner, this.manager()); + } else { + return null; + } + } + + public BusinessCase 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 businessCaseName = ResourceManagerUtils.getValueFromIdByName(id, "businessCases"); + if (businessCaseName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'businessCases'.", id))); + } + return this.getWithResponse(resourceGroupName, projectName, businessCaseName, 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 businessCaseName = ResourceManagerUtils.getValueFromIdByName(id, "businessCases"); + if (businessCaseName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'businessCases'.", id))); + } + return this.getWithResponse(resourceGroupName, projectName, businessCaseName, 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 businessCaseName = ResourceManagerUtils.getValueFromIdByName(id, "businessCases"); + if (businessCaseName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'businessCases'.", id))); + } + this.deleteWithResponse(resourceGroupName, projectName, businessCaseName, 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 businessCaseName = ResourceManagerUtils.getValueFromIdByName(id, "businessCases"); + if (businessCaseName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'businessCases'.", id))); + } + return this.deleteWithResponse(resourceGroupName, projectName, businessCaseName, context); + } + + private BusinessCaseOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + public BusinessCaseImpl define(String name) { + return new BusinessCaseImpl(name, this.manager()); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseOverviewSummaryOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseOverviewSummaryOperationsClientImpl.java new file mode 100644 index 000000000000..ef2a283fa18e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseOverviewSummaryOperationsClientImpl.java @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.BusinessCaseOverviewSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.OverviewSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.OverviewSummaryListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * BusinessCaseOverviewSummaryOperationsClient. + */ +public final class BusinessCaseOverviewSummaryOperationsClientImpl + implements BusinessCaseOverviewSummaryOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BusinessCaseOverviewSummaryOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of BusinessCaseOverviewSummaryOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BusinessCaseOverviewSummaryOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(BusinessCaseOverviewSummaryOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * MigrationAssessmentManagementClientBusinessCaseOverviewSummaryOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface BusinessCaseOverviewSummaryOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/overviewSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/overviewSummaries/{overviewSummaryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, + @PathParam("overviewSummaryName") String overviewSummaryName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List OverviewSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 OverviewSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName) { + 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, 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 OverviewSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 OverviewSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List OverviewSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 OverviewSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List OverviewSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 OverviewSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName, Context context) { + return new PagedFlux<>( + () -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); + } + + /** + * List OverviewSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 OverviewSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName)); + } + + /** + * List OverviewSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 OverviewSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, Context context) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName, context)); + } + + /** + * Get a OverviewSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param overviewSummaryName Gets the Name of the Overview 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 OverviewSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String overviewSummaryName) { + 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (overviewSummaryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter overviewSummaryName 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, businessCaseName, overviewSummaryName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a OverviewSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param overviewSummaryName Gets the Name of the Overview 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 OverviewSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String overviewSummaryName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (overviewSummaryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter overviewSummaryName 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, businessCaseName, overviewSummaryName, accept, context); + } + + /** + * Get a OverviewSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param overviewSummaryName Gets the Name of the Overview 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 OverviewSummary on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, String businessCaseName, + String overviewSummaryName) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, overviewSummaryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a OverviewSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param overviewSummaryName Gets the Name of the Overview 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 OverviewSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String overviewSummaryName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, overviewSummaryName, context) + .block(); + } + + /** + * Get a OverviewSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param overviewSummaryName Gets the Name of the Overview 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 OverviewSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OverviewSummaryInner get(String resourceGroupName, String projectName, String businessCaseName, + String overviewSummaryName) { + return getWithResponse(resourceGroupName, projectName, businessCaseName, overviewSummaryName, Context.NONE) + .getValue(); + } + + /** + * 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 OverviewSummary 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 OverviewSummary 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseOverviewSummaryOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseOverviewSummaryOperationsImpl.java new file mode 100644 index 000000000000..24b2635bf453 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCaseOverviewSummaryOperationsImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.BusinessCaseOverviewSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.OverviewSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.BusinessCaseOverviewSummaryOperations; +import com.azure.resourcemanager.migration.assessment.models.OverviewSummary; + +public final class BusinessCaseOverviewSummaryOperationsImpl implements BusinessCaseOverviewSummaryOperations { + private static final ClientLogger LOGGER = new ClientLogger(BusinessCaseOverviewSummaryOperationsImpl.class); + + private final BusinessCaseOverviewSummaryOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public BusinessCaseOverviewSummaryOperationsImpl(BusinessCaseOverviewSummaryOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, businessCaseName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OverviewSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, Context context) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, businessCaseName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OverviewSummaryImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String overviewSummaryName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, businessCaseName, overviewSummaryName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OverviewSummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OverviewSummary get(String resourceGroupName, String projectName, String businessCaseName, + String overviewSummaryName) { + OverviewSummaryInner inner + = this.serviceClient().get(resourceGroupName, projectName, businessCaseName, overviewSummaryName); + if (inner != null) { + return new OverviewSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + private BusinessCaseOverviewSummaryOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCasePaasSummaryOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCasePaasSummaryOperationsClientImpl.java new file mode 100644 index 000000000000..8bdc731bc1f1 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCasePaasSummaryOperationsClientImpl.java @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.BusinessCasePaasSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.PaasSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.PaasSummaryListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BusinessCasePaasSummaryOperationsClient. + */ +public final class BusinessCasePaasSummaryOperationsClientImpl implements BusinessCasePaasSummaryOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BusinessCasePaasSummaryOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of BusinessCasePaasSummaryOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BusinessCasePaasSummaryOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(BusinessCasePaasSummaryOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientBusinessCasePaasSummaryOperations + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface BusinessCasePaasSummaryOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/paasSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/paasSummaries/{paasSummaryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, + @PathParam("paasSummaryName") String paasSummaryName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List PaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 PaasSummary list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName) { + 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, 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 PaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 PaasSummary list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List PaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 PaasSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List PaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 PaasSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName, Context context) { + return new PagedFlux<>( + () -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); + } + + /** + * List PaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 PaasSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName)); + } + + /** + * List PaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 PaasSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, Context context) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName, context)); + } + + /** + * Get a PaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param paasSummaryName Gets the Name of the Paas 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 PaasSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String paasSummaryName) { + 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (paasSummaryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter paasSummaryName 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, businessCaseName, paasSummaryName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a PaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param paasSummaryName Gets the Name of the Paas 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 PaasSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String paasSummaryName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (paasSummaryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter paasSummaryName 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, businessCaseName, paasSummaryName, accept, context); + } + + /** + * Get a PaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param paasSummaryName Gets the Name of the Paas 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 PaasSummary on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, String businessCaseName, + String paasSummaryName) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, paasSummaryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a PaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param paasSummaryName Gets the Name of the Paas 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 PaasSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String paasSummaryName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, paasSummaryName, context).block(); + } + + /** + * Get a PaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param paasSummaryName Gets the Name of the Paas 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 PaasSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PaasSummaryInner get(String resourceGroupName, String projectName, String businessCaseName, + String paasSummaryName) { + return getWithResponse(resourceGroupName, projectName, businessCaseName, paasSummaryName, Context.NONE) + .getValue(); + } + + /** + * 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 PaasSummary 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 PaasSummary 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCasePaasSummaryOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCasePaasSummaryOperationsImpl.java new file mode 100644 index 000000000000..fcc4f990a195 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/BusinessCasePaasSummaryOperationsImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.BusinessCasePaasSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.PaasSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.BusinessCasePaasSummaryOperations; +import com.azure.resourcemanager.migration.assessment.models.PaasSummary; + +public final class BusinessCasePaasSummaryOperationsImpl implements BusinessCasePaasSummaryOperations { + private static final ClientLogger LOGGER = new ClientLogger(BusinessCasePaasSummaryOperationsImpl.class); + + private final BusinessCasePaasSummaryOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public BusinessCasePaasSummaryOperationsImpl(BusinessCasePaasSummaryOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, businessCaseName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PaasSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, Context context) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, businessCaseName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PaasSummaryImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + String paasSummaryName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, businessCaseName, paasSummaryName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PaasSummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PaasSummary get(String resourceGroupName, String projectName, String businessCaseName, + String paasSummaryName) { + PaasSummaryInner inner + = this.serviceClient().get(resourceGroupName, projectName, businessCaseName, paasSummaryName); + if (inner != null) { + return new PaasSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + private BusinessCasePaasSummaryOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompareSummaryImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompareSummaryImpl.java new file mode 100644 index 000000000000..63663d4d74da --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompareSummaryImpl.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.resourcemanager.migration.assessment.fluent.models.CompareSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.CarbonEmissionsDetails; +import com.azure.resourcemanager.migration.assessment.models.CompareSummary; +import com.azure.resourcemanager.migration.assessment.models.CostDetails; + +public final class CompareSummaryImpl implements CompareSummary { + private CompareSummaryInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + CompareSummaryImpl(CompareSummaryInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public CostDetails azurePaasCostDetails() { + return this.innerModel().azurePaasCostDetails(); + } + + public CostDetails azureIaasCostDetails() { + return this.innerModel().azureIaasCostDetails(); + } + + public CostDetails azureAvsCostDetails() { + return this.innerModel().azureAvsCostDetails(); + } + + public CostDetails onPremisesPaasCostDetails() { + return this.innerModel().onPremisesPaasCostDetails(); + } + + public CostDetails onPremisesIaasCostDetails() { + return this.innerModel().onPremisesIaasCostDetails(); + } + + public CostDetails onPremisesAvsCostDetails() { + return this.innerModel().onPremisesAvsCostDetails(); + } + + public CostDetails onPremisesPaasDecommissionedCostDetails() { + return this.innerModel().onPremisesPaasDecommissionedCostDetails(); + } + + public CostDetails onPremisesIaasDecommissionedCostDetails() { + return this.innerModel().onPremisesIaasDecommissionedCostDetails(); + } + + public CostDetails onPremisesAvsDecommissionedCostDetails() { + return this.innerModel().onPremisesAvsDecommissionedCostDetails(); + } + + public CostDetails futureCostDetails() { + return this.innerModel().futureCostDetails(); + } + + public CostDetails azureArcEnabledOnPremisesCostDetails() { + return this.innerModel().azureArcEnabledOnPremisesCostDetails(); + } + + public CostDetails futureAzureArcEnabledOnPremisesCostDetails() { + return this.innerModel().futureAzureArcEnabledOnPremisesCostDetails(); + } + + public CarbonEmissionsDetails azurePaasCarbonEmissionsDetails() { + return this.innerModel().azurePaasCarbonEmissionsDetails(); + } + + public CarbonEmissionsDetails azureIaasCarbonEmissionsDetails() { + return this.innerModel().azureIaasCarbonEmissionsDetails(); + } + + public CarbonEmissionsDetails azureAvsCarbonEmissionsDetails() { + return this.innerModel().azureAvsCarbonEmissionsDetails(); + } + + public CarbonEmissionsDetails onPremisesPaasCarbonEmissionsDetails() { + return this.innerModel().onPremisesPaasCarbonEmissionsDetails(); + } + + public CarbonEmissionsDetails onPremisesIaasCarbonEmissionsDetails() { + return this.innerModel().onPremisesIaasCarbonEmissionsDetails(); + } + + public CarbonEmissionsDetails onPremisesAvsCarbonEmissionsDetails() { + return this.innerModel().onPremisesAvsCarbonEmissionsDetails(); + } + + public CarbonEmissionsDetails onPremisesPaasDecommissionedCarbonEmissionsDetails() { + return this.innerModel().onPremisesPaasDecommissionedCarbonEmissionsDetails(); + } + + public CarbonEmissionsDetails onPremisesIaasDecommissionedCarbonEmissionsDetails() { + return this.innerModel().onPremisesIaasDecommissionedCarbonEmissionsDetails(); + } + + public CarbonEmissionsDetails onPremisesAvsDecommissionedCarbonEmissionsDetails() { + return this.innerModel().onPremisesAvsDecommissionedCarbonEmissionsDetails(); + } + + public CompareSummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompoundAssessmentImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompoundAssessmentImpl.java new file mode 100644 index 000000000000..5433a5cf29c8 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompoundAssessmentImpl.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.CompoundAssessmentInner; +import com.azure.resourcemanager.migration.assessment.models.CompoundAssessment; +import com.azure.resourcemanager.migration.assessment.models.CompoundAssessmentProperties; +import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; + +public final class CompoundAssessmentImpl implements CompoundAssessment, CompoundAssessment.Definition { + private CompoundAssessmentInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + CompoundAssessmentImpl(CompoundAssessmentInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 CompoundAssessmentProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public CompoundAssessmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String projectName; + + private String compoundAssessmentName; + + public CompoundAssessmentImpl withExistingAssessmentProject(String resourceGroupName, String projectName) { + this.resourceGroupName = resourceGroupName; + this.projectName = projectName; + return this; + } + + public CompoundAssessment create() { + this.innerObject = serviceManager.serviceClient() + .getCompoundAssessmentOperations() + .create(resourceGroupName, projectName, compoundAssessmentName, this.innerModel(), Context.NONE); + return this; + } + + public CompoundAssessment create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCompoundAssessmentOperations() + .create(resourceGroupName, projectName, compoundAssessmentName, this.innerModel(), context); + return this; + } + + CompoundAssessmentImpl(String name, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerObject = new CompoundAssessmentInner(); + this.serviceManager = serviceManager; + this.compoundAssessmentName = name; + } + + public CompoundAssessment refresh() { + this.innerObject = serviceManager.serviceClient() + .getCompoundAssessmentOperations() + .getWithResponse(resourceGroupName, projectName, compoundAssessmentName, Context.NONE) + .getValue(); + return this; + } + + public CompoundAssessment refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCompoundAssessmentOperations() + .getWithResponse(resourceGroupName, projectName, compoundAssessmentName, context) + .getValue(); + return this; + } + + public DownloadUrl downloadUrl(Object body) { + return serviceManager.compoundAssessmentOperations() + .downloadUrl(resourceGroupName, projectName, compoundAssessmentName, body); + } + + public DownloadUrl downloadUrl(Object body, Context context) { + return serviceManager.compoundAssessmentOperations() + .downloadUrl(resourceGroupName, projectName, compoundAssessmentName, body, context); + } + + public CompoundAssessmentImpl withProperties(CompoundAssessmentProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompoundAssessmentOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompoundAssessmentOperationsClientImpl.java new file mode 100644 index 000000000000..6b0aeb176296 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompoundAssessmentOperationsClientImpl.java @@ -0,0 +1,1095 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.CompoundAssessmentOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.CompoundAssessmentInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.models.CompoundAssessmentListResult; +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 CompoundAssessmentOperationsClient. + */ +public final class CompoundAssessmentOperationsClientImpl implements CompoundAssessmentOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CompoundAssessmentOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of CompoundAssessmentOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CompoundAssessmentOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(CompoundAssessmentOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientCompoundAssessmentOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface CompoundAssessmentOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/webAppCompoundAssessments/{compoundAssessmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("compoundAssessmentName") String compoundAssessmentName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("compoundAssessmentName") String compoundAssessmentName, + @BodyParam("application/json") CompoundAssessmentInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("compoundAssessmentName") String compoundAssessmentName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/downloadUrl") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> downloadUrl(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("compoundAssessmentName") String compoundAssessmentName, + @BodyParam("application/json") Object body, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List CompoundAssessment 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 CompoundAssessment 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 CompoundAssessment 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 CompoundAssessment 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 CompoundAssessment 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 CompoundAssessment 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 CompoundAssessment 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 CompoundAssessment 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 CompoundAssessment 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 CompoundAssessment 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 CompoundAssessment 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 CompoundAssessment 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 a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 CompoundAssessment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String compoundAssessmentName) { + 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 (compoundAssessmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter compoundAssessmentName 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, compoundAssessmentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 CompoundAssessment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String compoundAssessmentName, 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 (compoundAssessmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter compoundAssessmentName 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, compoundAssessmentName, accept, context); + } + + /** + * Get a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 CompoundAssessment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, + String compoundAssessmentName) { + return getWithResponseAsync(resourceGroupName, projectName, compoundAssessmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 CompoundAssessment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String compoundAssessmentName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, compoundAssessmentName, context).block(); + } + + /** + * Get a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 CompoundAssessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CompoundAssessmentInner get(String resourceGroupName, String projectName, String compoundAssessmentName) { + return getWithResponse(resourceGroupName, projectName, compoundAssessmentName, Context.NONE).getValue(); + } + + /** + * Create a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compound assessment resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String compoundAssessmentName, CompoundAssessmentInner 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 (compoundAssessmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter compoundAssessmentName 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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, compoundAssessmentName, resource, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compound assessment resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String compoundAssessmentName, CompoundAssessmentInner 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 (compoundAssessmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter compoundAssessmentName 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, compoundAssessmentName, resource, accept, context); + } + + /** + * Create a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compound assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CompoundAssessmentInner> beginCreateAsync( + String resourceGroupName, String projectName, String compoundAssessmentName, CompoundAssessmentInner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, compoundAssessmentName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CompoundAssessmentInner.class, CompoundAssessmentInner.class, + this.client.getContext()); + } + + /** + * Create a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compound assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CompoundAssessmentInner> beginCreateAsync( + String resourceGroupName, String projectName, String compoundAssessmentName, CompoundAssessmentInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, compoundAssessmentName, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CompoundAssessmentInner.class, CompoundAssessmentInner.class, context); + } + + /** + * Create a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compound assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CompoundAssessmentInner> beginCreate( + String resourceGroupName, String projectName, String compoundAssessmentName, CompoundAssessmentInner resource) { + return this.beginCreateAsync(resourceGroupName, projectName, compoundAssessmentName, resource).getSyncPoller(); + } + + /** + * Create a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compound assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CompoundAssessmentInner> beginCreate( + String resourceGroupName, String projectName, String compoundAssessmentName, CompoundAssessmentInner resource, + Context context) { + return this.beginCreateAsync(resourceGroupName, projectName, compoundAssessmentName, resource, context) + .getSyncPoller(); + } + + /** + * Create a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compound assessment resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, + String compoundAssessmentName, CompoundAssessmentInner resource) { + return beginCreateAsync(resourceGroupName, projectName, compoundAssessmentName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compound assessment resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, + String compoundAssessmentName, CompoundAssessmentInner resource, Context context) { + return beginCreateAsync(resourceGroupName, projectName, compoundAssessmentName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compound assessment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CompoundAssessmentInner create(String resourceGroupName, String projectName, String compoundAssessmentName, + CompoundAssessmentInner resource) { + return createAsync(resourceGroupName, projectName, compoundAssessmentName, resource).block(); + } + + /** + * Create a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compound assessment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CompoundAssessmentInner create(String resourceGroupName, String projectName, String compoundAssessmentName, + CompoundAssessmentInner resource, Context context) { + return createAsync(resourceGroupName, projectName, compoundAssessmentName, resource, context).block(); + } + + /** + * Delete a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compoundAssessmentName) { + 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 (compoundAssessmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter compoundAssessmentName 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, compoundAssessmentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compoundAssessmentName, 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 (compoundAssessmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter compoundAssessmentName 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, compoundAssessmentName, accept, context); + } + + /** + * Delete a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compoundAssessmentName) { + return deleteWithResponseAsync(resourceGroupName, projectName, compoundAssessmentName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compoundAssessmentName, Context context) { + return deleteWithResponseAsync(resourceGroupName, projectName, compoundAssessmentName, context).block(); + } + + /** + * Delete a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compoundAssessmentName) { + deleteWithResponse(resourceGroupName, projectName, compoundAssessmentName, Context.NONE); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> downloadUrlWithResponseAsync(String resourceGroupName, String projectName, + String compoundAssessmentName, Object 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 (compoundAssessmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter compoundAssessmentName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.downloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, compoundAssessmentName, body, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> downloadUrlWithResponseAsync(String resourceGroupName, String projectName, + String compoundAssessmentName, Object 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 (compoundAssessmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter compoundAssessmentName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.downloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, compoundAssessmentName, body, accept, + context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DownloadUrlInner> beginDownloadUrlAsync(String resourceGroupName, + String projectName, String compoundAssessmentName, Object body) { + Mono>> mono + = downloadUrlWithResponseAsync(resourceGroupName, projectName, compoundAssessmentName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DownloadUrlInner.class, DownloadUrlInner.class, this.client.getContext()); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DownloadUrlInner> beginDownloadUrlAsync(String resourceGroupName, + String projectName, String compoundAssessmentName, Object body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = downloadUrlWithResponseAsync(resourceGroupName, projectName, compoundAssessmentName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DownloadUrlInner.class, DownloadUrlInner.class, context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String compoundAssessmentName, Object body) { + return this.beginDownloadUrlAsync(resourceGroupName, projectName, compoundAssessmentName, body).getSyncPoller(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String compoundAssessmentName, Object body, Context context) { + return this.beginDownloadUrlAsync(resourceGroupName, projectName, compoundAssessmentName, body, context) + .getSyncPoller(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono downloadUrlAsync(String resourceGroupName, String projectName, + String compoundAssessmentName, Object body) { + return beginDownloadUrlAsync(resourceGroupName, projectName, compoundAssessmentName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono downloadUrlAsync(String resourceGroupName, String projectName, + String compoundAssessmentName, Object body, Context context) { + return beginDownloadUrlAsync(resourceGroupName, projectName, compoundAssessmentName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String compoundAssessmentName, + Object body) { + return downloadUrlAsync(resourceGroupName, projectName, compoundAssessmentName, body).block(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String compoundAssessmentName, + Object body, Context context) { + return downloadUrlAsync(resourceGroupName, projectName, compoundAssessmentName, 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 CompoundAssessment 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 CompoundAssessment 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompoundAssessmentOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompoundAssessmentOperationsImpl.java new file mode 100644 index 000000000000..06f52f51813c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompoundAssessmentOperationsImpl.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.CompoundAssessmentOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.CompoundAssessmentInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.models.CompoundAssessment; +import com.azure.resourcemanager.migration.assessment.models.CompoundAssessmentOperations; +import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; + +public final class CompoundAssessmentOperationsImpl implements CompoundAssessmentOperations { + private static final ClientLogger LOGGER = new ClientLogger(CompoundAssessmentOperationsImpl.class); + + private final CompoundAssessmentOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public CompoundAssessmentOperationsImpl(CompoundAssessmentOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CompoundAssessmentImpl(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 CompoundAssessmentImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String compoundAssessmentName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, projectName, compoundAssessmentName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CompoundAssessmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CompoundAssessment get(String resourceGroupName, String projectName, String compoundAssessmentName) { + CompoundAssessmentInner inner + = this.serviceClient().get(resourceGroupName, projectName, compoundAssessmentName); + if (inner != null) { + return new CompoundAssessmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String projectName, + String compoundAssessmentName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, projectName, compoundAssessmentName, context); + } + + public void delete(String resourceGroupName, String projectName, String compoundAssessmentName) { + this.serviceClient().delete(resourceGroupName, projectName, compoundAssessmentName); + } + + public DownloadUrl downloadUrl(String resourceGroupName, String projectName, String compoundAssessmentName, + Object body) { + DownloadUrlInner inner + = this.serviceClient().downloadUrl(resourceGroupName, projectName, compoundAssessmentName, body); + if (inner != null) { + return new DownloadUrlImpl(inner, this.manager()); + } else { + return null; + } + } + + public DownloadUrl downloadUrl(String resourceGroupName, String projectName, String compoundAssessmentName, + Object body, Context context) { + DownloadUrlInner inner + = this.serviceClient().downloadUrl(resourceGroupName, projectName, compoundAssessmentName, body, context); + if (inner != null) { + return new DownloadUrlImpl(inner, this.manager()); + } else { + return null; + } + } + + public CompoundAssessment 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 compoundAssessmentName = ResourceManagerUtils.getValueFromIdByName(id, "webAppCompoundAssessments"); + if (compoundAssessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'webAppCompoundAssessments'.", id))); + } + return this.getWithResponse(resourceGroupName, projectName, compoundAssessmentName, 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 compoundAssessmentName = ResourceManagerUtils.getValueFromIdByName(id, "webAppCompoundAssessments"); + if (compoundAssessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'webAppCompoundAssessments'.", id))); + } + return this.getWithResponse(resourceGroupName, projectName, compoundAssessmentName, 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 compoundAssessmentName = ResourceManagerUtils.getValueFromIdByName(id, "webAppCompoundAssessments"); + if (compoundAssessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'webAppCompoundAssessments'.", id))); + } + this.deleteWithResponse(resourceGroupName, projectName, compoundAssessmentName, 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 compoundAssessmentName = ResourceManagerUtils.getValueFromIdByName(id, "webAppCompoundAssessments"); + if (compoundAssessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'webAppCompoundAssessments'.", id))); + } + return this.deleteWithResponse(resourceGroupName, projectName, compoundAssessmentName, context); + } + + private CompoundAssessmentOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + public CompoundAssessmentImpl define(String name) { + return new CompoundAssessmentImpl(name, this.manager()); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompoundAssessmentSummaryOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompoundAssessmentSummaryOperationsClientImpl.java new file mode 100644 index 000000000000..6333a2fce5a1 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompoundAssessmentSummaryOperationsClientImpl.java @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.CompoundAssessmentSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppCompoundAssessmentSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.WebAppCompoundAssessmentSummaryListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CompoundAssessmentSummaryOperationsClient. + */ +public final class CompoundAssessmentSummaryOperationsClientImpl implements CompoundAssessmentSummaryOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CompoundAssessmentSummaryOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of CompoundAssessmentSummaryOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CompoundAssessmentSummaryOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(CompoundAssessmentSummaryOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * MigrationAssessmentManagementClientCompoundAssessmentSummaryOperations to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface CompoundAssessmentSummaryOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("compoundAssessmentName") String compoundAssessmentName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("compoundAssessmentName") String compoundAssessmentName, + @PathParam("summaryName") String summaryName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 WebAppCompoundAssessmentSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByParentSinglePageAsync(String resourceGroupName, String projectName, String compoundAssessmentName) { + 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 (compoundAssessmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter compoundAssessmentName 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, compoundAssessmentName, 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 WebAppCompoundAssessmentSummary resources by CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 WebAppCompoundAssessmentSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync( + String resourceGroupName, String projectName, String compoundAssessmentName, 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 (compoundAssessmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter compoundAssessmentName 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, compoundAssessmentName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 WebAppCompoundAssessmentSummary list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, + String projectName, String compoundAssessmentName) { + return new PagedFlux<>( + () -> listByParentSinglePageAsync(resourceGroupName, projectName, compoundAssessmentName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 WebAppCompoundAssessmentSummary list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, + String projectName, String compoundAssessmentName, Context context) { + return new PagedFlux<>( + () -> listByParentSinglePageAsync(resourceGroupName, projectName, compoundAssessmentName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); + } + + /** + * List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 WebAppCompoundAssessmentSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, + String projectName, String compoundAssessmentName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, compoundAssessmentName)); + } + + /** + * List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 WebAppCompoundAssessmentSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, + String projectName, String compoundAssessmentName, Context context) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, compoundAssessmentName, context)); + } + + /** + * Get a WebAppCompoundAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment ARM name. + * @param summaryName Gets the Name of the WebApp compound assessment 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 WebAppCompoundAssessmentSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String projectName, String compoundAssessmentName, 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 (compoundAssessmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter compoundAssessmentName 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, compoundAssessmentName, summaryName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a WebAppCompoundAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment ARM name. + * @param summaryName Gets the Name of the WebApp compound assessment 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 WebAppCompoundAssessmentSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String projectName, String compoundAssessmentName, 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 (compoundAssessmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter compoundAssessmentName 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, compoundAssessmentName, summaryName, accept, context); + } + + /** + * Get a WebAppCompoundAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment ARM name. + * @param summaryName Gets the Name of the WebApp compound assessment 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 WebAppCompoundAssessmentSummary on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, + String compoundAssessmentName, String summaryName) { + return getWithResponseAsync(resourceGroupName, projectName, compoundAssessmentName, summaryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a WebAppCompoundAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment ARM name. + * @param summaryName Gets the Name of the WebApp compound assessment 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 WebAppCompoundAssessmentSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String compoundAssessmentName, String summaryName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, compoundAssessmentName, summaryName, context) + .block(); + } + + /** + * Get a WebAppCompoundAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment ARM name. + * @param summaryName Gets the Name of the WebApp compound assessment 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 WebAppCompoundAssessmentSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebAppCompoundAssessmentSummaryInner get(String resourceGroupName, String projectName, + String compoundAssessmentName, String summaryName) { + return getWithResponse(resourceGroupName, projectName, compoundAssessmentName, summaryName, Context.NONE) + .getValue(); + } + + /** + * 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 WebAppCompoundAssessmentSummary 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 WebAppCompoundAssessmentSummary 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompoundAssessmentSummaryOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompoundAssessmentSummaryOperationsImpl.java new file mode 100644 index 000000000000..4bb95b08a6e9 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/CompoundAssessmentSummaryOperationsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.CompoundAssessmentSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppCompoundAssessmentSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.CompoundAssessmentSummaryOperations; +import com.azure.resourcemanager.migration.assessment.models.WebAppCompoundAssessmentSummary; + +public final class CompoundAssessmentSummaryOperationsImpl implements CompoundAssessmentSummaryOperations { + private static final ClientLogger LOGGER = new ClientLogger(CompoundAssessmentSummaryOperationsImpl.class); + + private final CompoundAssessmentSummaryOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public CompoundAssessmentSummaryOperationsImpl(CompoundAssessmentSummaryOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String compoundAssessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, compoundAssessmentName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new WebAppCompoundAssessmentSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String compoundAssessmentName, Context context) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, compoundAssessmentName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new WebAppCompoundAssessmentSummaryImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String compoundAssessmentName, String summaryName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, compoundAssessmentName, summaryName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WebAppCompoundAssessmentSummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WebAppCompoundAssessmentSummary get(String resourceGroupName, String projectName, + String compoundAssessmentName, String summaryName) { + WebAppCompoundAssessmentSummaryInner inner + = this.serviceClient().get(resourceGroupName, projectName, compoundAssessmentName, summaryName); + if (inner != null) { + return new WebAppCompoundAssessmentSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + private CompoundAssessmentSummaryOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedAvsMachineImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedAvsMachineImpl.java new file mode 100644 index 000000000000..82a8939b5529 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedAvsMachineImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedAvsMachineInner; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedAvsMachine; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedAvsMachineProperties; + +public final class EvaluatedAvsMachineImpl implements EvaluatedAvsMachine { + private EvaluatedAvsMachineInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + EvaluatedAvsMachineImpl(EvaluatedAvsMachineInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 EvaluatedAvsMachineProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public EvaluatedAvsMachineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedAvsMachinesOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedAvsMachinesOperationsClientImpl.java new file mode 100644 index 000000000000..db9f7403bdc6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedAvsMachinesOperationsClientImpl.java @@ -0,0 +1,517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.EvaluatedAvsMachinesOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedAvsMachineInner; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedAvsMachineListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EvaluatedAvsMachinesOperationsClient. + */ +public final class EvaluatedAvsMachinesOperationsClientImpl implements EvaluatedAvsMachinesOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final EvaluatedAvsMachinesOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of EvaluatedAvsMachinesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EvaluatedAvsMachinesOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(EvaluatedAvsMachinesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientEvaluatedAvsMachinesOperations to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface EvaluatedAvsMachinesOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/evaluatedAvsMachines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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("businessCaseName") String businessCaseName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/evaluatedAvsMachines/{evaluatedAvsMachineName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, + @PathParam("evaluatedAvsMachineName") String evaluatedAvsMachineName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List EvaluatedAvsMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedAvsMachine list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, 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 EvaluatedAvsMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedAvsMachine list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EvaluatedAvsMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedAvsMachine list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, + filter, pageSize, continuationToken, totalRecordCount), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List EvaluatedAvsMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedAvsMachine list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName) { + final String filter = null; + final Integer pageSize = null; + final String continuationToken = null; + final Integer totalRecordCount = null; + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, + filter, pageSize, continuationToken, totalRecordCount), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List EvaluatedAvsMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedAvsMachine list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context) { + return new PagedFlux<>( + () -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, filter, pageSize, + continuationToken, totalRecordCount, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); + } + + /** + * List EvaluatedAvsMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedAvsMachine list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + final String filter = null; + final Integer pageSize = null; + final String continuationToken = null; + final Integer totalRecordCount = null; + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName, filter, pageSize, + continuationToken, totalRecordCount)); + } + + /** + * List EvaluatedAvsMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedAvsMachine list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName, filter, pageSize, + continuationToken, totalRecordCount, context)); + } + + /** + * Get a EvaluatedAvsMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedAvsMachineName Business case Evaluated AVS 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 EvaluatedAvsMachine along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedAvsMachineName) { + 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (evaluatedAvsMachineName == null) { + return Mono.error( + new IllegalArgumentException("Parameter evaluatedAvsMachineName 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, businessCaseName, + evaluatedAvsMachineName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EvaluatedAvsMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedAvsMachineName Business case Evaluated AVS 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 EvaluatedAvsMachine along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedAvsMachineName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (evaluatedAvsMachineName == null) { + return Mono.error( + new IllegalArgumentException("Parameter evaluatedAvsMachineName 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, businessCaseName, evaluatedAvsMachineName, accept, context); + } + + /** + * Get a EvaluatedAvsMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedAvsMachineName Business case Evaluated AVS 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 EvaluatedAvsMachine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedAvsMachineName) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, evaluatedAvsMachineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EvaluatedAvsMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedAvsMachineName Business case Evaluated AVS 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 EvaluatedAvsMachine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedAvsMachineName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, evaluatedAvsMachineName, context) + .block(); + } + + /** + * Get a EvaluatedAvsMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedAvsMachineName Business case Evaluated AVS 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 EvaluatedAvsMachine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EvaluatedAvsMachineInner get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedAvsMachineName) { + return getWithResponse(resourceGroupName, projectName, businessCaseName, evaluatedAvsMachineName, Context.NONE) + .getValue(); + } + + /** + * 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 EvaluatedAvsMachine 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 EvaluatedAvsMachine 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedAvsMachinesOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedAvsMachinesOperationsImpl.java new file mode 100644 index 000000000000..236adca05cdd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedAvsMachinesOperationsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.EvaluatedAvsMachinesOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedAvsMachineInner; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedAvsMachine; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedAvsMachinesOperations; + +public final class EvaluatedAvsMachinesOperationsImpl implements EvaluatedAvsMachinesOperations { + private static final ClientLogger LOGGER = new ClientLogger(EvaluatedAvsMachinesOperationsImpl.class); + + private final EvaluatedAvsMachinesOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public EvaluatedAvsMachinesOperationsImpl(EvaluatedAvsMachinesOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, businessCaseName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EvaluatedAvsMachineImpl(inner1, this.manager())); + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context) { + PagedIterable inner = this.serviceClient() + .listByParent(resourceGroupName, projectName, businessCaseName, filter, pageSize, continuationToken, + totalRecordCount, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EvaluatedAvsMachineImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedAvsMachineName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, businessCaseName, evaluatedAvsMachineName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EvaluatedAvsMachineImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EvaluatedAvsMachine get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedAvsMachineName) { + EvaluatedAvsMachineInner inner + = this.serviceClient().get(resourceGroupName, projectName, businessCaseName, evaluatedAvsMachineName); + if (inner != null) { + return new EvaluatedAvsMachineImpl(inner, this.manager()); + } else { + return null; + } + } + + private EvaluatedAvsMachinesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedMachineImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedMachineImpl.java new file mode 100644 index 000000000000..2ce3147c9960 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedMachineImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedMachineInner; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedMachine; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedMachineProperties; + +public final class EvaluatedMachineImpl implements EvaluatedMachine { + private EvaluatedMachineInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + EvaluatedMachineImpl(EvaluatedMachineInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 EvaluatedMachineProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public EvaluatedMachineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedMachinesOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedMachinesOperationsClientImpl.java new file mode 100644 index 000000000000..64c20a805097 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedMachinesOperationsClientImpl.java @@ -0,0 +1,517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.EvaluatedMachinesOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedMachineInner; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedMachineListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EvaluatedMachinesOperationsClient. + */ +public final class EvaluatedMachinesOperationsClientImpl implements EvaluatedMachinesOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final EvaluatedMachinesOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of EvaluatedMachinesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EvaluatedMachinesOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(EvaluatedMachinesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientEvaluatedMachinesOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface EvaluatedMachinesOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/evaluatedMachines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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("businessCaseName") String businessCaseName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/evaluatedMachines/{evaluatedMachineName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, + @PathParam("evaluatedMachineName") String evaluatedMachineName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List EvaluatedMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedMachine list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, 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 EvaluatedMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedMachine list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EvaluatedMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedMachine list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, + filter, pageSize, continuationToken, totalRecordCount), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List EvaluatedMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedMachine list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName) { + final String filter = null; + final Integer pageSize = null; + final String continuationToken = null; + final Integer totalRecordCount = null; + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, + filter, pageSize, continuationToken, totalRecordCount), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List EvaluatedMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedMachine list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context) { + return new PagedFlux<>( + () -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, filter, pageSize, + continuationToken, totalRecordCount, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); + } + + /** + * List EvaluatedMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedMachine list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + final String filter = null; + final Integer pageSize = null; + final String continuationToken = null; + final Integer totalRecordCount = null; + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName, filter, pageSize, + continuationToken, totalRecordCount)); + } + + /** + * List EvaluatedMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedMachine list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName, filter, pageSize, + continuationToken, totalRecordCount, context)); + } + + /** + * Get a EvaluatedMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedMachineName Business case Evaluated 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 EvaluatedMachine along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedMachineName) { + 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (evaluatedMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter evaluatedMachineName 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, businessCaseName, evaluatedMachineName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EvaluatedMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedMachineName Business case Evaluated 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 EvaluatedMachine along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedMachineName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (evaluatedMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter evaluatedMachineName 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, businessCaseName, evaluatedMachineName, accept, context); + } + + /** + * Get a EvaluatedMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedMachineName Business case Evaluated 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 EvaluatedMachine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedMachineName) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, evaluatedMachineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EvaluatedMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedMachineName Business case Evaluated 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 EvaluatedMachine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedMachineName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, evaluatedMachineName, context) + .block(); + } + + /** + * Get a EvaluatedMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedMachineName Business case Evaluated 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 EvaluatedMachine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EvaluatedMachineInner get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedMachineName) { + return getWithResponse(resourceGroupName, projectName, businessCaseName, evaluatedMachineName, Context.NONE) + .getValue(); + } + + /** + * 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 EvaluatedMachine 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 EvaluatedMachine 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedMachinesOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedMachinesOperationsImpl.java new file mode 100644 index 000000000000..f06ed2c03034 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedMachinesOperationsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.EvaluatedMachinesOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedMachineInner; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedMachine; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedMachinesOperations; + +public final class EvaluatedMachinesOperationsImpl implements EvaluatedMachinesOperations { + private static final ClientLogger LOGGER = new ClientLogger(EvaluatedMachinesOperationsImpl.class); + + private final EvaluatedMachinesOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public EvaluatedMachinesOperationsImpl(EvaluatedMachinesOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, businessCaseName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EvaluatedMachineImpl(inner1, this.manager())); + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context) { + PagedIterable inner = this.serviceClient() + .listByParent(resourceGroupName, projectName, businessCaseName, filter, pageSize, continuationToken, + totalRecordCount, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EvaluatedMachineImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedMachineName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, businessCaseName, evaluatedMachineName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EvaluatedMachineImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EvaluatedMachine get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedMachineName) { + EvaluatedMachineInner inner + = this.serviceClient().get(resourceGroupName, projectName, businessCaseName, evaluatedMachineName); + if (inner != null) { + return new EvaluatedMachineImpl(inner, this.manager()); + } else { + return null; + } + } + + private EvaluatedMachinesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedSqlEntitiesOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedSqlEntitiesOperationsClientImpl.java new file mode 100644 index 000000000000..94eed34e3467 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedSqlEntitiesOperationsClientImpl.java @@ -0,0 +1,517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.EvaluatedSqlEntitiesOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedSqlEntityInner; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedSqlEntityListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EvaluatedSqlEntitiesOperationsClient. + */ +public final class EvaluatedSqlEntitiesOperationsClientImpl implements EvaluatedSqlEntitiesOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final EvaluatedSqlEntitiesOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of EvaluatedSqlEntitiesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EvaluatedSqlEntitiesOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(EvaluatedSqlEntitiesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientEvaluatedSqlEntitiesOperations to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface EvaluatedSqlEntitiesOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/evaluatedSqlEntities") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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("businessCaseName") String businessCaseName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/evaluatedSqlEntities/{evaluatedSqlEntityName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, + @PathParam("evaluatedSqlEntityName") String evaluatedSqlEntityName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List EvaluatedSqlEntity resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedSqlEntity list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, 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 EvaluatedSqlEntity resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedSqlEntity list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EvaluatedSqlEntity resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedSqlEntity list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, + filter, pageSize, continuationToken, totalRecordCount), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List EvaluatedSqlEntity resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedSqlEntity list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName) { + final String filter = null; + final Integer pageSize = null; + final String continuationToken = null; + final Integer totalRecordCount = null; + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, + filter, pageSize, continuationToken, totalRecordCount), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List EvaluatedSqlEntity resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedSqlEntity list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context) { + return new PagedFlux<>( + () -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, filter, pageSize, + continuationToken, totalRecordCount, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); + } + + /** + * List EvaluatedSqlEntity resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedSqlEntity list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + final String filter = null; + final Integer pageSize = null; + final String continuationToken = null; + final Integer totalRecordCount = null; + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName, filter, pageSize, + continuationToken, totalRecordCount)); + } + + /** + * List EvaluatedSqlEntity resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedSqlEntity list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName, filter, pageSize, + continuationToken, totalRecordCount, context)); + } + + /** + * Get a EvaluatedSqlEntity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedSqlEntityName Business case Evaluated sql entity 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 EvaluatedSqlEntity along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedSqlEntityName) { + 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (evaluatedSqlEntityName == null) { + return Mono.error( + new IllegalArgumentException("Parameter evaluatedSqlEntityName 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, businessCaseName, + evaluatedSqlEntityName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EvaluatedSqlEntity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedSqlEntityName Business case Evaluated sql entity 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 EvaluatedSqlEntity along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedSqlEntityName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (evaluatedSqlEntityName == null) { + return Mono.error( + new IllegalArgumentException("Parameter evaluatedSqlEntityName 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, businessCaseName, evaluatedSqlEntityName, accept, context); + } + + /** + * Get a EvaluatedSqlEntity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedSqlEntityName Business case Evaluated sql entity 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 EvaluatedSqlEntity on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedSqlEntityName) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, evaluatedSqlEntityName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EvaluatedSqlEntity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedSqlEntityName Business case Evaluated sql entity 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 EvaluatedSqlEntity along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedSqlEntityName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, evaluatedSqlEntityName, context) + .block(); + } + + /** + * Get a EvaluatedSqlEntity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedSqlEntityName Business case Evaluated sql entity 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 EvaluatedSqlEntity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EvaluatedSqlEntityInner get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedSqlEntityName) { + return getWithResponse(resourceGroupName, projectName, businessCaseName, evaluatedSqlEntityName, Context.NONE) + .getValue(); + } + + /** + * 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 EvaluatedSqlEntity 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 EvaluatedSqlEntity 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedSqlEntitiesOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedSqlEntitiesOperationsImpl.java new file mode 100644 index 000000000000..79baba63c0a5 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedSqlEntitiesOperationsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.EvaluatedSqlEntitiesOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedSqlEntityInner; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedSqlEntitiesOperations; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedSqlEntity; + +public final class EvaluatedSqlEntitiesOperationsImpl implements EvaluatedSqlEntitiesOperations { + private static final ClientLogger LOGGER = new ClientLogger(EvaluatedSqlEntitiesOperationsImpl.class); + + private final EvaluatedSqlEntitiesOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public EvaluatedSqlEntitiesOperationsImpl(EvaluatedSqlEntitiesOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, businessCaseName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EvaluatedSqlEntityImpl(inner1, this.manager())); + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context) { + PagedIterable inner = this.serviceClient() + .listByParent(resourceGroupName, projectName, businessCaseName, filter, pageSize, continuationToken, + totalRecordCount, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EvaluatedSqlEntityImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedSqlEntityName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, businessCaseName, evaluatedSqlEntityName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EvaluatedSqlEntityImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EvaluatedSqlEntity get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedSqlEntityName) { + EvaluatedSqlEntityInner inner + = this.serviceClient().get(resourceGroupName, projectName, businessCaseName, evaluatedSqlEntityName); + if (inner != null) { + return new EvaluatedSqlEntityImpl(inner, this.manager()); + } else { + return null; + } + } + + private EvaluatedSqlEntitiesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedSqlEntityImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedSqlEntityImpl.java new file mode 100644 index 000000000000..498be5fd7faf --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedSqlEntityImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedSqlEntityInner; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedSqlEntity; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedSqlEntityProperties; + +public final class EvaluatedSqlEntityImpl implements EvaluatedSqlEntity { + private EvaluatedSqlEntityInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + EvaluatedSqlEntityImpl(EvaluatedSqlEntityInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 EvaluatedSqlEntityProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public EvaluatedSqlEntityInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedWebAppImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedWebAppImpl.java new file mode 100644 index 000000000000..17af85e49798 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedWebAppImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedWebAppInner; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedWebApp; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedWebAppProperties; + +public final class EvaluatedWebAppImpl implements EvaluatedWebApp { + private EvaluatedWebAppInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + EvaluatedWebAppImpl(EvaluatedWebAppInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 EvaluatedWebAppProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public EvaluatedWebAppInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedWebAppsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedWebAppsOperationsClientImpl.java new file mode 100644 index 000000000000..83dfa5f86d65 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedWebAppsOperationsClientImpl.java @@ -0,0 +1,517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.EvaluatedWebAppsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedWebAppInner; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedWebAppListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EvaluatedWebAppsOperationsClient. + */ +public final class EvaluatedWebAppsOperationsClientImpl implements EvaluatedWebAppsOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final EvaluatedWebAppsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of EvaluatedWebAppsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EvaluatedWebAppsOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(EvaluatedWebAppsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientEvaluatedWebAppsOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface EvaluatedWebAppsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/evaluatedWebApps") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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("businessCaseName") String businessCaseName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/businessCases/{businessCaseName}/evaluatedWebApps/{evaluatedWebAppName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("businessCaseName") String businessCaseName, + @PathParam("evaluatedWebAppName") String evaluatedWebAppName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List EvaluatedWebApp resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedWebApp list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, 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 EvaluatedWebApp resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedWebApp list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String businessCaseName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName 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, businessCaseName, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EvaluatedWebApp resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedWebApp list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, + filter, pageSize, continuationToken, totalRecordCount), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List EvaluatedWebApp resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedWebApp list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName) { + final String filter = null; + final Integer pageSize = null; + final String continuationToken = null; + final Integer totalRecordCount = null; + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, + filter, pageSize, continuationToken, totalRecordCount), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List EvaluatedWebApp resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedWebApp list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context) { + return new PagedFlux<>( + () -> listByParentSinglePageAsync(resourceGroupName, projectName, businessCaseName, filter, pageSize, + continuationToken, totalRecordCount, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); + } + + /** + * List EvaluatedWebApp resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedWebApp list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + final String filter = null; + final Integer pageSize = null; + final String continuationToken = null; + final Integer totalRecordCount = null; + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName, filter, pageSize, + continuationToken, totalRecordCount)); + } + + /** + * List EvaluatedWebApp resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedWebApp list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, businessCaseName, filter, pageSize, + continuationToken, totalRecordCount, context)); + } + + /** + * Get a EvaluatedWebApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedWebAppName Business case Evaluated web App 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 EvaluatedWebApp along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedWebAppName) { + 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (evaluatedWebAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter evaluatedWebAppName 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, businessCaseName, evaluatedWebAppName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EvaluatedWebApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedWebAppName Business case Evaluated web App 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 EvaluatedWebApp along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedWebAppName, 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 (businessCaseName == null) { + return Mono + .error(new IllegalArgumentException("Parameter businessCaseName is required and cannot be null.")); + } + if (evaluatedWebAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter evaluatedWebAppName 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, businessCaseName, evaluatedWebAppName, accept, context); + } + + /** + * Get a EvaluatedWebApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedWebAppName Business case Evaluated web App 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 EvaluatedWebApp on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedWebAppName) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, evaluatedWebAppName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EvaluatedWebApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedWebAppName Business case Evaluated web App 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 EvaluatedWebApp along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedWebAppName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, businessCaseName, evaluatedWebAppName, context) + .block(); + } + + /** + * Get a EvaluatedWebApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedWebAppName Business case Evaluated web App 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 EvaluatedWebApp. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EvaluatedWebAppInner get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedWebAppName) { + return getWithResponse(resourceGroupName, projectName, businessCaseName, evaluatedWebAppName, Context.NONE) + .getValue(); + } + + /** + * 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 EvaluatedWebApp 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 EvaluatedWebApp 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedWebAppsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedWebAppsOperationsImpl.java new file mode 100644 index 000000000000..c845ef88fde1 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/EvaluatedWebAppsOperationsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.EvaluatedWebAppsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedWebAppInner; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedWebApp; +import com.azure.resourcemanager.migration.assessment.models.EvaluatedWebAppsOperations; + +public final class EvaluatedWebAppsOperationsImpl implements EvaluatedWebAppsOperations { + private static final ClientLogger LOGGER = new ClientLogger(EvaluatedWebAppsOperationsImpl.class); + + private final EvaluatedWebAppsOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public EvaluatedWebAppsOperationsImpl(EvaluatedWebAppsOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, businessCaseName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EvaluatedWebAppImpl(inner1, this.manager())); + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context) { + PagedIterable inner = this.serviceClient() + .listByParent(resourceGroupName, projectName, businessCaseName, filter, pageSize, continuationToken, + totalRecordCount, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EvaluatedWebAppImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String businessCaseName, String evaluatedWebAppName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, businessCaseName, evaluatedWebAppName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EvaluatedWebAppImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EvaluatedWebApp get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedWebAppName) { + EvaluatedWebAppInner inner + = this.serviceClient().get(resourceGroupName, projectName, businessCaseName, evaluatedWebAppName); + if (inner != null) { + return new EvaluatedWebAppImpl(inner, this.manager()); + } else { + return null; + } + } + + private EvaluatedWebAppsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/GroupImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/GroupImpl.java deleted file mode 100644 index 3a65a90de1a6..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/GroupImpl.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.migration.assessment.fluent.models.GroupInner; -import com.azure.resourcemanager.migration.assessment.models.Group; -import com.azure.resourcemanager.migration.assessment.models.GroupProperties; -import com.azure.resourcemanager.migration.assessment.models.UpdateGroupBody; - -public final class GroupImpl implements Group, Group.Definition { - private GroupInner innerObject; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - GroupImpl(GroupInner innerObject, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 GroupProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GroupInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String projectName; - - private String groupName; - - public GroupImpl withExistingAssessmentProject(String resourceGroupName, String projectName) { - this.resourceGroupName = resourceGroupName; - this.projectName = projectName; - return this; - } - - public Group create() { - this.innerObject = serviceManager.serviceClient() - .getGroupsOperations() - .create(resourceGroupName, projectName, groupName, this.innerModel(), Context.NONE); - return this; - } - - public Group create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getGroupsOperations() - .create(resourceGroupName, projectName, groupName, this.innerModel(), context); - return this; - } - - GroupImpl(String name, com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerObject = new GroupInner(); - this.serviceManager = serviceManager; - this.groupName = name; - } - - public Group refresh() { - this.innerObject = serviceManager.serviceClient() - .getGroupsOperations() - .getWithResponse(resourceGroupName, projectName, groupName, Context.NONE) - .getValue(); - return this; - } - - public Group refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getGroupsOperations() - .getWithResponse(resourceGroupName, projectName, groupName, context) - .getValue(); - return this; - } - - public Group updateMachines(UpdateGroupBody body) { - return serviceManager.groupsOperations().updateMachines(resourceGroupName, projectName, groupName, body); - } - - public Group updateMachines(UpdateGroupBody body, Context context) { - return serviceManager.groupsOperations() - .updateMachines(resourceGroupName, projectName, groupName, body, context); - } - - public GroupImpl withProperties(GroupProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/GroupsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/GroupsOperationsClientImpl.java deleted file mode 100644 index cbf5d2413046..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/GroupsOperationsClientImpl.java +++ /dev/null @@ -1,1099 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.GroupsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.GroupInner; -import com.azure.resourcemanager.migration.assessment.models.GroupListResult; -import com.azure.resourcemanager.migration.assessment.models.UpdateGroupBody; -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 GroupsOperationsClient. - */ -public final class GroupsOperationsClientImpl implements GroupsOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GroupsOperationsService service; - - /** - * The service client containing this operation class. - */ - private final MigrationAssessmentManagementClientImpl client; - - /** - * Initializes an instance of GroupsOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GroupsOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { - this.service - = RestProxy.create(GroupsOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MigrationAssessmentManagementClientGroupsOperations to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MigrationAssessmentM") - public interface GroupsOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProject(@HostParam("$host") 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}/groups/{groupName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @BodyParam("application/json") GroupInner resource, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/updateMachines") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateMachines(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @BodyParam("application/json") UpdateGroupBody body, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProjectNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List Group 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 Group list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(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.listByAssessmentProject(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 Group 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 Group list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(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 - .listByAssessmentProject(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 Group 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 Group list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink)); - } - - /** - * List Group 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 Group list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName, - Context context) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName, context), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink, context)); - } - - /** - * List Group 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 Group list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName)); - } - - /** - * List Group 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 Group list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName, context)); - } - - /** - * Get a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Group along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String groupName) { - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Group along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, accept, context); - } - - /** - * Get a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Group on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String projectName, String groupName) { - return getWithResponseAsync(resourceGroupName, projectName, groupName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Group along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String projectName, String groupName, - Context context) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, context).block(); - } - - /** - * Get a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupInner get(String resourceGroupName, String projectName, String groupName) { - return getWithResponse(resourceGroupName, projectName, groupName, Context.NONE).getValue(); - } - - /** - * Create a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, - String groupName, GroupInner 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, resource, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, - String groupName, GroupInner 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, projectName, groupName, resource, accept, context); - } - - /** - * Create a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupInner> beginCreateAsync(String resourceGroupName, - String projectName, String groupName, GroupInner resource) { - Mono>> mono - = createWithResponseAsync(resourceGroupName, projectName, groupName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), GroupInner.class, - GroupInner.class, this.client.getContext()); - } - - /** - * Create a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupInner> beginCreateAsync(String resourceGroupName, - String projectName, String groupName, GroupInner resource, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(resourceGroupName, projectName, groupName, resource, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), GroupInner.class, - GroupInner.class, context); - } - - /** - * Create a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupInner> beginCreate(String resourceGroupName, String projectName, - String groupName, GroupInner resource) { - return this.beginCreateAsync(resourceGroupName, projectName, groupName, resource).getSyncPoller(); - } - - /** - * Create a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupInner> beginCreate(String resourceGroupName, String projectName, - String groupName, GroupInner resource, Context context) { - return this.beginCreateAsync(resourceGroupName, projectName, groupName, resource, context).getSyncPoller(); - } - - /** - * Create a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String projectName, String groupName, - GroupInner resource) { - return beginCreateAsync(resourceGroupName, projectName, groupName, resource).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String projectName, String groupName, - GroupInner resource, Context context) { - return beginCreateAsync(resourceGroupName, projectName, groupName, resource, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupInner create(String resourceGroupName, String projectName, String groupName, GroupInner resource) { - return createAsync(resourceGroupName, projectName, groupName, resource).block(); - } - - /** - * Create a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupInner create(String resourceGroupName, String projectName, String groupName, GroupInner resource, - Context context) { - return createAsync(resourceGroupName, projectName, groupName, resource, context).block(); - } - - /** - * Delete a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 groupName) { - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 groupName, - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, accept, context); - } - - /** - * Delete a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 groupName) { - return deleteWithResponseAsync(resourceGroupName, projectName, groupName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 groupName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, projectName, groupName, context).block(); - } - - /** - * Delete a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 groupName) { - deleteWithResponse(resourceGroupName, projectName, groupName, Context.NONE); - } - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateMachinesWithResponseAsync(String resourceGroupName, - String projectName, String groupName, UpdateGroupBody 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 accept = "application/json"; - return FluxUtil - .withContext(context -> service.updateMachines(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, body, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateMachinesWithResponseAsync(String resourceGroupName, - String projectName, String groupName, UpdateGroupBody 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.updateMachines(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, body, accept, context); - } - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupInner> beginUpdateMachinesAsync(String resourceGroupName, - String projectName, String groupName, UpdateGroupBody body) { - Mono>> mono - = updateMachinesWithResponseAsync(resourceGroupName, projectName, groupName, body); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), GroupInner.class, - GroupInner.class, this.client.getContext()); - } - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupInner> beginUpdateMachinesAsync(String resourceGroupName, - String projectName, String groupName, UpdateGroupBody body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateMachinesWithResponseAsync(resourceGroupName, projectName, groupName, body, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), GroupInner.class, - GroupInner.class, context); - } - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupInner> beginUpdateMachines(String resourceGroupName, - String projectName, String groupName, UpdateGroupBody body) { - return this.beginUpdateMachinesAsync(resourceGroupName, projectName, groupName, body).getSyncPoller(); - } - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupInner> beginUpdateMachines(String resourceGroupName, - String projectName, String groupName, UpdateGroupBody body, Context context) { - return this.beginUpdateMachinesAsync(resourceGroupName, projectName, groupName, body, context).getSyncPoller(); - } - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateMachinesAsync(String resourceGroupName, String projectName, String groupName, - UpdateGroupBody body) { - return beginUpdateMachinesAsync(resourceGroupName, projectName, groupName, body).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateMachinesAsync(String resourceGroupName, String projectName, String groupName, - UpdateGroupBody body, Context context) { - return beginUpdateMachinesAsync(resourceGroupName, projectName, groupName, body, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupInner updateMachines(String resourceGroupName, String projectName, String groupName, - UpdateGroupBody body) { - return updateMachinesAsync(resourceGroupName, projectName, groupName, body).block(); - } - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupInner updateMachines(String resourceGroupName, String projectName, String groupName, - UpdateGroupBody body, Context context) { - return updateMachinesAsync(resourceGroupName, projectName, groupName, 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 Group list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(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.listByAssessmentProjectNext(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 Group list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(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.listByAssessmentProjectNext(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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/GroupsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/GroupsOperationsImpl.java deleted file mode 100644 index f477e02f26bd..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/GroupsOperationsImpl.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.GroupsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.GroupInner; -import com.azure.resourcemanager.migration.assessment.models.Group; -import com.azure.resourcemanager.migration.assessment.models.GroupsOperations; -import com.azure.resourcemanager.migration.assessment.models.UpdateGroupBody; - -public final class GroupsOperationsImpl implements GroupsOperations { - private static final ClientLogger LOGGER = new ClientLogger(GroupsOperationsImpl.class); - - private final GroupsOperationsClient innerClient; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - public GroupsOperationsImpl(GroupsOperationsClient innerClient, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - PagedIterable inner = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GroupImpl(inner1, this.manager())); - } - - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, Context context) { - PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GroupImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String projectName, String groupName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, projectName, groupName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GroupImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Group get(String resourceGroupName, String projectName, String groupName) { - GroupInner inner = this.serviceClient().get(resourceGroupName, projectName, groupName); - if (inner != null) { - return new GroupImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String projectName, String groupName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, projectName, groupName, context); - } - - public void delete(String resourceGroupName, String projectName, String groupName) { - this.serviceClient().delete(resourceGroupName, projectName, groupName); - } - - public Group updateMachines(String resourceGroupName, String projectName, String groupName, UpdateGroupBody body) { - GroupInner inner = this.serviceClient().updateMachines(resourceGroupName, projectName, groupName, body); - if (inner != null) { - return new GroupImpl(inner, this.manager()); - } else { - return null; - } - } - - public Group updateMachines(String resourceGroupName, String projectName, String groupName, UpdateGroupBody body, - Context context) { - GroupInner inner - = this.serviceClient().updateMachines(resourceGroupName, projectName, groupName, body, context); - if (inner != null) { - return new GroupImpl(inner, this.manager()); - } else { - return null; - } - } - - public Group 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); - } - return this.getWithResponse(resourceGroupName, projectName, groupName, 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); - } - return this.getWithResponse(resourceGroupName, projectName, groupName, 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); - } - this.deleteWithResponse(resourceGroupName, projectName, groupName, 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); - } - return this.deleteWithResponse(resourceGroupName, projectName, groupName, context); - } - - private GroupsOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } - - public GroupImpl define(String name) { - return new GroupImpl(name, this.manager()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentImpl.java new file mode 100644 index 000000000000..4d1a794279aa --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentImpl.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.HeterogeneousAssessmentInner; +import com.azure.resourcemanager.migration.assessment.models.HeterogeneousAssessment; +import com.azure.resourcemanager.migration.assessment.models.HeterogeneousAssessmentProperties; + +public final class HeterogeneousAssessmentImpl implements HeterogeneousAssessment, HeterogeneousAssessment.Definition { + private HeterogeneousAssessmentInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + HeterogeneousAssessmentImpl(HeterogeneousAssessmentInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 HeterogeneousAssessmentProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public HeterogeneousAssessmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String projectName; + + private String assessmentName; + + public HeterogeneousAssessmentImpl withExistingAssessmentProject(String resourceGroupName, String projectName) { + this.resourceGroupName = resourceGroupName; + this.projectName = projectName; + return this; + } + + public HeterogeneousAssessment create() { + this.innerObject = serviceManager.serviceClient() + .getHeterogeneousAssessmentOperations() + .create(resourceGroupName, projectName, assessmentName, this.innerModel(), Context.NONE); + return this; + } + + public HeterogeneousAssessment create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHeterogeneousAssessmentOperations() + .create(resourceGroupName, projectName, assessmentName, this.innerModel(), context); + return this; + } + + HeterogeneousAssessmentImpl(String name, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerObject = new HeterogeneousAssessmentInner(); + this.serviceManager = serviceManager; + this.assessmentName = name; + } + + public HeterogeneousAssessment refresh() { + this.innerObject = serviceManager.serviceClient() + .getHeterogeneousAssessmentOperations() + .getWithResponse(resourceGroupName, projectName, assessmentName, Context.NONE) + .getValue(); + return this; + } + + public HeterogeneousAssessment refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHeterogeneousAssessmentOperations() + .getWithResponse(resourceGroupName, projectName, assessmentName, context) + .getValue(); + return this; + } + + public HeterogeneousAssessmentImpl withProperties(HeterogeneousAssessmentProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentOperationsClientImpl.java new file mode 100644 index 000000000000..b28105017669 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentOperationsClientImpl.java @@ -0,0 +1,826 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.migration.assessment.fluent.HeterogeneousAssessmentOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.HeterogeneousAssessmentInner; +import com.azure.resourcemanager.migration.assessment.models.HeterogeneousAssessmentListResult; +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 HeterogeneousAssessmentOperationsClient. + */ +public final class HeterogeneousAssessmentOperationsClientImpl implements HeterogeneousAssessmentOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final HeterogeneousAssessmentOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of HeterogeneousAssessmentOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HeterogeneousAssessmentOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(HeterogeneousAssessmentOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientHeterogeneousAssessmentOperations + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface HeterogeneousAssessmentOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/heterogeneousAssessments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/heterogeneousAssessments/{assessmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/heterogeneousAssessments/{assessmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, + @BodyParam("application/json") HeterogeneousAssessmentInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/heterogeneousAssessments/{assessmentName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") 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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List HeterogeneousAssessment 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 HeterogeneousAssessment 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 HeterogeneousAssessment 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 HeterogeneousAssessment 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 HeterogeneousAssessment 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 HeterogeneousAssessment 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 HeterogeneousAssessment 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 HeterogeneousAssessment 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 HeterogeneousAssessment 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 HeterogeneousAssessment 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 HeterogeneousAssessment 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 HeterogeneousAssessment 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 a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessment 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 HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessment 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 HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessment 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 HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessment 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 HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HeterogeneousAssessmentInner get(String resourceGroupName, String projectName, String assessmentName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, Context.NONE).getValue(); + } + + /** + * Create a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 heterogeneous assessment resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, HeterogeneousAssessmentInner 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 accept = "application/json"; + return FluxUtil.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 heterogeneous assessment resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, HeterogeneousAssessmentInner 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, assessmentName, resource, accept, context); + } + + /** + * Create a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 heterogeneous assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, HeterogeneousAssessmentInner> beginCreateAsync( + String resourceGroupName, String projectName, String assessmentName, HeterogeneousAssessmentInner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, assessmentName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), HeterogeneousAssessmentInner.class, HeterogeneousAssessmentInner.class, + this.client.getContext()); + } + + /** + * Create a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 heterogeneous assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, HeterogeneousAssessmentInner> beginCreateAsync( + String resourceGroupName, String projectName, String assessmentName, HeterogeneousAssessmentInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, assessmentName, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), HeterogeneousAssessmentInner.class, HeterogeneousAssessmentInner.class, + context); + } + + /** + * Create a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 heterogeneous assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HeterogeneousAssessmentInner> beginCreate( + String resourceGroupName, String projectName, String assessmentName, HeterogeneousAssessmentInner resource) { + return this.beginCreateAsync(resourceGroupName, projectName, assessmentName, resource).getSyncPoller(); + } + + /** + * Create a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 heterogeneous assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HeterogeneousAssessmentInner> beginCreate( + String resourceGroupName, String projectName, String assessmentName, HeterogeneousAssessmentInner resource, + Context context) { + return this.beginCreateAsync(resourceGroupName, projectName, assessmentName, resource, context).getSyncPoller(); + } + + /** + * Create a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 heterogeneous assessment resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, + String assessmentName, HeterogeneousAssessmentInner resource) { + return beginCreateAsync(resourceGroupName, projectName, assessmentName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 heterogeneous assessment resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, + String assessmentName, HeterogeneousAssessmentInner resource, Context context) { + return beginCreateAsync(resourceGroupName, projectName, assessmentName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 heterogeneous assessment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HeterogeneousAssessmentInner create(String resourceGroupName, String projectName, String assessmentName, + HeterogeneousAssessmentInner resource) { + return createAsync(resourceGroupName, projectName, assessmentName, resource).block(); + } + + /** + * Create a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 heterogeneous assessment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HeterogeneousAssessmentInner create(String resourceGroupName, String projectName, String assessmentName, + HeterogeneousAssessmentInner resource, Context context) { + return createAsync(resourceGroupName, projectName, assessmentName, resource, context).block(); + } + + /** + * Delete a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 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 HeterogeneousAssessment 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 HeterogeneousAssessment 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentOperationsImpl.java new file mode 100644 index 000000000000..2fc1a53779d3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentOperationsImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.HeterogeneousAssessmentOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.HeterogeneousAssessmentInner; +import com.azure.resourcemanager.migration.assessment.models.HeterogeneousAssessment; +import com.azure.resourcemanager.migration.assessment.models.HeterogeneousAssessmentOperations; + +public final class HeterogeneousAssessmentOperationsImpl implements HeterogeneousAssessmentOperations { + private static final ClientLogger LOGGER = new ClientLogger(HeterogeneousAssessmentOperationsImpl.class); + + private final HeterogeneousAssessmentOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public HeterogeneousAssessmentOperationsImpl(HeterogeneousAssessmentOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HeterogeneousAssessmentImpl(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 HeterogeneousAssessmentImpl(inner1, this.manager())); + } + + 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 HeterogeneousAssessmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public HeterogeneousAssessment get(String resourceGroupName, String projectName, String assessmentName) { + HeterogeneousAssessmentInner inner = this.serviceClient().get(resourceGroupName, projectName, assessmentName); + if (inner != null) { + return new HeterogeneousAssessmentImpl(inner, this.manager()); + } else { + return null; + } + } + + 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 HeterogeneousAssessment 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, "heterogeneousAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'heterogeneousAssessments'.", 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, "heterogeneousAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'heterogeneousAssessments'.", 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, "heterogeneousAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'heterogeneousAssessments'.", 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, "heterogeneousAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'heterogeneousAssessments'.", id))); + } + return this.deleteWithResponse(resourceGroupName, projectName, assessmentName, context); + } + + private HeterogeneousAssessmentOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + public HeterogeneousAssessmentImpl define(String name) { + return new HeterogeneousAssessmentImpl(name, this.manager()); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentSummaryImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentSummaryImpl.java new file mode 100644 index 000000000000..83d4efdae6b7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentSummaryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.HeterogeneousAssessmentSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.HeterogeneousAssessmentSummary; +import com.azure.resourcemanager.migration.assessment.models.HeterogeneousAssessmentSummaryProperties; + +public final class HeterogeneousAssessmentSummaryImpl implements HeterogeneousAssessmentSummary { + private HeterogeneousAssessmentSummaryInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + HeterogeneousAssessmentSummaryImpl(HeterogeneousAssessmentSummaryInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 HeterogeneousAssessmentSummaryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public HeterogeneousAssessmentSummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentSummaryOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentSummaryOperationsClientImpl.java new file mode 100644 index 000000000000..3dcf1c20fc2a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentSummaryOperationsClientImpl.java @@ -0,0 +1,455 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.HeterogeneousAssessmentSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.HeterogeneousAssessmentSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.HeterogeneousAssessmentSummaryListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * HeterogeneousAssessmentSummaryOperationsClient. + */ +public final class HeterogeneousAssessmentSummaryOperationsClientImpl + implements HeterogeneousAssessmentSummaryOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final HeterogeneousAssessmentSummaryOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of HeterogeneousAssessmentSummaryOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HeterogeneousAssessmentSummaryOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(HeterogeneousAssessmentSummaryOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * MigrationAssessmentManagementClientHeterogeneousAssessmentSummaryOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface HeterogeneousAssessmentSummaryOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/heterogeneousAssessments/{assessmentName}/summaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/heterogeneousAssessments/{assessmentName}/summaries/{summaryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParentNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List HeterogeneousAssessmentSummary resources by HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessmentSummary 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 HeterogeneousAssessmentSummary resources by HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessmentSummary 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 HeterogeneousAssessmentSummary resources by HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessmentSummary 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 HeterogeneousAssessmentSummary resources by HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessmentSummary 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 HeterogeneousAssessmentSummary resources by HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessmentSummary 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 HeterogeneousAssessmentSummary resources by HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessmentSummary 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 a HeterogeneousAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment ARM name. + * @param summaryName Gets the Name of the Heterogeneous assessment 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 HeterogeneousAssessmentSummary 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 HeterogeneousAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment ARM name. + * @param summaryName Gets the Name of the Heterogeneous assessment 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 HeterogeneousAssessmentSummary 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 HeterogeneousAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment ARM name. + * @param summaryName Gets the Name of the Heterogeneous assessment 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 HeterogeneousAssessmentSummary 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 HeterogeneousAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment ARM name. + * @param summaryName Gets the Name of the Heterogeneous assessment 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 HeterogeneousAssessmentSummary 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 HeterogeneousAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment ARM name. + * @param summaryName Gets the Name of the Heterogeneous assessment 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 HeterogeneousAssessmentSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HeterogeneousAssessmentSummaryInner get(String resourceGroupName, String projectName, String assessmentName, + String summaryName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, summaryName, Context.NONE).getValue(); + } + + /** + * 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 HeterogeneousAssessmentSummary 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 HeterogeneousAssessmentSummary 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentSummaryOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentSummaryOperationsImpl.java new file mode 100644 index 000000000000..2a639034c83c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HeterogeneousAssessmentSummaryOperationsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.HeterogeneousAssessmentSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.HeterogeneousAssessmentSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.HeterogeneousAssessmentSummary; +import com.azure.resourcemanager.migration.assessment.models.HeterogeneousAssessmentSummaryOperations; + +public final class HeterogeneousAssessmentSummaryOperationsImpl implements HeterogeneousAssessmentSummaryOperations { + private static final ClientLogger LOGGER = new ClientLogger(HeterogeneousAssessmentSummaryOperationsImpl.class); + + private final HeterogeneousAssessmentSummaryOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public HeterogeneousAssessmentSummaryOperationsImpl(HeterogeneousAssessmentSummaryOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new HeterogeneousAssessmentSummaryImpl(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 HeterogeneousAssessmentSummaryImpl(inner1, this.manager())); + } + + 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 HeterogeneousAssessmentSummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public HeterogeneousAssessmentSummary get(String resourceGroupName, String projectName, String assessmentName, + String summaryName) { + HeterogeneousAssessmentSummaryInner inner + = this.serviceClient().get(resourceGroupName, projectName, assessmentName, summaryName); + if (inner != null) { + return new HeterogeneousAssessmentSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + private HeterogeneousAssessmentSummaryOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HypervCollectorsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HypervCollectorsOperationsClientImpl.java index 5ac2a18ca05f..ccf1b67c9d3c 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HypervCollectorsOperationsClientImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HypervCollectorsOperationsClientImpl.java @@ -74,7 +74,7 @@ public interface HypervCollectorsOperationsService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProject(@HostParam("$host") String endpoint, + Mono> listByParent(@HostParam("$host") 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); @@ -114,7 +114,7 @@ Mono> delete(@HostParam("$host") String endpoint, @QueryParam("ap @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProjectNext( + Mono> listByParentNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -131,7 +131,7 @@ Mono> listByAssessmentProjectNext( * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(String resourceGroupName, + private Mono> listByParentSinglePageAsync(String resourceGroupName, String projectName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -150,9 +150,8 @@ private Mono> listByAssessmentProjectSingleP } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context)) + .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())); @@ -171,7 +170,7 @@ private Mono> listByAssessmentProjectSingleP * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(String resourceGroupName, + private Mono> listByParentSinglePageAsync(String resourceGroupName, String projectName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -191,8 +190,8 @@ private Mono> listByAssessmentProjectSingleP final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context) + .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)); } @@ -208,9 +207,9 @@ private Mono> listByAssessmentProjectSingleP * @return the response of a HypervCollector list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink)); + private PagedFlux listByParentAsync(String resourceGroupName, String projectName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); } /** @@ -225,10 +224,10 @@ private PagedFlux listByAssessmentProjectAsync(String reso * @return the response of a HypervCollector list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName, + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, Context context) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName, context), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); } /** @@ -242,8 +241,8 @@ private PagedFlux listByAssessmentProjectAsync(String reso * @return the response of a HypervCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName)); + public PagedIterable listByParent(String resourceGroupName, String projectName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName)); } /** @@ -258,9 +257,9 @@ public PagedIterable listByAssessmentProject(String resour * @return the response of a HypervCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, + public PagedIterable listByParent(String resourceGroupName, String projectName, Context context) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName, context)); + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, context)); } /** @@ -788,7 +787,7 @@ public void delete(String resourceGroupName, String projectName, String hypervCo * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(String nextLink) { + private Mono> listByParentNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -798,8 +797,7 @@ private Mono> listByAssessmentProjectNextSin } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, context)) + .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())); @@ -817,7 +815,7 @@ private Mono> listByAssessmentProjectNextSin * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(String nextLink, + private Mono> listByParentNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -828,7 +826,7 @@ private Mono> listByAssessmentProjectNextSin } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HypervCollectorsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HypervCollectorsOperationsImpl.java index 76e15b76e4a0..1a61f55e17a4 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HypervCollectorsOperationsImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/HypervCollectorsOperationsImpl.java @@ -27,16 +27,14 @@ public HypervCollectorsOperationsImpl(HypervCollectorsOperationsClient innerClie this.serviceManager = serviceManager; } - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName); + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner = this.serviceClient().listByParent(resourceGroupName, projectName); return ResourceManagerUtils.mapPage(inner, inner1 -> new HypervCollectorImpl(inner1, this.manager())); } - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context) { + public PagedIterable listByParent(String resourceGroupName, String projectName, Context context) { PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName, context); + = this.serviceClient().listByParent(resourceGroupName, projectName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new HypervCollectorImpl(inner1, this.manager())); } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/IaasSummaryImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/IaasSummaryImpl.java new file mode 100644 index 000000000000..7c142efdf99c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/IaasSummaryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.IaasSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.IaasSummary; +import com.azure.resourcemanager.migration.assessment.models.IaasSummaryProperties; + +public final class IaasSummaryImpl implements IaasSummary { + private IaasSummaryInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + IaasSummaryImpl(IaasSummaryInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 IaasSummaryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public IaasSummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportCollectorsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportCollectorsOperationsClientImpl.java index 9069f656ad8a..22eb06258b0d 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportCollectorsOperationsClientImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportCollectorsOperationsClientImpl.java @@ -74,7 +74,7 @@ public interface ImportCollectorsOperationsService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProject(@HostParam("$host") String endpoint, + Mono> listByParent(@HostParam("$host") 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); @@ -114,7 +114,7 @@ Mono> delete(@HostParam("$host") String endpoint, @QueryParam("ap @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProjectNext( + Mono> listByParentNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -131,7 +131,7 @@ Mono> listByAssessmentProjectNext( * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(String resourceGroupName, + private Mono> listByParentSinglePageAsync(String resourceGroupName, String projectName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -150,9 +150,8 @@ private Mono> listByAssessmentProjectSingleP } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context)) + .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())); @@ -171,7 +170,7 @@ private Mono> listByAssessmentProjectSingleP * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(String resourceGroupName, + private Mono> listByParentSinglePageAsync(String resourceGroupName, String projectName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -191,8 +190,8 @@ private Mono> listByAssessmentProjectSingleP final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context) + .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)); } @@ -208,9 +207,9 @@ private Mono> listByAssessmentProjectSingleP * @return the response of a ImportCollector list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink)); + private PagedFlux listByParentAsync(String resourceGroupName, String projectName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); } /** @@ -225,10 +224,10 @@ private PagedFlux listByAssessmentProjectAsync(String reso * @return the response of a ImportCollector list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName, + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, Context context) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName, context), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); } /** @@ -242,8 +241,8 @@ private PagedFlux listByAssessmentProjectAsync(String reso * @return the response of a ImportCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName)); + public PagedIterable listByParent(String resourceGroupName, String projectName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName)); } /** @@ -258,9 +257,9 @@ public PagedIterable listByAssessmentProject(String resour * @return the response of a ImportCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, + public PagedIterable listByParent(String resourceGroupName, String projectName, Context context) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName, context)); + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, context)); } /** @@ -788,7 +787,7 @@ public void delete(String resourceGroupName, String projectName, String importCo * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(String nextLink) { + private Mono> listByParentNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -798,8 +797,7 @@ private Mono> listByAssessmentProjectNextSin } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, context)) + .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())); @@ -817,7 +815,7 @@ private Mono> listByAssessmentProjectNextSin * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(String nextLink, + private Mono> listByParentNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -828,7 +826,7 @@ private Mono> listByAssessmentProjectNextSin } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportCollectorsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportCollectorsOperationsImpl.java index a758a099b217..6c15ec4f4089 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportCollectorsOperationsImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportCollectorsOperationsImpl.java @@ -27,16 +27,14 @@ public ImportCollectorsOperationsImpl(ImportCollectorsOperationsClient innerClie this.serviceManager = serviceManager; } - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName); + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner = this.serviceClient().listByParent(resourceGroupName, projectName); return ResourceManagerUtils.mapPage(inner, inner1 -> new ImportCollectorImpl(inner1, this.manager())); } - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context) { + public PagedIterable listByParent(String resourceGroupName, String projectName, Context context) { PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName, context); + = this.serviceClient().listByParent(resourceGroupName, projectName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new ImportCollectorImpl(inner1, this.manager())); } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportSqlCollectorImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportSqlCollectorImpl.java new file mode 100644 index 000000000000..f090e9177e6f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportSqlCollectorImpl.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.ImportSqlCollectorInner; +import com.azure.resourcemanager.migration.assessment.models.ImportSqlCollector; +import com.azure.resourcemanager.migration.assessment.models.ImportSqlCollectorProperties; + +public final class ImportSqlCollectorImpl implements ImportSqlCollector, ImportSqlCollector.Definition { + private ImportSqlCollectorInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + ImportSqlCollectorImpl(ImportSqlCollectorInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 ImportSqlCollectorProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ImportSqlCollectorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String projectName; + + private String importSqlCollectorsName; + + public ImportSqlCollectorImpl withExistingAssessmentProject(String resourceGroupName, String projectName) { + this.resourceGroupName = resourceGroupName; + this.projectName = projectName; + return this; + } + + public ImportSqlCollector create() { + this.innerObject = serviceManager.serviceClient() + .getImportSqlCollectorOperations() + .create(resourceGroupName, projectName, importSqlCollectorsName, this.innerModel(), Context.NONE); + return this; + } + + public ImportSqlCollector create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getImportSqlCollectorOperations() + .create(resourceGroupName, projectName, importSqlCollectorsName, this.innerModel(), context); + return this; + } + + ImportSqlCollectorImpl(String name, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerObject = new ImportSqlCollectorInner(); + this.serviceManager = serviceManager; + this.importSqlCollectorsName = name; + } + + public ImportSqlCollector refresh() { + this.innerObject = serviceManager.serviceClient() + .getImportSqlCollectorOperations() + .getWithResponse(resourceGroupName, projectName, importSqlCollectorsName, Context.NONE) + .getValue(); + return this; + } + + public ImportSqlCollector refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getImportSqlCollectorOperations() + .getWithResponse(resourceGroupName, projectName, importSqlCollectorsName, context) + .getValue(); + return this; + } + + public ImportSqlCollectorImpl withProperties(ImportSqlCollectorProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportSqlCollectorOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportSqlCollectorOperationsClientImpl.java new file mode 100644 index 000000000000..9e6ebd3be5f5 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportSqlCollectorOperationsClientImpl.java @@ -0,0 +1,835 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.migration.assessment.fluent.ImportSqlCollectorOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.ImportSqlCollectorInner; +import com.azure.resourcemanager.migration.assessment.models.ImportSqlCollectorListResult; +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 ImportSqlCollectorOperationsClient. + */ +public final class ImportSqlCollectorOperationsClientImpl implements ImportSqlCollectorOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ImportSqlCollectorOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of ImportSqlCollectorOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ImportSqlCollectorOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(ImportSqlCollectorOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientImportSqlCollectorOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface ImportSqlCollectorOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importSqlCollectors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/importSqlCollectors/{importSqlCollectorsName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("importSqlCollectorsName") String importSqlCollectorsName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importSqlCollectors/{importSqlCollectorsName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("importSqlCollectorsName") String importSqlCollectorsName, + @BodyParam("application/json") ImportSqlCollectorInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importSqlCollectors/{importSqlCollectorsName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("importSqlCollectorsName") String importSqlCollectorsName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List ImportSqlCollector 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 ImportSqlCollector 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 ImportSqlCollector 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 ImportSqlCollector 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 ImportSqlCollector 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 ImportSqlCollector 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 ImportSqlCollector 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 ImportSqlCollector 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 ImportSqlCollector 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 ImportSqlCollector 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 ImportSqlCollector 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 ImportSqlCollector 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 a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 ImportSqlCollector along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String importSqlCollectorsName) { + 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 (importSqlCollectorsName == null) { + return Mono.error( + new IllegalArgumentException("Parameter importSqlCollectorsName 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, importSqlCollectorsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 ImportSqlCollector along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String importSqlCollectorsName, 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 (importSqlCollectorsName == null) { + return Mono.error( + new IllegalArgumentException("Parameter importSqlCollectorsName 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, importSqlCollectorsName, accept, context); + } + + /** + * Get a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 ImportSqlCollector on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, + String importSqlCollectorsName) { + return getWithResponseAsync(resourceGroupName, projectName, importSqlCollectorsName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 ImportSqlCollector along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String importSqlCollectorsName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, importSqlCollectorsName, context).block(); + } + + /** + * Get a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 ImportSqlCollector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImportSqlCollectorInner get(String resourceGroupName, String projectName, String importSqlCollectorsName) { + return getWithResponse(resourceGroupName, projectName, importSqlCollectorsName, Context.NONE).getValue(); + } + + /** + * Create a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 import SQL Collector REST resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String importSqlCollectorsName, ImportSqlCollectorInner 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 (importSqlCollectorsName == null) { + return Mono.error( + new IllegalArgumentException("Parameter importSqlCollectorsName 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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, importSqlCollectorsName, resource, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 import SQL Collector REST resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String importSqlCollectorsName, ImportSqlCollectorInner 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 (importSqlCollectorsName == null) { + return Mono.error( + new IllegalArgumentException("Parameter importSqlCollectorsName 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, importSqlCollectorsName, resource, accept, context); + } + + /** + * Create a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 import SQL Collector REST resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ImportSqlCollectorInner> beginCreateAsync( + String resourceGroupName, String projectName, String importSqlCollectorsName, + ImportSqlCollectorInner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, importSqlCollectorsName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ImportSqlCollectorInner.class, ImportSqlCollectorInner.class, + this.client.getContext()); + } + + /** + * Create a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 import SQL Collector REST resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ImportSqlCollectorInner> beginCreateAsync( + String resourceGroupName, String projectName, String importSqlCollectorsName, ImportSqlCollectorInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, importSqlCollectorsName, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ImportSqlCollectorInner.class, ImportSqlCollectorInner.class, context); + } + + /** + * Create a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 import SQL Collector REST resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ImportSqlCollectorInner> beginCreate( + String resourceGroupName, String projectName, String importSqlCollectorsName, + ImportSqlCollectorInner resource) { + return this.beginCreateAsync(resourceGroupName, projectName, importSqlCollectorsName, resource).getSyncPoller(); + } + + /** + * Create a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 import SQL Collector REST resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ImportSqlCollectorInner> beginCreate( + String resourceGroupName, String projectName, String importSqlCollectorsName, ImportSqlCollectorInner resource, + Context context) { + return this.beginCreateAsync(resourceGroupName, projectName, importSqlCollectorsName, resource, context) + .getSyncPoller(); + } + + /** + * Create a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 import SQL Collector REST resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, + String importSqlCollectorsName, ImportSqlCollectorInner resource) { + return beginCreateAsync(resourceGroupName, projectName, importSqlCollectorsName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 import SQL Collector REST resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, + String importSqlCollectorsName, ImportSqlCollectorInner resource, Context context) { + return beginCreateAsync(resourceGroupName, projectName, importSqlCollectorsName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 import SQL Collector REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImportSqlCollectorInner create(String resourceGroupName, String projectName, String importSqlCollectorsName, + ImportSqlCollectorInner resource) { + return createAsync(resourceGroupName, projectName, importSqlCollectorsName, resource).block(); + } + + /** + * Create a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 import SQL Collector REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImportSqlCollectorInner create(String resourceGroupName, String projectName, String importSqlCollectorsName, + ImportSqlCollectorInner resource, Context context) { + return createAsync(resourceGroupName, projectName, importSqlCollectorsName, resource, context).block(); + } + + /** + * Delete a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 importSqlCollectorsName) { + 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 (importSqlCollectorsName == null) { + return Mono.error( + new IllegalArgumentException("Parameter importSqlCollectorsName 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, importSqlCollectorsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 importSqlCollectorsName, 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 (importSqlCollectorsName == null) { + return Mono.error( + new IllegalArgumentException("Parameter importSqlCollectorsName 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, importSqlCollectorsName, accept, context); + } + + /** + * Delete a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 importSqlCollectorsName) { + return deleteWithResponseAsync(resourceGroupName, projectName, importSqlCollectorsName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 importSqlCollectorsName, Context context) { + return deleteWithResponseAsync(resourceGroupName, projectName, importSqlCollectorsName, context).block(); + } + + /** + * Delete a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 importSqlCollectorsName) { + deleteWithResponse(resourceGroupName, projectName, importSqlCollectorsName, Context.NONE); + } + + /** + * 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 ImportSqlCollector 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 ImportSqlCollector 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportSqlCollectorOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportSqlCollectorOperationsImpl.java new file mode 100644 index 000000000000..5872be5810eb --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ImportSqlCollectorOperationsImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.ImportSqlCollectorOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.ImportSqlCollectorInner; +import com.azure.resourcemanager.migration.assessment.models.ImportSqlCollector; +import com.azure.resourcemanager.migration.assessment.models.ImportSqlCollectorOperations; + +public final class ImportSqlCollectorOperationsImpl implements ImportSqlCollectorOperations { + private static final ClientLogger LOGGER = new ClientLogger(ImportSqlCollectorOperationsImpl.class); + + private final ImportSqlCollectorOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public ImportSqlCollectorOperationsImpl(ImportSqlCollectorOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImportSqlCollectorImpl(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 ImportSqlCollectorImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String importSqlCollectorsName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, projectName, importSqlCollectorsName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ImportSqlCollectorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImportSqlCollector get(String resourceGroupName, String projectName, String importSqlCollectorsName) { + ImportSqlCollectorInner inner + = this.serviceClient().get(resourceGroupName, projectName, importSqlCollectorsName); + if (inner != null) { + return new ImportSqlCollectorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String projectName, + String importSqlCollectorsName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, projectName, importSqlCollectorsName, context); + } + + public void delete(String resourceGroupName, String projectName, String importSqlCollectorsName) { + this.serviceClient().delete(resourceGroupName, projectName, importSqlCollectorsName); + } + + public ImportSqlCollector 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 importSqlCollectorsName = ResourceManagerUtils.getValueFromIdByName(id, "importSqlCollectors"); + if (importSqlCollectorsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'importSqlCollectors'.", id))); + } + return this.getWithResponse(resourceGroupName, projectName, importSqlCollectorsName, 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 importSqlCollectorsName = ResourceManagerUtils.getValueFromIdByName(id, "importSqlCollectors"); + if (importSqlCollectorsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'importSqlCollectors'.", id))); + } + return this.getWithResponse(resourceGroupName, projectName, importSqlCollectorsName, 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 importSqlCollectorsName = ResourceManagerUtils.getValueFromIdByName(id, "importSqlCollectors"); + if (importSqlCollectorsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'importSqlCollectors'.", id))); + } + this.deleteWithResponse(resourceGroupName, projectName, importSqlCollectorsName, 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 importSqlCollectorsName = ResourceManagerUtils.getValueFromIdByName(id, "importSqlCollectors"); + if (importSqlCollectorsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'importSqlCollectors'.", id))); + } + return this.deleteWithResponse(resourceGroupName, projectName, importSqlCollectorsName, context); + } + + private ImportSqlCollectorOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + public ImportSqlCollectorImpl define(String name) { + return new ImportSqlCollectorImpl(name, this.manager()); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentV2Impl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentV2Impl.java new file mode 100644 index 000000000000..633c6827e328 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentV2Impl.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.MachineAssessmentV2Inner; +import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; +import com.azure.resourcemanager.migration.assessment.models.MachineAssessmentV2; +import com.azure.resourcemanager.migration.assessment.models.MachineAssessmentV2Properties; + +public final class MachineAssessmentV2Impl implements MachineAssessmentV2, MachineAssessmentV2.Definition { + private MachineAssessmentV2Inner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + MachineAssessmentV2Impl(MachineAssessmentV2Inner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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.migration.assessment.MigrationAssessmentManager 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.migration.assessment.MigrationAssessmentManager 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(Object body) { + return serviceManager.machineAssessmentsV2Operations() + .downloadUrl(resourceGroupName, projectName, assessmentName, body); + } + + public DownloadUrl downloadUrl(Object 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentV2SummaryImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentV2SummaryImpl.java new file mode 100644 index 000000000000..fec06cd887d4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentV2SummaryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.MachineAssessmentV2SummaryInner; +import com.azure.resourcemanager.migration.assessment.models.MachineAssessmentV2Summary; +import com.azure.resourcemanager.migration.assessment.models.SummaryProperties; + +public final class MachineAssessmentV2SummaryImpl implements MachineAssessmentV2Summary { + private MachineAssessmentV2SummaryInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + MachineAssessmentV2SummaryImpl(MachineAssessmentV2SummaryInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentV2SummaryOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentV2SummaryOperationsClientImpl.java new file mode 100644 index 000000000000..8cd4e507c2ce --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentV2SummaryOperationsClientImpl.java @@ -0,0 +1,453 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.MachineAssessmentV2SummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.MachineAssessmentV2SummaryInner; +import com.azure.resourcemanager.migration.assessment.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 MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of MachineAssessmentV2SummaryOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MachineAssessmentV2SummaryOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(MachineAssessmentV2SummaryOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * MigrationAssessmentManagementClientMachineAssessmentV2SummaryOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface MachineAssessmentV2SummaryOperationsService { + @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("$host") 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/{assessmentName}/summaries/{summaryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParentNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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 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 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(); + } + + /** + * 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentV2SummaryOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentV2SummaryOperationsImpl.java new file mode 100644 index 000000000000..b28c06d05bcc --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentV2SummaryOperationsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.MachineAssessmentV2SummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.MachineAssessmentV2SummaryInner; +import com.azure.resourcemanager.migration.assessment.models.MachineAssessmentV2Summary; +import com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager serviceManager; + + public MachineAssessmentV2SummaryOperationsImpl(MachineAssessmentV2SummaryOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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())); + } + + 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; + } + } + + private MachineAssessmentV2SummaryOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentsV2OperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentsV2OperationsClientImpl.java new file mode 100644 index 000000000000..870f94be1c06 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentsV2OperationsClientImpl.java @@ -0,0 +1,1101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.MachineAssessmentsV2OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.MachineAssessmentV2Inner; +import com.azure.resourcemanager.migration.assessment.models.MachineAssessmentV2ListResult; +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 MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of MachineAssessmentsV2OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MachineAssessmentsV2OperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(MachineAssessmentsV2OperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientMachineAssessmentsV2Operations to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface MachineAssessmentsV2OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/assessments/{assessmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessments/{assessmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, + @BodyParam("application/json") MachineAssessmentV2Inner resource, @HeaderParam("Accept") String accept, + 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("$host") 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessments/{assessmentName}/downloadUrl") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> downloadUrl(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, @BodyParam("application/json") Object body, + @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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 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)); + } + + /** + * 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(); + } + + /** + * 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 accept = "application/json"; + return FluxUtil.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, resource, accept, 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, assessmentName, resource, accept, 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 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, Object 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.downloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, body, accept, 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 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, Object 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.")); + } + 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, body, accept, 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 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, Object 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 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, Object 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 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, Object 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 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, Object 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 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, + Object 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 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, + Object 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 the URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, + Object 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 the URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, + Object 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentsV2OperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentsV2OperationsImpl.java new file mode 100644 index 000000000000..de63a1e3ae67 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineAssessmentsV2OperationsImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.MachineAssessmentsV2OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.MachineAssessmentV2Inner; +import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; +import com.azure.resourcemanager.migration.assessment.models.MachineAssessmentV2; +import com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager serviceManager; + + public MachineAssessmentsV2OperationsImpl(MachineAssessmentsV2OperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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 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 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, Object 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, Object 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.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + public MachineAssessmentV2Impl define(String name) { + return new MachineAssessmentV2Impl(name, this.manager()); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineGraphAssessmentOptionsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineGraphAssessmentOptionsImpl.java new file mode 100644 index 000000000000..77ca7beddbff --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineGraphAssessmentOptionsImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.MachineGraphAssessmentOptionsInner; +import com.azure.resourcemanager.migration.assessment.models.MachineGraphAssessmentOptions; +import com.azure.resourcemanager.migration.assessment.models.MachineGraphAssessmentOptionsProperties; + +public final class MachineGraphAssessmentOptionsImpl implements MachineGraphAssessmentOptions { + private MachineGraphAssessmentOptionsInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + MachineGraphAssessmentOptionsImpl(MachineGraphAssessmentOptionsInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineGraphAssessmentOptionsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineGraphAssessmentOptionsOperationsClientImpl.java new file mode 100644 index 000000000000..9b3a9c3a2b12 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineGraphAssessmentOptionsOperationsClientImpl.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.MachineGraphAssessmentOptionsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.MachineGraphAssessmentOptionsInner; +import com.azure.resourcemanager.migration.assessment.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 MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of MachineGraphAssessmentOptionsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MachineGraphAssessmentOptionsOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(MachineGraphAssessmentOptionsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * MigrationAssessmentManagementClientMachineGraphAssessmentOptionsOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface MachineGraphAssessmentOptionsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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 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 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(); + } + + /** + * 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineGraphAssessmentOptionsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineGraphAssessmentOptionsOperationsImpl.java new file mode 100644 index 000000000000..aff38d665cfd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineGraphAssessmentOptionsOperationsImpl.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.MachineGraphAssessmentOptionsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.MachineGraphAssessmentOptionsInner; +import com.azure.resourcemanager.migration.assessment.models.MachineGraphAssessmentOptions; +import com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager serviceManager; + + public MachineGraphAssessmentOptionsOperationsImpl(MachineGraphAssessmentOptionsOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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())); + } + + 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; + } + } + + private MachineGraphAssessmentOptionsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineImpl.java deleted file mode 100644 index 85d4282e45d1..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachineImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.MachineInner; -import com.azure.resourcemanager.migration.assessment.models.Machine; -import com.azure.resourcemanager.migration.assessment.models.MachineProperties; - -public final class MachineImpl implements Machine { - private MachineInner innerObject; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - MachineImpl(MachineInner innerObject, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 MachineProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public MachineInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachinesOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachinesOperationsClientImpl.java deleted file mode 100644 index 1c9dddfad45f..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachinesOperationsClientImpl.java +++ /dev/null @@ -1,475 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.MachinesOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.MachineInner; -import com.azure.resourcemanager.migration.assessment.models.MachineListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in MachinesOperationsClient. - */ -public final class MachinesOperationsClientImpl implements MachinesOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final MachinesOperationsService service; - - /** - * The service client containing this operation class. - */ - private final MigrationAssessmentManagementClientImpl client; - - /** - * Initializes an instance of MachinesOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - MachinesOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { - this.service = RestProxy.create(MachinesOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MigrationAssessmentManagementClientMachinesOperations to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MigrationAssessmentM") - public interface MachinesOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProject(@HostParam("$host") 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, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("machineName") String machineName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProjectNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List Machine resources by AssessmentProject. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project 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 Machine list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(String resourceGroupName, - String projectName, 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByAssessmentProject(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, - continuationToken, totalRecordCount, 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 Machine resources by AssessmentProject. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project 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 Machine list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(String resourceGroupName, - String projectName, 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, continuationToken, - totalRecordCount, projectName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List Machine resources by AssessmentProject. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project 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 Machine list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName, - String filter, Integer pageSize, String continuationToken, Integer totalRecordCount) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName, filter, - pageSize, continuationToken, totalRecordCount), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink)); - } - - /** - * List Machine 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 Machine list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName) { - final String filter = null; - final Integer pageSize = null; - final String continuationToken = null; - final Integer totalRecordCount = null; - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName, filter, - pageSize, continuationToken, totalRecordCount), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink)); - } - - /** - * List Machine resources by AssessmentProject. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project 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 Machine list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName, - String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, Context context) { - return new PagedFlux<>( - () -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName, filter, pageSize, - continuationToken, totalRecordCount, context), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink, context)); - } - - /** - * List Machine 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 Machine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - final String filter = null; - final Integer pageSize = null; - final String continuationToken = null; - final Integer totalRecordCount = null; - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName, filter, pageSize, - continuationToken, totalRecordCount)); - } - - /** - * List Machine resources by AssessmentProject. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project 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 Machine list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, Context context) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName, filter, pageSize, - continuationToken, totalRecordCount, context)); - } - - /** - * Get a Machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param machineName Assessible 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 Machine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String machineName) { - 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 (machineName == null) { - return Mono.error(new IllegalArgumentException("Parameter machineName 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, machineName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a Machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param machineName Assessible 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 Machine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String machineName, 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 (machineName == null) { - return Mono.error(new IllegalArgumentException("Parameter machineName 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, machineName, accept, context); - } - - /** - * Get a Machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param machineName Assessible 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 Machine on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String projectName, String machineName) { - return getWithResponseAsync(resourceGroupName, projectName, machineName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a Machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param machineName Assessible 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 Machine along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String projectName, String machineName, - Context context) { - return getWithResponseAsync(resourceGroupName, projectName, machineName, context).block(); - } - - /** - * Get a Machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param machineName Assessible 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 Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MachineInner get(String resourceGroupName, String projectName, String machineName) { - return getWithResponse(resourceGroupName, projectName, machineName, Context.NONE).getValue(); - } - - /** - * 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 Machine list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(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.listByAssessmentProjectNext(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 Machine list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(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.listByAssessmentProjectNext(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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachinesOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachinesOperationsImpl.java deleted file mode 100644 index 8e8152c07fce..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MachinesOperationsImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.MachinesOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.MachineInner; -import com.azure.resourcemanager.migration.assessment.models.Machine; -import com.azure.resourcemanager.migration.assessment.models.MachinesOperations; - -public final class MachinesOperationsImpl implements MachinesOperations { - private static final ClientLogger LOGGER = new ClientLogger(MachinesOperationsImpl.class); - - private final MachinesOperationsClient innerClient; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - public MachinesOperationsImpl(MachinesOperationsClient innerClient, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MachineImpl(inner1, this.manager())); - } - - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, String filter, - Integer pageSize, String continuationToken, Integer totalRecordCount, Context context) { - PagedIterable inner = this.serviceClient() - .listByAssessmentProject(resourceGroupName, projectName, filter, pageSize, continuationToken, - totalRecordCount, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MachineImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String projectName, String machineName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, projectName, machineName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MachineImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Machine get(String resourceGroupName, String projectName, String machineName) { - MachineInner inner = this.serviceClient().get(resourceGroupName, projectName, machineName); - if (inner != null) { - return new MachineImpl(inner, this.manager()); - } else { - return null; - } - } - - private MachinesOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MigrationAssessmentManagementClientBuilder.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MigrationAssessmentManagementClientBuilder.java index cbb4b4a28039..8a0ee6e4557a 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MigrationAssessmentManagementClientBuilder.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MigrationAssessmentManagementClientBuilder.java @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { MigrationAssessmentManagementClientImpl.class }) public final class MigrationAssessmentManagementClientBuilder { /* - * The ID of the target subscription. + * The ID of the target subscription. The value must be an UUID. */ private String subscriptionId; /** - * Sets The ID of the target subscription. + * Sets The ID of the target subscription. The value must be an UUID. * * @param subscriptionId the subscriptionId value. * @return the MigrationAssessmentManagementClientBuilder. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MigrationAssessmentManagementClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MigrationAssessmentManagementClientImpl.java index 66c1cd731f96..0f8af93c5d20 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MigrationAssessmentManagementClientImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/MigrationAssessmentManagementClientImpl.java @@ -23,32 +23,57 @@ 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.migration.assessment.fluent.AssessedMachinesOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.AssessedSqlDatabaseV2OperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.AssessedSqlInstanceV2OperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.AssessedSqlMachinesOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.AssessedSqlRecommendedEntityOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.AssessmentOptionsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.AksAssessmentOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.AksClusterOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.AksCostDetailOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.AksOptionsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.AksSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.AssessedMachinesV2OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.AssessedSqlDatabaseV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.AssessedSqlInstanceV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.AssessedSqlMachinesV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.AssessedWebApplicationOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.AssessedWebAppsV3OperationsClient; import com.azure.resourcemanager.migration.assessment.fluent.AssessmentProjectSummaryOperationsClient; import com.azure.resourcemanager.migration.assessment.fluent.AssessmentProjectsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.AssessmentsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.AvsAssessedMachinesOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.AvsAssessmentOptionsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.AvsAssessmentsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.GroupsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.AvsAssessedMachinesV2OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.AvsAssessmentV2SummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.AvsAssessmentsV2OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.AvsGraphAssessmentOptionsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.BusinessCaseAvsSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.BusinessCaseIaasSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.BusinessCaseOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.BusinessCaseOverviewSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.BusinessCasePaasSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.CompoundAssessmentOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.CompoundAssessmentSummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.EvaluatedAvsMachinesOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.EvaluatedMachinesOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.EvaluatedSqlEntitiesOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.EvaluatedWebAppsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.HeterogeneousAssessmentOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.HeterogeneousAssessmentSummaryOperationsClient; import com.azure.resourcemanager.migration.assessment.fluent.HypervCollectorsOperationsClient; import com.azure.resourcemanager.migration.assessment.fluent.ImportCollectorsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.MachinesOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.ImportSqlCollectorOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.MachineAssessmentV2SummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.MachineAssessmentsV2OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.MachineGraphAssessmentOptionsOperationsClient; import com.azure.resourcemanager.migration.assessment.fluent.MigrationAssessmentManagementClient; import com.azure.resourcemanager.migration.assessment.fluent.OperationsClient; import com.azure.resourcemanager.migration.assessment.fluent.PrivateEndpointConnectionOperationsClient; import com.azure.resourcemanager.migration.assessment.fluent.PrivateLinkResourceOperationsClient; import com.azure.resourcemanager.migration.assessment.fluent.ServerCollectorsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.SqlAssessmentOptionsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.SqlAssessmentV2OperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.SqlAssessmentV2SummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.SqlAssessmentV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.SqlAssessmentV3SummaryOperationsClient; import com.azure.resourcemanager.migration.assessment.fluent.SqlCollectorOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.SqlGraphAssessmentOptionsOperationsClient; import com.azure.resourcemanager.migration.assessment.fluent.VmwareCollectorsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.WebAppAssessmentV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.WebAppAssessmentV3SummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.WebAppCollectorOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.WebAppGraphAssessmentOptionsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.WebAppServicePlansOperationsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -64,12 +89,12 @@ @ServiceClient(builder = MigrationAssessmentManagementClientBuilder.class) public final class MigrationAssessmentManagementClientImpl implements MigrationAssessmentManagementClient { /** - * The ID of the target subscription. + * The ID of the target subscription. The value must be an UUID. */ private final String subscriptionId; /** - * Gets The ID of the target subscription. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -176,297 +201,633 @@ public AssessmentProjectsOperationsClient getAssessmentProjectsOperations() { } /** - * The AssessmentOptionsOperationsClient object to access its operations. + * The PrivateEndpointConnectionOperationsClient object to access its operations. */ - private final AssessmentOptionsOperationsClient assessmentOptionsOperations; + private final PrivateEndpointConnectionOperationsClient privateEndpointConnectionOperations; /** - * Gets the AssessmentOptionsOperationsClient object to access its operations. + * Gets the PrivateEndpointConnectionOperationsClient object to access its operations. * - * @return the AssessmentOptionsOperationsClient object. + * @return the PrivateEndpointConnectionOperationsClient object. */ - public AssessmentOptionsOperationsClient getAssessmentOptionsOperations() { - return this.assessmentOptionsOperations; + public PrivateEndpointConnectionOperationsClient getPrivateEndpointConnectionOperations() { + return this.privateEndpointConnectionOperations; } /** - * The AvsAssessmentOptionsOperationsClient object to access its operations. + * The PrivateLinkResourceOperationsClient object to access its operations. */ - private final AvsAssessmentOptionsOperationsClient avsAssessmentOptionsOperations; + private final PrivateLinkResourceOperationsClient privateLinkResourceOperations; /** - * Gets the AvsAssessmentOptionsOperationsClient object to access its operations. + * Gets the PrivateLinkResourceOperationsClient object to access its operations. * - * @return the AvsAssessmentOptionsOperationsClient object. + * @return the PrivateLinkResourceOperationsClient object. */ - public AvsAssessmentOptionsOperationsClient getAvsAssessmentOptionsOperations() { - return this.avsAssessmentOptionsOperations; + public PrivateLinkResourceOperationsClient getPrivateLinkResourceOperations() { + return this.privateLinkResourceOperations; } /** - * The GroupsOperationsClient object to access its operations. + * The AssessmentProjectSummaryOperationsClient object to access its operations. */ - private final GroupsOperationsClient groupsOperations; + private final AssessmentProjectSummaryOperationsClient assessmentProjectSummaryOperations; /** - * Gets the GroupsOperationsClient object to access its operations. + * Gets the AssessmentProjectSummaryOperationsClient object to access its operations. * - * @return the GroupsOperationsClient object. + * @return the AssessmentProjectSummaryOperationsClient object. */ - public GroupsOperationsClient getGroupsOperations() { - return this.groupsOperations; + public AssessmentProjectSummaryOperationsClient getAssessmentProjectSummaryOperations() { + return this.assessmentProjectSummaryOperations; } /** - * The AssessmentsOperationsClient object to access its operations. + * The AvsGraphAssessmentOptionsOperationsClient object to access its operations. */ - private final AssessmentsOperationsClient assessmentsOperations; + private final AvsGraphAssessmentOptionsOperationsClient avsGraphAssessmentOptionsOperations; /** - * Gets the AssessmentsOperationsClient object to access its operations. + * Gets the AvsGraphAssessmentOptionsOperationsClient object to access its operations. * - * @return the AssessmentsOperationsClient object. + * @return the AvsGraphAssessmentOptionsOperationsClient object. */ - public AssessmentsOperationsClient getAssessmentsOperations() { - return this.assessmentsOperations; + public AvsGraphAssessmentOptionsOperationsClient getAvsGraphAssessmentOptionsOperations() { + return this.avsGraphAssessmentOptionsOperations; } /** - * The AssessedMachinesOperationsClient object to access its operations. + * The AvsAssessmentsV2OperationsClient object to access its operations. */ - private final AssessedMachinesOperationsClient assessedMachinesOperations; + private final AvsAssessmentsV2OperationsClient avsAssessmentsV2Operations; /** - * Gets the AssessedMachinesOperationsClient object to access its operations. + * Gets the AvsAssessmentsV2OperationsClient object to access its operations. * - * @return the AssessedMachinesOperationsClient object. + * @return the AvsAssessmentsV2OperationsClient object. */ - public AssessedMachinesOperationsClient getAssessedMachinesOperations() { - return this.assessedMachinesOperations; + public AvsAssessmentsV2OperationsClient getAvsAssessmentsV2Operations() { + return this.avsAssessmentsV2Operations; } /** - * The AvsAssessmentsOperationsClient object to access its operations. + * The AvsAssessedMachinesV2OperationsClient object to access its operations. */ - private final AvsAssessmentsOperationsClient avsAssessmentsOperations; + private final AvsAssessedMachinesV2OperationsClient avsAssessedMachinesV2Operations; /** - * Gets the AvsAssessmentsOperationsClient object to access its operations. + * Gets the AvsAssessedMachinesV2OperationsClient object to access its operations. * - * @return the AvsAssessmentsOperationsClient object. + * @return the AvsAssessedMachinesV2OperationsClient object. */ - public AvsAssessmentsOperationsClient getAvsAssessmentsOperations() { - return this.avsAssessmentsOperations; + public AvsAssessedMachinesV2OperationsClient getAvsAssessedMachinesV2Operations() { + return this.avsAssessedMachinesV2Operations; } /** - * The AvsAssessedMachinesOperationsClient object to access its operations. + * The AvsAssessmentV2SummaryOperationsClient object to access its operations. */ - private final AvsAssessedMachinesOperationsClient avsAssessedMachinesOperations; + private final AvsAssessmentV2SummaryOperationsClient avsAssessmentV2SummaryOperations; /** - * Gets the AvsAssessedMachinesOperationsClient object to access its operations. + * Gets the AvsAssessmentV2SummaryOperationsClient object to access its operations. * - * @return the AvsAssessedMachinesOperationsClient object. + * @return the AvsAssessmentV2SummaryOperationsClient object. */ - public AvsAssessedMachinesOperationsClient getAvsAssessedMachinesOperations() { - return this.avsAssessedMachinesOperations; + public AvsAssessmentV2SummaryOperationsClient getAvsAssessmentV2SummaryOperations() { + return this.avsAssessmentV2SummaryOperations; } /** - * The SqlAssessmentV2OperationsClient object to access its operations. + * The HeterogeneousAssessmentOperationsClient object to access its operations. */ - private final SqlAssessmentV2OperationsClient sqlAssessmentV2Operations; + private final HeterogeneousAssessmentOperationsClient heterogeneousAssessmentOperations; /** - * Gets the SqlAssessmentV2OperationsClient object to access its operations. + * Gets the HeterogeneousAssessmentOperationsClient object to access its operations. * - * @return the SqlAssessmentV2OperationsClient object. + * @return the HeterogeneousAssessmentOperationsClient object. */ - public SqlAssessmentV2OperationsClient getSqlAssessmentV2Operations() { - return this.sqlAssessmentV2Operations; + public HeterogeneousAssessmentOperationsClient getHeterogeneousAssessmentOperations() { + return this.heterogeneousAssessmentOperations; } /** - * The AssessedSqlDatabaseV2OperationsClient object to access its operations. + * The HeterogeneousAssessmentSummaryOperationsClient object to access its operations. */ - private final AssessedSqlDatabaseV2OperationsClient assessedSqlDatabaseV2Operations; + private final HeterogeneousAssessmentSummaryOperationsClient heterogeneousAssessmentSummaryOperations; /** - * Gets the AssessedSqlDatabaseV2OperationsClient object to access its operations. + * Gets the HeterogeneousAssessmentSummaryOperationsClient object to access its operations. * - * @return the AssessedSqlDatabaseV2OperationsClient object. + * @return the HeterogeneousAssessmentSummaryOperationsClient object. */ - public AssessedSqlDatabaseV2OperationsClient getAssessedSqlDatabaseV2Operations() { - return this.assessedSqlDatabaseV2Operations; + public HeterogeneousAssessmentSummaryOperationsClient getHeterogeneousAssessmentSummaryOperations() { + return this.heterogeneousAssessmentSummaryOperations; } /** - * The AssessedSqlInstanceV2OperationsClient object to access its operations. + * The MachineGraphAssessmentOptionsOperationsClient object to access its operations. */ - private final AssessedSqlInstanceV2OperationsClient assessedSqlInstanceV2Operations; + private final MachineGraphAssessmentOptionsOperationsClient machineGraphAssessmentOptionsOperations; /** - * Gets the AssessedSqlInstanceV2OperationsClient object to access its operations. + * Gets the MachineGraphAssessmentOptionsOperationsClient object to access its operations. * - * @return the AssessedSqlInstanceV2OperationsClient object. + * @return the MachineGraphAssessmentOptionsOperationsClient object. */ - public AssessedSqlInstanceV2OperationsClient getAssessedSqlInstanceV2Operations() { - return this.assessedSqlInstanceV2Operations; + public MachineGraphAssessmentOptionsOperationsClient getMachineGraphAssessmentOptionsOperations() { + return this.machineGraphAssessmentOptionsOperations; } /** - * The AssessedSqlMachinesOperationsClient object to access its operations. + * The MachineAssessmentsV2OperationsClient object to access its operations. */ - private final AssessedSqlMachinesOperationsClient assessedSqlMachinesOperations; + private final MachineAssessmentsV2OperationsClient machineAssessmentsV2Operations; /** - * Gets the AssessedSqlMachinesOperationsClient object to access its operations. + * Gets the MachineAssessmentsV2OperationsClient object to access its operations. * - * @return the AssessedSqlMachinesOperationsClient object. + * @return the MachineAssessmentsV2OperationsClient object. */ - public AssessedSqlMachinesOperationsClient getAssessedSqlMachinesOperations() { - return this.assessedSqlMachinesOperations; + public MachineAssessmentsV2OperationsClient getMachineAssessmentsV2Operations() { + return this.machineAssessmentsV2Operations; } /** - * The AssessedSqlRecommendedEntityOperationsClient object to access its operations. + * The AssessedMachinesV2OperationsClient object to access its operations. */ - private final AssessedSqlRecommendedEntityOperationsClient assessedSqlRecommendedEntityOperations; + private final AssessedMachinesV2OperationsClient assessedMachinesV2Operations; /** - * Gets the AssessedSqlRecommendedEntityOperationsClient object to access its operations. + * Gets the AssessedMachinesV2OperationsClient object to access its operations. * - * @return the AssessedSqlRecommendedEntityOperationsClient object. + * @return the AssessedMachinesV2OperationsClient object. */ - public AssessedSqlRecommendedEntityOperationsClient getAssessedSqlRecommendedEntityOperations() { - return this.assessedSqlRecommendedEntityOperations; + public AssessedMachinesV2OperationsClient getAssessedMachinesV2Operations() { + return this.assessedMachinesV2Operations; } /** - * The SqlAssessmentV2SummaryOperationsClient object to access its operations. + * The MachineAssessmentV2SummaryOperationsClient object to access its operations. */ - private final SqlAssessmentV2SummaryOperationsClient sqlAssessmentV2SummaryOperations; + private final MachineAssessmentV2SummaryOperationsClient machineAssessmentV2SummaryOperations; /** - * Gets the SqlAssessmentV2SummaryOperationsClient object to access its operations. + * Gets the MachineAssessmentV2SummaryOperationsClient object to access its operations. * - * @return the SqlAssessmentV2SummaryOperationsClient object. + * @return the MachineAssessmentV2SummaryOperationsClient object. */ - public SqlAssessmentV2SummaryOperationsClient getSqlAssessmentV2SummaryOperations() { - return this.sqlAssessmentV2SummaryOperations; + public MachineAssessmentV2SummaryOperationsClient getMachineAssessmentV2SummaryOperations() { + return this.machineAssessmentV2SummaryOperations; } /** - * The HypervCollectorsOperationsClient object to access its operations. + * The SqlGraphAssessmentOptionsOperationsClient object to access its operations. */ - private final HypervCollectorsOperationsClient hypervCollectorsOperations; + private final SqlGraphAssessmentOptionsOperationsClient sqlGraphAssessmentOptionsOperations; /** - * Gets the HypervCollectorsOperationsClient object to access its operations. + * Gets the SqlGraphAssessmentOptionsOperationsClient object to access its operations. * - * @return the HypervCollectorsOperationsClient object. + * @return the SqlGraphAssessmentOptionsOperationsClient object. */ - public HypervCollectorsOperationsClient getHypervCollectorsOperations() { - return this.hypervCollectorsOperations; + public SqlGraphAssessmentOptionsOperationsClient getSqlGraphAssessmentOptionsOperations() { + return this.sqlGraphAssessmentOptionsOperations; } /** - * The ImportCollectorsOperationsClient object to access its operations. + * The SqlAssessmentV3OperationsClient object to access its operations. */ - private final ImportCollectorsOperationsClient importCollectorsOperations; + private final SqlAssessmentV3OperationsClient sqlAssessmentV3Operations; /** - * Gets the ImportCollectorsOperationsClient object to access its operations. + * Gets the SqlAssessmentV3OperationsClient object to access its operations. * - * @return the ImportCollectorsOperationsClient object. + * @return the SqlAssessmentV3OperationsClient object. */ - public ImportCollectorsOperationsClient getImportCollectorsOperations() { - return this.importCollectorsOperations; + public SqlAssessmentV3OperationsClient getSqlAssessmentV3Operations() { + return this.sqlAssessmentV3Operations; } /** - * The MachinesOperationsClient object to access its operations. + * The AssessedSqlDatabaseV3OperationsClient object to access its operations. */ - private final MachinesOperationsClient machinesOperations; + private final AssessedSqlDatabaseV3OperationsClient assessedSqlDatabaseV3Operations; /** - * Gets the MachinesOperationsClient object to access its operations. + * Gets the AssessedSqlDatabaseV3OperationsClient object to access its operations. * - * @return the MachinesOperationsClient object. + * @return the AssessedSqlDatabaseV3OperationsClient object. */ - public MachinesOperationsClient getMachinesOperations() { - return this.machinesOperations; + public AssessedSqlDatabaseV3OperationsClient getAssessedSqlDatabaseV3Operations() { + return this.assessedSqlDatabaseV3Operations; } /** - * The PrivateEndpointConnectionOperationsClient object to access its operations. + * The AssessedSqlInstanceV3OperationsClient object to access its operations. */ - private final PrivateEndpointConnectionOperationsClient privateEndpointConnectionOperations; + private final AssessedSqlInstanceV3OperationsClient assessedSqlInstanceV3Operations; /** - * Gets the PrivateEndpointConnectionOperationsClient object to access its operations. + * Gets the AssessedSqlInstanceV3OperationsClient object to access its operations. * - * @return the PrivateEndpointConnectionOperationsClient object. + * @return the AssessedSqlInstanceV3OperationsClient object. */ - public PrivateEndpointConnectionOperationsClient getPrivateEndpointConnectionOperations() { - return this.privateEndpointConnectionOperations; + public AssessedSqlInstanceV3OperationsClient getAssessedSqlInstanceV3Operations() { + return this.assessedSqlInstanceV3Operations; } /** - * The PrivateLinkResourceOperationsClient object to access its operations. + * The AssessedSqlMachinesV3OperationsClient object to access its operations. */ - private final PrivateLinkResourceOperationsClient privateLinkResourceOperations; + private final AssessedSqlMachinesV3OperationsClient assessedSqlMachinesV3Operations; /** - * Gets the PrivateLinkResourceOperationsClient object to access its operations. + * Gets the AssessedSqlMachinesV3OperationsClient object to access its operations. * - * @return the PrivateLinkResourceOperationsClient object. + * @return the AssessedSqlMachinesV3OperationsClient object. */ - public PrivateLinkResourceOperationsClient getPrivateLinkResourceOperations() { - return this.privateLinkResourceOperations; + public AssessedSqlMachinesV3OperationsClient getAssessedSqlMachinesV3Operations() { + return this.assessedSqlMachinesV3Operations; } /** - * The AssessmentProjectSummaryOperationsClient object to access its operations. + * The SqlAssessmentV3SummaryOperationsClient object to access its operations. */ - private final AssessmentProjectSummaryOperationsClient assessmentProjectSummaryOperations; + private final SqlAssessmentV3SummaryOperationsClient sqlAssessmentV3SummaryOperations; /** - * Gets the AssessmentProjectSummaryOperationsClient object to access its operations. + * Gets the SqlAssessmentV3SummaryOperationsClient object to access its operations. * - * @return the AssessmentProjectSummaryOperationsClient object. + * @return the SqlAssessmentV3SummaryOperationsClient object. */ - public AssessmentProjectSummaryOperationsClient getAssessmentProjectSummaryOperations() { - return this.assessmentProjectSummaryOperations; + public SqlAssessmentV3SummaryOperationsClient getSqlAssessmentV3SummaryOperations() { + return this.sqlAssessmentV3SummaryOperations; } /** - * The ServerCollectorsOperationsClient object to access its operations. + * The BusinessCaseOperationsClient object to access its operations. */ - private final ServerCollectorsOperationsClient serverCollectorsOperations; + private final BusinessCaseOperationsClient businessCaseOperations; /** - * Gets the ServerCollectorsOperationsClient object to access its operations. + * Gets the BusinessCaseOperationsClient object to access its operations. * - * @return the ServerCollectorsOperationsClient object. + * @return the BusinessCaseOperationsClient object. */ - public ServerCollectorsOperationsClient getServerCollectorsOperations() { - return this.serverCollectorsOperations; + public BusinessCaseOperationsClient getBusinessCaseOperations() { + return this.businessCaseOperations; + } + + /** + * The BusinessCaseAvsSummaryOperationsClient object to access its operations. + */ + private final BusinessCaseAvsSummaryOperationsClient businessCaseAvsSummaryOperations; + + /** + * Gets the BusinessCaseAvsSummaryOperationsClient object to access its operations. + * + * @return the BusinessCaseAvsSummaryOperationsClient object. + */ + public BusinessCaseAvsSummaryOperationsClient getBusinessCaseAvsSummaryOperations() { + return this.businessCaseAvsSummaryOperations; + } + + /** + * The EvaluatedAvsMachinesOperationsClient object to access its operations. + */ + private final EvaluatedAvsMachinesOperationsClient evaluatedAvsMachinesOperations; + + /** + * Gets the EvaluatedAvsMachinesOperationsClient object to access its operations. + * + * @return the EvaluatedAvsMachinesOperationsClient object. + */ + public EvaluatedAvsMachinesOperationsClient getEvaluatedAvsMachinesOperations() { + return this.evaluatedAvsMachinesOperations; + } + + /** + * The EvaluatedMachinesOperationsClient object to access its operations. + */ + private final EvaluatedMachinesOperationsClient evaluatedMachinesOperations; + + /** + * Gets the EvaluatedMachinesOperationsClient object to access its operations. + * + * @return the EvaluatedMachinesOperationsClient object. + */ + public EvaluatedMachinesOperationsClient getEvaluatedMachinesOperations() { + return this.evaluatedMachinesOperations; + } + + /** + * The EvaluatedSqlEntitiesOperationsClient object to access its operations. + */ + private final EvaluatedSqlEntitiesOperationsClient evaluatedSqlEntitiesOperations; + + /** + * Gets the EvaluatedSqlEntitiesOperationsClient object to access its operations. + * + * @return the EvaluatedSqlEntitiesOperationsClient object. + */ + public EvaluatedSqlEntitiesOperationsClient getEvaluatedSqlEntitiesOperations() { + return this.evaluatedSqlEntitiesOperations; + } + + /** + * The EvaluatedWebAppsOperationsClient object to access its operations. + */ + private final EvaluatedWebAppsOperationsClient evaluatedWebAppsOperations; + + /** + * Gets the EvaluatedWebAppsOperationsClient object to access its operations. + * + * @return the EvaluatedWebAppsOperationsClient object. + */ + public EvaluatedWebAppsOperationsClient getEvaluatedWebAppsOperations() { + return this.evaluatedWebAppsOperations; + } + + /** + * The BusinessCaseIaasSummaryOperationsClient object to access its operations. + */ + private final BusinessCaseIaasSummaryOperationsClient businessCaseIaasSummaryOperations; + + /** + * Gets the BusinessCaseIaasSummaryOperationsClient object to access its operations. + * + * @return the BusinessCaseIaasSummaryOperationsClient object. + */ + public BusinessCaseIaasSummaryOperationsClient getBusinessCaseIaasSummaryOperations() { + return this.businessCaseIaasSummaryOperations; + } + + /** + * The BusinessCaseOverviewSummaryOperationsClient object to access its operations. + */ + private final BusinessCaseOverviewSummaryOperationsClient businessCaseOverviewSummaryOperations; + + /** + * Gets the BusinessCaseOverviewSummaryOperationsClient object to access its operations. + * + * @return the BusinessCaseOverviewSummaryOperationsClient object. + */ + public BusinessCaseOverviewSummaryOperationsClient getBusinessCaseOverviewSummaryOperations() { + return this.businessCaseOverviewSummaryOperations; + } + + /** + * The BusinessCasePaasSummaryOperationsClient object to access its operations. + */ + private final BusinessCasePaasSummaryOperationsClient businessCasePaasSummaryOperations; + + /** + * Gets the BusinessCasePaasSummaryOperationsClient object to access its operations. + * + * @return the BusinessCasePaasSummaryOperationsClient object. + */ + public BusinessCasePaasSummaryOperationsClient getBusinessCasePaasSummaryOperations() { + return this.businessCasePaasSummaryOperations; + } + + /** + * The WebAppGraphAssessmentOptionsOperationsClient object to access its operations. + */ + private final WebAppGraphAssessmentOptionsOperationsClient webAppGraphAssessmentOptionsOperations; + + /** + * Gets the WebAppGraphAssessmentOptionsOperationsClient object to access its operations. + * + * @return the WebAppGraphAssessmentOptionsOperationsClient object. + */ + public WebAppGraphAssessmentOptionsOperationsClient getWebAppGraphAssessmentOptionsOperations() { + return this.webAppGraphAssessmentOptionsOperations; + } + + /** + * The WebAppAssessmentV3OperationsClient object to access its operations. + */ + private final WebAppAssessmentV3OperationsClient webAppAssessmentV3Operations; + + /** + * Gets the WebAppAssessmentV3OperationsClient object to access its operations. + * + * @return the WebAppAssessmentV3OperationsClient object. + */ + public WebAppAssessmentV3OperationsClient getWebAppAssessmentV3Operations() { + return this.webAppAssessmentV3Operations; + } + + /** + * The AssessedWebAppsV3OperationsClient object to access its operations. + */ + private final AssessedWebAppsV3OperationsClient assessedWebAppsV3Operations; + + /** + * Gets the AssessedWebAppsV3OperationsClient object to access its operations. + * + * @return the AssessedWebAppsV3OperationsClient object. + */ + public AssessedWebAppsV3OperationsClient getAssessedWebAppsV3Operations() { + return this.assessedWebAppsV3Operations; + } + + /** + * The WebAppAssessmentV3SummaryOperationsClient object to access its operations. + */ + private final WebAppAssessmentV3SummaryOperationsClient webAppAssessmentV3SummaryOperations; + + /** + * Gets the WebAppAssessmentV3SummaryOperationsClient object to access its operations. + * + * @return the WebAppAssessmentV3SummaryOperationsClient object. + */ + public WebAppAssessmentV3SummaryOperationsClient getWebAppAssessmentV3SummaryOperations() { + return this.webAppAssessmentV3SummaryOperations; + } + + /** + * The WebAppServicePlansOperationsClient object to access its operations. + */ + private final WebAppServicePlansOperationsClient webAppServicePlansOperations; + + /** + * Gets the WebAppServicePlansOperationsClient object to access its operations. + * + * @return the WebAppServicePlansOperationsClient object. + */ + public WebAppServicePlansOperationsClient getWebAppServicePlansOperations() { + return this.webAppServicePlansOperations; + } + + /** + * The CompoundAssessmentOperationsClient object to access its operations. + */ + private final CompoundAssessmentOperationsClient compoundAssessmentOperations; + + /** + * Gets the CompoundAssessmentOperationsClient object to access its operations. + * + * @return the CompoundAssessmentOperationsClient object. + */ + public CompoundAssessmentOperationsClient getCompoundAssessmentOperations() { + return this.compoundAssessmentOperations; + } + + /** + * The CompoundAssessmentSummaryOperationsClient object to access its operations. + */ + private final CompoundAssessmentSummaryOperationsClient compoundAssessmentSummaryOperations; + + /** + * Gets the CompoundAssessmentSummaryOperationsClient object to access its operations. + * + * @return the CompoundAssessmentSummaryOperationsClient object. + */ + public CompoundAssessmentSummaryOperationsClient getCompoundAssessmentSummaryOperations() { + return this.compoundAssessmentSummaryOperations; + } + + /** + * The AksOptionsOperationsClient object to access its operations. + */ + private final AksOptionsOperationsClient aksOptionsOperations; + + /** + * Gets the AksOptionsOperationsClient object to access its operations. + * + * @return the AksOptionsOperationsClient object. + */ + public AksOptionsOperationsClient getAksOptionsOperations() { + return this.aksOptionsOperations; + } + + /** + * The AksAssessmentOperationsClient object to access its operations. + */ + private final AksAssessmentOperationsClient aksAssessmentOperations; + + /** + * Gets the AksAssessmentOperationsClient object to access its operations. + * + * @return the AksAssessmentOperationsClient object. + */ + public AksAssessmentOperationsClient getAksAssessmentOperations() { + return this.aksAssessmentOperations; + } + + /** + * The AssessedWebApplicationOperationsClient object to access its operations. + */ + private final AssessedWebApplicationOperationsClient assessedWebApplicationOperations; + + /** + * Gets the AssessedWebApplicationOperationsClient object to access its operations. + * + * @return the AssessedWebApplicationOperationsClient object. + */ + public AssessedWebApplicationOperationsClient getAssessedWebApplicationOperations() { + return this.assessedWebApplicationOperations; + } + + /** + * The AksClusterOperationsClient object to access its operations. + */ + private final AksClusterOperationsClient aksClusterOperations; + + /** + * Gets the AksClusterOperationsClient object to access its operations. + * + * @return the AksClusterOperationsClient object. + */ + public AksClusterOperationsClient getAksClusterOperations() { + return this.aksClusterOperations; + } + + /** + * The AksCostDetailOperationsClient object to access its operations. + */ + private final AksCostDetailOperationsClient aksCostDetailOperations; + + /** + * Gets the AksCostDetailOperationsClient object to access its operations. + * + * @return the AksCostDetailOperationsClient object. + */ + public AksCostDetailOperationsClient getAksCostDetailOperations() { + return this.aksCostDetailOperations; } /** - * The SqlAssessmentOptionsOperationsClient object to access its operations. + * The AksSummaryOperationsClient object to access its operations. */ - private final SqlAssessmentOptionsOperationsClient sqlAssessmentOptionsOperations; + private final AksSummaryOperationsClient aksSummaryOperations; /** - * Gets the SqlAssessmentOptionsOperationsClient object to access its operations. + * Gets the AksSummaryOperationsClient object to access its operations. * - * @return the SqlAssessmentOptionsOperationsClient object. + * @return the AksSummaryOperationsClient object. */ - public SqlAssessmentOptionsOperationsClient getSqlAssessmentOptionsOperations() { - return this.sqlAssessmentOptionsOperations; + public AksSummaryOperationsClient getAksSummaryOperations() { + return this.aksSummaryOperations; + } + + /** + * The HypervCollectorsOperationsClient object to access its operations. + */ + private final HypervCollectorsOperationsClient hypervCollectorsOperations; + + /** + * Gets the HypervCollectorsOperationsClient object to access its operations. + * + * @return the HypervCollectorsOperationsClient object. + */ + public HypervCollectorsOperationsClient getHypervCollectorsOperations() { + return this.hypervCollectorsOperations; + } + + /** + * The ImportSqlCollectorOperationsClient object to access its operations. + */ + private final ImportSqlCollectorOperationsClient importSqlCollectorOperations; + + /** + * Gets the ImportSqlCollectorOperationsClient object to access its operations. + * + * @return the ImportSqlCollectorOperationsClient object. + */ + public ImportSqlCollectorOperationsClient getImportSqlCollectorOperations() { + return this.importSqlCollectorOperations; + } + + /** + * The ImportCollectorsOperationsClient object to access its operations. + */ + private final ImportCollectorsOperationsClient importCollectorsOperations; + + /** + * Gets the ImportCollectorsOperationsClient object to access its operations. + * + * @return the ImportCollectorsOperationsClient object. + */ + public ImportCollectorsOperationsClient getImportCollectorsOperations() { + return this.importCollectorsOperations; + } + + /** + * The ServerCollectorsOperationsClient object to access its operations. + */ + private final ServerCollectorsOperationsClient serverCollectorsOperations; + + /** + * Gets the ServerCollectorsOperationsClient object to access its operations. + * + * @return the ServerCollectorsOperationsClient object. + */ + public ServerCollectorsOperationsClient getServerCollectorsOperations() { + return this.serverCollectorsOperations; } /** @@ -497,6 +858,20 @@ public VmwareCollectorsOperationsClient getVmwareCollectorsOperations() { return this.vmwareCollectorsOperations; } + /** + * The WebAppCollectorOperationsClient object to access its operations. + */ + private final WebAppCollectorOperationsClient webAppCollectorOperations; + + /** + * Gets the WebAppCollectorOperationsClient object to access its operations. + * + * @return the WebAppCollectorOperationsClient object. + */ + public WebAppCollectorOperationsClient getWebAppCollectorOperations() { + return this.webAppCollectorOperations; + } + /** * Initializes an instance of MigrationAssessmentManagementClient client. * @@ -504,7 +879,7 @@ public VmwareCollectorsOperationsClient getVmwareCollectorsOperations() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param endpoint server parameter. */ MigrationAssessmentManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, @@ -514,32 +889,57 @@ public VmwareCollectorsOperationsClient getVmwareCollectorsOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-03-15"; + this.apiVersion = "2024-03-03-preview"; this.operations = new OperationsClientImpl(this); this.assessmentProjectsOperations = new AssessmentProjectsOperationsClientImpl(this); - this.assessmentOptionsOperations = new AssessmentOptionsOperationsClientImpl(this); - this.avsAssessmentOptionsOperations = new AvsAssessmentOptionsOperationsClientImpl(this); - this.groupsOperations = new GroupsOperationsClientImpl(this); - this.assessmentsOperations = new AssessmentsOperationsClientImpl(this); - this.assessedMachinesOperations = new AssessedMachinesOperationsClientImpl(this); - this.avsAssessmentsOperations = new AvsAssessmentsOperationsClientImpl(this); - this.avsAssessedMachinesOperations = new AvsAssessedMachinesOperationsClientImpl(this); - this.sqlAssessmentV2Operations = new SqlAssessmentV2OperationsClientImpl(this); - this.assessedSqlDatabaseV2Operations = new AssessedSqlDatabaseV2OperationsClientImpl(this); - this.assessedSqlInstanceV2Operations = new AssessedSqlInstanceV2OperationsClientImpl(this); - this.assessedSqlMachinesOperations = new AssessedSqlMachinesOperationsClientImpl(this); - this.assessedSqlRecommendedEntityOperations = new AssessedSqlRecommendedEntityOperationsClientImpl(this); - this.sqlAssessmentV2SummaryOperations = new SqlAssessmentV2SummaryOperationsClientImpl(this); - this.hypervCollectorsOperations = new HypervCollectorsOperationsClientImpl(this); - this.importCollectorsOperations = new ImportCollectorsOperationsClientImpl(this); - this.machinesOperations = new MachinesOperationsClientImpl(this); this.privateEndpointConnectionOperations = new PrivateEndpointConnectionOperationsClientImpl(this); this.privateLinkResourceOperations = new PrivateLinkResourceOperationsClientImpl(this); this.assessmentProjectSummaryOperations = new AssessmentProjectSummaryOperationsClientImpl(this); + this.avsGraphAssessmentOptionsOperations = new AvsGraphAssessmentOptionsOperationsClientImpl(this); + this.avsAssessmentsV2Operations = new AvsAssessmentsV2OperationsClientImpl(this); + this.avsAssessedMachinesV2Operations = new AvsAssessedMachinesV2OperationsClientImpl(this); + this.avsAssessmentV2SummaryOperations = new AvsAssessmentV2SummaryOperationsClientImpl(this); + this.heterogeneousAssessmentOperations = new HeterogeneousAssessmentOperationsClientImpl(this); + this.heterogeneousAssessmentSummaryOperations = new HeterogeneousAssessmentSummaryOperationsClientImpl(this); + this.machineGraphAssessmentOptionsOperations = new MachineGraphAssessmentOptionsOperationsClientImpl(this); + this.machineAssessmentsV2Operations = new MachineAssessmentsV2OperationsClientImpl(this); + this.assessedMachinesV2Operations = new AssessedMachinesV2OperationsClientImpl(this); + this.machineAssessmentV2SummaryOperations = new MachineAssessmentV2SummaryOperationsClientImpl(this); + this.sqlGraphAssessmentOptionsOperations = new SqlGraphAssessmentOptionsOperationsClientImpl(this); + this.sqlAssessmentV3Operations = new SqlAssessmentV3OperationsClientImpl(this); + this.assessedSqlDatabaseV3Operations = new AssessedSqlDatabaseV3OperationsClientImpl(this); + this.assessedSqlInstanceV3Operations = new AssessedSqlInstanceV3OperationsClientImpl(this); + this.assessedSqlMachinesV3Operations = new AssessedSqlMachinesV3OperationsClientImpl(this); + this.sqlAssessmentV3SummaryOperations = new SqlAssessmentV3SummaryOperationsClientImpl(this); + this.businessCaseOperations = new BusinessCaseOperationsClientImpl(this); + this.businessCaseAvsSummaryOperations = new BusinessCaseAvsSummaryOperationsClientImpl(this); + this.evaluatedAvsMachinesOperations = new EvaluatedAvsMachinesOperationsClientImpl(this); + this.evaluatedMachinesOperations = new EvaluatedMachinesOperationsClientImpl(this); + this.evaluatedSqlEntitiesOperations = new EvaluatedSqlEntitiesOperationsClientImpl(this); + this.evaluatedWebAppsOperations = new EvaluatedWebAppsOperationsClientImpl(this); + this.businessCaseIaasSummaryOperations = new BusinessCaseIaasSummaryOperationsClientImpl(this); + this.businessCaseOverviewSummaryOperations = new BusinessCaseOverviewSummaryOperationsClientImpl(this); + this.businessCasePaasSummaryOperations = new BusinessCasePaasSummaryOperationsClientImpl(this); + this.webAppGraphAssessmentOptionsOperations = new WebAppGraphAssessmentOptionsOperationsClientImpl(this); + this.webAppAssessmentV3Operations = new WebAppAssessmentV3OperationsClientImpl(this); + this.assessedWebAppsV3Operations = new AssessedWebAppsV3OperationsClientImpl(this); + this.webAppAssessmentV3SummaryOperations = new WebAppAssessmentV3SummaryOperationsClientImpl(this); + this.webAppServicePlansOperations = new WebAppServicePlansOperationsClientImpl(this); + this.compoundAssessmentOperations = new CompoundAssessmentOperationsClientImpl(this); + this.compoundAssessmentSummaryOperations = new CompoundAssessmentSummaryOperationsClientImpl(this); + this.aksOptionsOperations = new AksOptionsOperationsClientImpl(this); + this.aksAssessmentOperations = new AksAssessmentOperationsClientImpl(this); + this.assessedWebApplicationOperations = new AssessedWebApplicationOperationsClientImpl(this); + this.aksClusterOperations = new AksClusterOperationsClientImpl(this); + this.aksCostDetailOperations = new AksCostDetailOperationsClientImpl(this); + this.aksSummaryOperations = new AksSummaryOperationsClientImpl(this); + this.hypervCollectorsOperations = new HypervCollectorsOperationsClientImpl(this); + this.importSqlCollectorOperations = new ImportSqlCollectorOperationsClientImpl(this); + this.importCollectorsOperations = new ImportCollectorsOperationsClientImpl(this); this.serverCollectorsOperations = new ServerCollectorsOperationsClientImpl(this); - this.sqlAssessmentOptionsOperations = new SqlAssessmentOptionsOperationsClientImpl(this); this.sqlCollectorOperations = new SqlCollectorOperationsClientImpl(this); this.vmwareCollectorsOperations = new VmwareCollectorsOperationsClientImpl(this); + this.webAppCollectorOperations = new WebAppCollectorOperationsClientImpl(this); } /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/OverviewSummaryImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/OverviewSummaryImpl.java new file mode 100644 index 000000000000..a64a50469b9c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/OverviewSummaryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.OverviewSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.OverviewSummary; +import com.azure.resourcemanager.migration.assessment.models.OverviewSummaryProperties; + +public final class OverviewSummaryImpl implements OverviewSummary { + private OverviewSummaryInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + OverviewSummaryImpl(OverviewSummaryInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 OverviewSummaryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OverviewSummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PaasSummaryImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PaasSummaryImpl.java new file mode 100644 index 000000000000..1ab9e3a1e163 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PaasSummaryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.PaasSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.PaasSummary; +import com.azure.resourcemanager.migration.assessment.models.PaasSummaryProperties; + +public final class PaasSummaryImpl implements PaasSummary { + private PaasSummaryInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + PaasSummaryImpl(PaasSummaryInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 PaasSummaryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PaasSummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateEndpointConnectionOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateEndpointConnectionOperationsClientImpl.java index 6a89a2404baf..f0f8f66b088a 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateEndpointConnectionOperationsClientImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateEndpointConnectionOperationsClientImpl.java @@ -75,7 +75,7 @@ public interface PrivateEndpointConnectionOperationsService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProject(@HostParam("$host") String endpoint, + Mono> listByParent(@HostParam("$host") 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); @@ -115,7 +115,7 @@ Mono> delete(@HostParam("$host") String endpoint, @QueryParam("ap @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProjectNext( + Mono> listByParentNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -132,8 +132,8 @@ Mono> listByAssessmentProjectNext( * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAssessmentProjectSinglePageAsync(String resourceGroupName, String projectName) { + 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.")); @@ -151,9 +151,8 @@ Mono> listByAssessmentProjectNext( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context)) + .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())); @@ -172,8 +171,8 @@ Mono> listByAssessmentProjectNext( * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAssessmentProjectSinglePageAsync(String resourceGroupName, String projectName, Context context) { + 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.")); @@ -192,8 +191,8 @@ Mono> listByAssessmentProjectNext( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context) + .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)); } @@ -209,10 +208,9 @@ Mono> listByAssessmentProjectNext( * @return the response of a PrivateEndpointConnection list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, - String projectName) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink)); + private PagedFlux listByParentAsync(String resourceGroupName, String projectName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); } /** @@ -227,10 +225,10 @@ private PagedFlux listByAssessmentProjectAsync(S * @return the response of a PrivateEndpointConnection list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, - String projectName, Context context) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName, context), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink, context)); + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + Context context) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); } /** @@ -245,9 +243,8 @@ private PagedFlux listByAssessmentProjectAsync(S * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, - String projectName) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName)); + public PagedIterable listByParent(String resourceGroupName, String projectName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName)); } /** @@ -263,9 +260,9 @@ public PagedIterable listByAssessmentProject(Str * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, - String projectName, Context context) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName, context)); + public PagedIterable listByParent(String resourceGroupName, String projectName, + Context context) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, context)); } /** @@ -804,8 +801,7 @@ public void delete(String resourceGroupName, String projectName, String privateE * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAssessmentProjectNextSinglePageAsync(String nextLink) { + private Mono> listByParentNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -815,8 +811,7 @@ public void delete(String resourceGroupName, String projectName, String privateE } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, context)) + .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())); @@ -834,8 +829,8 @@ public void delete(String resourceGroupName, String projectName, String privateE * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAssessmentProjectNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByParentNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -845,7 +840,7 @@ public void delete(String resourceGroupName, String projectName, String privateE } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateEndpointConnectionOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateEndpointConnectionOperationsImpl.java index d88a01e865d5..3129194a1a4f 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateEndpointConnectionOperationsImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateEndpointConnectionOperationsImpl.java @@ -27,17 +27,16 @@ public PrivateEndpointConnectionOperationsImpl(PrivateEndpointConnectionOperatio this.serviceManager = serviceManager; } - public PagedIterable listByAssessmentProject(String resourceGroupName, - String projectName) { + public PagedIterable listByParent(String resourceGroupName, String projectName) { PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName); + = this.serviceClient().listByParent(resourceGroupName, projectName); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); } - public PagedIterable listByAssessmentProject(String resourceGroupName, - String projectName, Context context) { + public PagedIterable listByParent(String resourceGroupName, String projectName, + Context context) { PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName, context); + = this.serviceClient().listByParent(resourceGroupName, projectName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateLinkResourceOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateLinkResourceOperationsClientImpl.java index d1861115619f..2f730f759506 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateLinkResourceOperationsClientImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateLinkResourceOperationsClientImpl.java @@ -66,7 +66,7 @@ public interface PrivateLinkResourceOperationsService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateLinkResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProject(@HostParam("$host") String endpoint, + Mono> listByParent(@HostParam("$host") 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); @@ -85,7 +85,7 @@ Mono> get(@HostParam("$host") String endpoint @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProjectNext( + Mono> listByParentNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -102,8 +102,8 @@ Mono> listByAssessmentProjectNext( * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAssessmentProjectSinglePageAsync(String resourceGroupName, String projectName) { + 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.")); @@ -121,9 +121,8 @@ Mono> listByAssessmentProjectNext( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context)) + .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())); @@ -142,8 +141,8 @@ Mono> listByAssessmentProjectNext( * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAssessmentProjectSinglePageAsync(String resourceGroupName, String projectName, Context context) { + 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.")); @@ -162,8 +161,8 @@ Mono> listByAssessmentProjectNext( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context) + .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)); } @@ -179,10 +178,9 @@ Mono> listByAssessmentProjectNext( * @return the response of a PrivateLinkResource list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, - String projectName) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink)); + private PagedFlux listByParentAsync(String resourceGroupName, String projectName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); } /** @@ -197,10 +195,10 @@ private PagedFlux listByAssessmentProjectAsync(String * @return the response of a PrivateLinkResource list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, - String projectName, Context context) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName, context), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink, context)); + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + Context context) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); } /** @@ -214,9 +212,8 @@ private PagedFlux listByAssessmentProjectAsync(String * @return the response of a PrivateLinkResource list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, - String projectName) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName)); + public PagedIterable listByParent(String resourceGroupName, String projectName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName)); } /** @@ -231,9 +228,9 @@ public PagedIterable listByAssessmentProject(String re * @return the response of a PrivateLinkResource list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, + public PagedIterable listByParent(String resourceGroupName, String projectName, Context context) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName, context)); + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, context)); } /** @@ -378,7 +375,7 @@ public PrivateLinkResourceInner get(String resourceGroupName, String projectName * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(String nextLink) { + private Mono> listByParentNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -388,8 +385,7 @@ private Mono> listByAssessmentProjectNex } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, context)) + .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())); @@ -407,7 +403,7 @@ private Mono> listByAssessmentProjectNex * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(String nextLink, + private Mono> listByParentNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -418,7 +414,7 @@ private Mono> listByAssessmentProjectNex } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateLinkResourceOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateLinkResourceOperationsImpl.java index 60f6f4ba500f..0a0c36017198 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateLinkResourceOperationsImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/PrivateLinkResourceOperationsImpl.java @@ -27,16 +27,16 @@ public PrivateLinkResourceOperationsImpl(PrivateLinkResourceOperationsClient inn this.serviceManager = serviceManager; } - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { + public PagedIterable listByParent(String resourceGroupName, String projectName) { PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName); + = this.serviceClient().listByParent(resourceGroupName, projectName); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, + public PagedIterable listByParent(String resourceGroupName, String projectName, Context context) { PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName, context); + = this.serviceClient().listByParent(resourceGroupName, projectName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ReportDownloadUrlImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ReportDownloadUrlImpl.java new file mode 100644 index 000000000000..0b59070b5b1a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ReportDownloadUrlImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.resourcemanager.migration.assessment.fluent.models.ReportDownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.models.ReportDownloadUrl; +import java.time.OffsetDateTime; + +public final class ReportDownloadUrlImpl implements ReportDownloadUrl { + private ReportDownloadUrlInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + ReportDownloadUrlImpl(ReportDownloadUrlInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String businessCaseReportUrl() { + return this.innerModel().businessCaseReportUrl(); + } + + public OffsetDateTime expirationTime() { + return this.innerModel().expirationTime(); + } + + public ReportDownloadUrlInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ServerCollectorsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ServerCollectorsOperationsClientImpl.java index 124d30ad2fa9..99930b57089f 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ServerCollectorsOperationsClientImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ServerCollectorsOperationsClientImpl.java @@ -74,7 +74,7 @@ public interface ServerCollectorsOperationsService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProject(@HostParam("$host") String endpoint, + Mono> listByParent(@HostParam("$host") 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); @@ -114,7 +114,7 @@ Mono> delete(@HostParam("$host") String endpoint, @QueryParam("ap @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProjectNext( + Mono> listByParentNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -131,7 +131,7 @@ Mono> listByAssessmentProjectNext( * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(String resourceGroupName, + private Mono> listByParentSinglePageAsync(String resourceGroupName, String projectName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -150,9 +150,8 @@ private Mono> listByAssessmentProjectSingleP } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context)) + .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())); @@ -171,7 +170,7 @@ private Mono> listByAssessmentProjectSingleP * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(String resourceGroupName, + private Mono> listByParentSinglePageAsync(String resourceGroupName, String projectName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -191,8 +190,8 @@ private Mono> listByAssessmentProjectSingleP final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context) + .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)); } @@ -208,9 +207,9 @@ private Mono> listByAssessmentProjectSingleP * @return the response of a ServerCollector list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink)); + private PagedFlux listByParentAsync(String resourceGroupName, String projectName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); } /** @@ -225,10 +224,10 @@ private PagedFlux listByAssessmentProjectAsync(String reso * @return the response of a ServerCollector list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName, + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, Context context) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName, context), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); } /** @@ -242,8 +241,8 @@ private PagedFlux listByAssessmentProjectAsync(String reso * @return the response of a ServerCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName)); + public PagedIterable listByParent(String resourceGroupName, String projectName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName)); } /** @@ -258,9 +257,9 @@ public PagedIterable listByAssessmentProject(String resour * @return the response of a ServerCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, + public PagedIterable listByParent(String resourceGroupName, String projectName, Context context) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName, context)); + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, context)); } /** @@ -788,7 +787,7 @@ public void delete(String resourceGroupName, String projectName, String serverCo * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(String nextLink) { + private Mono> listByParentNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -798,8 +797,7 @@ private Mono> listByAssessmentProjectNextSin } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, context)) + .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())); @@ -817,7 +815,7 @@ private Mono> listByAssessmentProjectNextSin * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(String nextLink, + private Mono> listByParentNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -828,7 +826,7 @@ private Mono> listByAssessmentProjectNextSin } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ServerCollectorsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ServerCollectorsOperationsImpl.java index 33410176828a..0108f8d428f8 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ServerCollectorsOperationsImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/ServerCollectorsOperationsImpl.java @@ -27,16 +27,14 @@ public ServerCollectorsOperationsImpl(ServerCollectorsOperationsClient innerClie this.serviceManager = serviceManager; } - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName); + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner = this.serviceClient().listByParent(resourceGroupName, projectName); return ResourceManagerUtils.mapPage(inner, inner1 -> new ServerCollectorImpl(inner1, this.manager())); } - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context) { + public PagedIterable listByParent(String resourceGroupName, String projectName, Context context) { PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName, context); + = this.serviceClient().listByParent(resourceGroupName, projectName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new ServerCollectorImpl(inner1, this.manager())); } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentOptionsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentOptionsImpl.java deleted file mode 100644 index 36897088f726..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentOptionsImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentOptionsInner; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentOptions; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentOptionsProperties; - -public final class SqlAssessmentOptionsImpl implements SqlAssessmentOptions { - private SqlAssessmentOptionsInner innerObject; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - SqlAssessmentOptionsImpl(SqlAssessmentOptionsInner innerObject, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 SqlAssessmentOptionsProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public SqlAssessmentOptionsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentOptionsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentOptionsOperationsClientImpl.java deleted file mode 100644 index dad284cf7564..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentOptionsOperationsClientImpl.java +++ /dev/null @@ -1,425 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.SqlAssessmentOptionsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentOptionsInner; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentOptionsListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SqlAssessmentOptionsOperationsClient. - */ -public final class SqlAssessmentOptionsOperationsClientImpl implements SqlAssessmentOptionsOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SqlAssessmentOptionsOperationsService service; - - /** - * The service client containing this operation class. - */ - private final MigrationAssessmentManagementClientImpl client; - - /** - * Initializes an instance of SqlAssessmentOptionsOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SqlAssessmentOptionsOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { - this.service = RestProxy.create(SqlAssessmentOptionsOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MigrationAssessmentManagementClientSqlAssessmentOptionsOperations to - * be used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MigrationAssessmentM") - public interface SqlAssessmentOptionsOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessmentOptions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProject(@HostParam("$host") 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}/sqlAssessmentOptions/{assessmentOptionsName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("assessmentOptionsName") String assessmentOptionsName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProjectNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List SqlAssessmentOptions 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 SqlAssessmentOptions list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAssessmentProjectSinglePageAsync(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.listByAssessmentProject(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 SqlAssessmentOptions 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 SqlAssessmentOptions list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAssessmentProjectSinglePageAsync(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 - .listByAssessmentProject(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 SqlAssessmentOptions 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 SqlAssessmentOptions list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, - String projectName) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink)); - } - - /** - * List SqlAssessmentOptions 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 SqlAssessmentOptions list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, - String projectName, Context context) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName, context), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink, context)); - } - - /** - * List SqlAssessmentOptions 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 SqlAssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, - String projectName) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName)); - } - - /** - * List SqlAssessmentOptions 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 SqlAssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, - String projectName, Context context) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName, context)); - } - - /** - * Get a SqlAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName Sql assessment options ARM name. Accepted values is 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SqlAssessmentOptions along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String assessmentOptionsName) { - 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 (assessmentOptionsName == null) { - return Mono - .error(new IllegalArgumentException("Parameter assessmentOptionsName 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, assessmentOptionsName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a SqlAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName Sql assessment options ARM name. Accepted values is 'default'. - * @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 SqlAssessmentOptions along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String assessmentOptionsName, 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 (assessmentOptionsName == null) { - return Mono - .error(new IllegalArgumentException("Parameter assessmentOptionsName 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, assessmentOptionsName, accept, context); - } - - /** - * Get a SqlAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName Sql assessment options ARM name. Accepted values is 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SqlAssessmentOptions on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String projectName, - String assessmentOptionsName) { - return getWithResponseAsync(resourceGroupName, projectName, assessmentOptionsName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a SqlAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName Sql assessment options ARM name. Accepted values is 'default'. - * @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 SqlAssessmentOptions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String projectName, - String assessmentOptionsName, Context context) { - return getWithResponseAsync(resourceGroupName, projectName, assessmentOptionsName, context).block(); - } - - /** - * Get a SqlAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName Sql assessment options ARM name. Accepted values is 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SqlAssessmentOptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SqlAssessmentOptionsInner get(String resourceGroupName, String projectName, String assessmentOptionsName) { - return getWithResponse(resourceGroupName, projectName, assessmentOptionsName, Context.NONE).getValue(); - } - - /** - * 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 SqlAssessmentOptions list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(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.listByAssessmentProjectNext(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 SqlAssessmentOptions list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(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.listByAssessmentProjectNext(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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentOptionsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentOptionsOperationsImpl.java deleted file mode 100644 index 00c0dd2a829e..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentOptionsOperationsImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.SqlAssessmentOptionsOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentOptionsInner; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentOptions; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentOptionsOperations; - -public final class SqlAssessmentOptionsOperationsImpl implements SqlAssessmentOptionsOperations { - private static final ClientLogger LOGGER = new ClientLogger(SqlAssessmentOptionsOperationsImpl.class); - - private final SqlAssessmentOptionsOperationsClient innerClient; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - public SqlAssessmentOptionsOperationsImpl(SqlAssessmentOptionsOperationsClient innerClient, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SqlAssessmentOptionsImpl(inner1, this.manager())); - } - - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context) { - PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SqlAssessmentOptionsImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String projectName, - String assessmentOptionsName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, projectName, assessmentOptionsName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SqlAssessmentOptionsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SqlAssessmentOptions get(String resourceGroupName, String projectName, String assessmentOptionsName) { - SqlAssessmentOptionsInner inner - = this.serviceClient().get(resourceGroupName, projectName, assessmentOptionsName); - if (inner != null) { - return new SqlAssessmentOptionsImpl(inner, this.manager()); - } else { - return null; - } - } - - private SqlAssessmentOptionsOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2Impl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2Impl.java deleted file mode 100644 index fb43e197c6d2..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2Impl.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV2Inner; -import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2Properties; - -public final class SqlAssessmentV2Impl implements SqlAssessmentV2, SqlAssessmentV2.Definition { - private SqlAssessmentV2Inner innerObject; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - SqlAssessmentV2Impl(SqlAssessmentV2Inner innerObject, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 SqlAssessmentV2Properties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public SqlAssessmentV2Inner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String projectName; - - private String groupName; - - private String assessmentName; - - public SqlAssessmentV2Impl withExistingGroup(String resourceGroupName, String projectName, String groupName) { - this.resourceGroupName = resourceGroupName; - this.projectName = projectName; - this.groupName = groupName; - return this; - } - - public SqlAssessmentV2 create() { - this.innerObject = serviceManager.serviceClient() - .getSqlAssessmentV2Operations() - .create(resourceGroupName, projectName, groupName, assessmentName, this.innerModel(), Context.NONE); - return this; - } - - public SqlAssessmentV2 create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSqlAssessmentV2Operations() - .create(resourceGroupName, projectName, groupName, assessmentName, this.innerModel(), context); - return this; - } - - SqlAssessmentV2Impl(String name, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerObject = new SqlAssessmentV2Inner(); - this.serviceManager = serviceManager; - this.assessmentName = name; - } - - public SqlAssessmentV2 refresh() { - this.innerObject = serviceManager.serviceClient() - .getSqlAssessmentV2Operations() - .getWithResponse(resourceGroupName, projectName, groupName, assessmentName, Context.NONE) - .getValue(); - return this; - } - - public SqlAssessmentV2 refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSqlAssessmentV2Operations() - .getWithResponse(resourceGroupName, projectName, groupName, assessmentName, context) - .getValue(); - return this; - } - - public DownloadUrl downloadUrl(Object body) { - return serviceManager.sqlAssessmentV2Operations() - .downloadUrl(resourceGroupName, projectName, groupName, assessmentName, body); - } - - public DownloadUrl downloadUrl(Object body, Context context) { - return serviceManager.sqlAssessmentV2Operations() - .downloadUrl(resourceGroupName, projectName, groupName, assessmentName, body, context); - } - - public SqlAssessmentV2Impl withProperties(SqlAssessmentV2Properties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2OperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2OperationsClientImpl.java deleted file mode 100644 index ffb46ab80a25..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2OperationsClientImpl.java +++ /dev/null @@ -1,1181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.SqlAssessmentV2OperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV2Inner; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2ListResult; -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 SqlAssessmentV2OperationsClient. - */ -public final class SqlAssessmentV2OperationsClientImpl implements SqlAssessmentV2OperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SqlAssessmentV2OperationsService service; - - /** - * The service client containing this operation class. - */ - private final MigrationAssessmentManagementClientImpl client; - - /** - * Initializes an instance of SqlAssessmentV2OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SqlAssessmentV2OperationsClientImpl(MigrationAssessmentManagementClientImpl client) { - this.service = RestProxy.create(SqlAssessmentV2OperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MigrationAssessmentManagementClientSqlAssessmentV2Operations to be - * used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MigrationAssessmentM") - public interface SqlAssessmentV2OperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByGroup(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @BodyParam("application/json") SqlAssessmentV2Inner resource, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/downloadUrl") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> downloadUrl(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @BodyParam("application/json") Object body, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List SqlAssessmentV2 resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 SqlAssessmentV2 list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGroupSinglePageAsync(String resourceGroupName, - String projectName, String groupName) { - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, 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 SqlAssessmentV2 resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 SqlAssessmentV2 list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGroupSinglePageAsync(String resourceGroupName, - String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, projectName, groupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List SqlAssessmentV2 resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 SqlAssessmentV2 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByGroupAsync(String resourceGroupName, String projectName, - String groupName) { - return new PagedFlux<>(() -> listByGroupSinglePageAsync(resourceGroupName, projectName, groupName), - nextLink -> listByGroupNextSinglePageAsync(nextLink)); - } - - /** - * List SqlAssessmentV2 resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 SqlAssessmentV2 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByGroupAsync(String resourceGroupName, String projectName, - String groupName, Context context) { - return new PagedFlux<>(() -> listByGroupSinglePageAsync(resourceGroupName, projectName, groupName, context), - nextLink -> listByGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List SqlAssessmentV2 resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 SqlAssessmentV2 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByGroup(String resourceGroupName, String projectName, - String groupName) { - return new PagedIterable<>(listByGroupAsync(resourceGroupName, projectName, groupName)); - } - - /** - * List SqlAssessmentV2 resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 SqlAssessmentV2 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByGroup(String resourceGroupName, String projectName, - String groupName, Context context) { - return new PagedIterable<>(listByGroupAsync(resourceGroupName, projectName, groupName, context)); - } - - /** - * Get a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2 along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2 along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String projectName, - String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, accept, context); - } - - /** - * Get a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String projectName, String groupName, - String assessmentName) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String projectName, - String groupName, String assessmentName, Context context) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, context).block(); - } - - /** - * Get a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SqlAssessmentV2Inner get(String resourceGroupName, String projectName, String groupName, - String assessmentName) { - return getWithResponse(resourceGroupName, projectName, groupName, assessmentName, Context.NONE).getValue(); - } - - /** - * Create a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 sQL Assessment REST resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName, SqlAssessmentV2Inner 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, assessmentName, resource, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 sQL Assessment REST resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, - String groupName, String assessmentName, SqlAssessmentV2Inner 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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 accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, projectName, groupName, assessmentName, resource, accept, context); - } - - /** - * Create a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SqlAssessmentV2Inner> beginCreateAsync( - String resourceGroupName, String projectName, String groupName, String assessmentName, - SqlAssessmentV2Inner resource) { - Mono>> mono - = createWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - SqlAssessmentV2Inner.class, SqlAssessmentV2Inner.class, this.client.getContext()); - } - - /** - * Create a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SqlAssessmentV2Inner> beginCreateAsync( - String resourceGroupName, String projectName, String groupName, String assessmentName, - SqlAssessmentV2Inner resource, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, resource, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - SqlAssessmentV2Inner.class, SqlAssessmentV2Inner.class, context); - } - - /** - * Create a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SqlAssessmentV2Inner> beginCreate(String resourceGroupName, - String projectName, String groupName, String assessmentName, SqlAssessmentV2Inner resource) { - return this.beginCreateAsync(resourceGroupName, projectName, groupName, assessmentName, resource) - .getSyncPoller(); - } - - /** - * Create a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SqlAssessmentV2Inner> beginCreate(String resourceGroupName, - String projectName, String groupName, String assessmentName, SqlAssessmentV2Inner resource, Context context) { - return this.beginCreateAsync(resourceGroupName, projectName, groupName, assessmentName, resource, context) - .getSyncPoller(); - } - - /** - * Create a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 sQL Assessment REST resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String projectName, String groupName, - String assessmentName, SqlAssessmentV2Inner resource) { - return beginCreateAsync(resourceGroupName, projectName, groupName, assessmentName, resource).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 sQL Assessment REST resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String projectName, String groupName, - String assessmentName, SqlAssessmentV2Inner resource, Context context) { - return beginCreateAsync(resourceGroupName, projectName, groupName, assessmentName, resource, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SqlAssessmentV2Inner create(String resourceGroupName, String projectName, String groupName, - String assessmentName, SqlAssessmentV2Inner resource) { - return createAsync(resourceGroupName, projectName, groupName, assessmentName, resource).block(); - } - - /** - * Create a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SqlAssessmentV2Inner create(String resourceGroupName, String projectName, String groupName, - String assessmentName, SqlAssessmentV2Inner resource, Context context) { - return createAsync(resourceGroupName, projectName, groupName, assessmentName, resource, context).block(); - } - - /** - * Delete a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 groupName, - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 groupName, - 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, accept, context); - } - - /** - * Delete a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 groupName, - String assessmentName) { - return deleteWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 groupName, - String assessmentName, Context context) { - return deleteWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, context).block(); - } - - /** - * Delete a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 groupName, String assessmentName) { - deleteWithResponse(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 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 groupName, String assessmentName, Object 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.downloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, assessmentName, body, - accept, 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 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 groupName, String assessmentName, Object 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.downloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, assessmentName, body, accept, - 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 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 groupName, String assessmentName, Object body) { - Mono>> mono - = downloadUrlWithResponseAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 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 groupName, String assessmentName, Object body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = downloadUrlWithResponseAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 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 groupName, String assessmentName, Object body) { - return this.beginDownloadUrlAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 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 groupName, String assessmentName, Object body, Context context) { - return this.beginDownloadUrlAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 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 groupName, - String assessmentName, Object body) { - return beginDownloadUrlAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 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 groupName, - String assessmentName, Object body, Context context) { - return beginDownloadUrlAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String groupName, - String assessmentName, Object body) { - return downloadUrlAsync(resourceGroupName, projectName, groupName, 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 URL for downloading the assessment in a report format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String groupName, - String assessmentName, Object body, Context context) { - return downloadUrlAsync(resourceGroupName, projectName, groupName, 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 SqlAssessmentV2 list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGroupNextSinglePageAsync(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.listByGroupNext(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 SqlAssessmentV2 list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByGroupNextSinglePageAsync(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.listByGroupNext(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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2OperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2OperationsImpl.java deleted file mode 100644 index c86a37981839..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2OperationsImpl.java +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.SqlAssessmentV2OperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV2Inner; -import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2Operations; - -public final class SqlAssessmentV2OperationsImpl implements SqlAssessmentV2Operations { - private static final ClientLogger LOGGER = new ClientLogger(SqlAssessmentV2OperationsImpl.class); - - private final SqlAssessmentV2OperationsClient innerClient; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - public SqlAssessmentV2OperationsImpl(SqlAssessmentV2OperationsClient innerClient, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName) { - PagedIterable inner - = this.serviceClient().listByGroup(resourceGroupName, projectName, groupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SqlAssessmentV2Impl(inner1, this.manager())); - } - - public PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName, - Context context) { - PagedIterable inner - = this.serviceClient().listByGroup(resourceGroupName, projectName, groupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SqlAssessmentV2Impl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, projectName, groupName, assessmentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SqlAssessmentV2Impl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SqlAssessmentV2 get(String resourceGroupName, String projectName, String groupName, String assessmentName) { - SqlAssessmentV2Inner inner - = this.serviceClient().get(resourceGroupName, projectName, groupName, assessmentName); - if (inner != null) { - return new SqlAssessmentV2Impl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, Context context) { - return this.serviceClient() - .deleteWithResponse(resourceGroupName, projectName, groupName, assessmentName, context); - } - - public void delete(String resourceGroupName, String projectName, String groupName, String assessmentName) { - this.serviceClient().delete(resourceGroupName, projectName, groupName, assessmentName); - } - - public DownloadUrl downloadUrl(String resourceGroupName, String projectName, String groupName, - String assessmentName, Object body) { - DownloadUrlInner inner - = this.serviceClient().downloadUrl(resourceGroupName, projectName, groupName, assessmentName, body); - if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); - } else { - return null; - } - } - - public DownloadUrl downloadUrl(String resourceGroupName, String projectName, String groupName, - String assessmentName, Object body, Context context) { - DownloadUrlInner inner = this.serviceClient() - .downloadUrl(resourceGroupName, projectName, groupName, assessmentName, body, context); - if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); - } else { - return null; - } - } - - public SqlAssessmentV2 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByName(id, "sqlAssessments"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'sqlAssessments'.", id))); - } - return this.getWithResponse(resourceGroupName, projectName, groupName, 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByName(id, "sqlAssessments"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'sqlAssessments'.", id))); - } - return this.getWithResponse(resourceGroupName, projectName, groupName, 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByName(id, "sqlAssessments"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'sqlAssessments'.", id))); - } - this.deleteWithResponse(resourceGroupName, projectName, groupName, 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 groupName = ResourceManagerUtils.getValueFromIdByName(id, "groups"); - if (groupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByName(id, "sqlAssessments"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'sqlAssessments'.", id))); - } - return this.deleteWithResponse(resourceGroupName, projectName, groupName, assessmentName, context); - } - - private SqlAssessmentV2OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } - - public SqlAssessmentV2Impl define(String name) { - return new SqlAssessmentV2Impl(name, this.manager()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2SummaryImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2SummaryImpl.java deleted file mode 100644 index 4328b3fd8a7f..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2SummaryImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV2SummaryInner; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2Summary; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2SummaryProperties; - -public final class SqlAssessmentV2SummaryImpl implements SqlAssessmentV2Summary { - private SqlAssessmentV2SummaryInner innerObject; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - SqlAssessmentV2SummaryImpl(SqlAssessmentV2SummaryInner innerObject, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 SqlAssessmentV2SummaryProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public SqlAssessmentV2SummaryInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2SummaryOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2SummaryOperationsClientImpl.java deleted file mode 100644 index 119b638a0fb3..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2SummaryOperationsClientImpl.java +++ /dev/null @@ -1,477 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.SqlAssessmentV2SummaryOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV2SummaryInner; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2SummaryListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SqlAssessmentV2SummaryOperationsClient. - */ -public final class SqlAssessmentV2SummaryOperationsClientImpl implements SqlAssessmentV2SummaryOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SqlAssessmentV2SummaryOperationsService service; - - /** - * The service client containing this operation class. - */ - private final MigrationAssessmentManagementClientImpl client; - - /** - * Initializes an instance of SqlAssessmentV2SummaryOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SqlAssessmentV2SummaryOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { - this.service = RestProxy.create(SqlAssessmentV2SummaryOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MigrationAssessmentManagementClientSqlAssessmentV2SummaryOperations - * to be used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MigrationAssessmentM") - public interface SqlAssessmentV2SummaryOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/summaries") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySqlAssessmentV2(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @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}/groups/{groupName}/sqlAssessments/{assessmentName}/summaries/{summaryName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, - @PathParam("groupName") String groupName, @PathParam("assessmentName") String assessmentName, - @PathParam("summaryName") String summaryName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySqlAssessmentV2Next( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List SqlAssessmentV2Summary resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2Summary list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2SinglePageAsync( - String resourceGroupName, String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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.listBySqlAssessmentV2(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, - 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 SqlAssessmentV2Summary resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2Summary list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2SinglePageAsync( - String resourceGroupName, String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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.listBySqlAssessmentV2(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, groupName, assessmentName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List SqlAssessmentV2Summary resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2Summary list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySqlAssessmentV2Async(String resourceGroupName, - String projectName, String groupName, String assessmentName) { - return new PagedFlux<>( - () -> listBySqlAssessmentV2SinglePageAsync(resourceGroupName, projectName, groupName, assessmentName), - nextLink -> listBySqlAssessmentV2NextSinglePageAsync(nextLink)); - } - - /** - * List SqlAssessmentV2Summary resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2Summary list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySqlAssessmentV2Async(String resourceGroupName, - String projectName, String groupName, String assessmentName, Context context) { - return new PagedFlux<>(() -> listBySqlAssessmentV2SinglePageAsync(resourceGroupName, projectName, groupName, - assessmentName, context), nextLink -> listBySqlAssessmentV2NextSinglePageAsync(nextLink, context)); - } - - /** - * List SqlAssessmentV2Summary resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2Summary list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, - String projectName, String groupName, String assessmentName) { - return new PagedIterable<>( - listBySqlAssessmentV2Async(resourceGroupName, projectName, groupName, assessmentName)); - } - - /** - * List SqlAssessmentV2Summary resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2Summary list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, - String projectName, String groupName, String assessmentName, Context context) { - return new PagedIterable<>( - listBySqlAssessmentV2Async(resourceGroupName, projectName, groupName, assessmentName, context)); - } - - /** - * Get a SqlAssessmentV2Summary. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV2Summary along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, summaryName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a SqlAssessmentV2Summary. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV2Summary along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String projectName, String groupName, 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 (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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, groupName, assessmentName, summaryName, accept, context); - } - - /** - * Get a SqlAssessmentV2Summary. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV2Summary on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String projectName, String groupName, - String assessmentName, String summaryName) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, summaryName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a SqlAssessmentV2Summary. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV2Summary along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String projectName, - String groupName, String assessmentName, String summaryName, Context context) { - return getWithResponseAsync(resourceGroupName, projectName, groupName, assessmentName, summaryName, context) - .block(); - } - - /** - * Get a SqlAssessmentV2Summary. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV2Summary. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SqlAssessmentV2SummaryInner get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String summaryName) { - return getWithResponse(resourceGroupName, projectName, groupName, assessmentName, summaryName, Context.NONE) - .getValue(); - } - - /** - * 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 SqlAssessmentV2Summary list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2NextSinglePageAsync(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.listBySqlAssessmentV2Next(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 SqlAssessmentV2Summary list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySqlAssessmentV2NextSinglePageAsync(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.listBySqlAssessmentV2Next(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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2SummaryOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2SummaryOperationsImpl.java deleted file mode 100644 index 0289781a1f00..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV2SummaryOperationsImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.SqlAssessmentV2SummaryOperationsClient; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV2SummaryInner; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2Summary; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2SummaryOperations; - -public final class SqlAssessmentV2SummaryOperationsImpl implements SqlAssessmentV2SummaryOperations { - private static final ClientLogger LOGGER = new ClientLogger(SqlAssessmentV2SummaryOperationsImpl.class); - - private final SqlAssessmentV2SummaryOperationsClient innerClient; - - private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; - - public SqlAssessmentV2SummaryOperationsImpl(SqlAssessmentV2SummaryOperationsClient innerClient, - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName) { - PagedIterable inner - = this.serviceClient().listBySqlAssessmentV2(resourceGroupName, projectName, groupName, assessmentName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SqlAssessmentV2SummaryImpl(inner1, this.manager())); - } - - public PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, Context context) { - PagedIterable inner = this.serviceClient() - .listBySqlAssessmentV2(resourceGroupName, projectName, groupName, assessmentName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SqlAssessmentV2SummaryImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String projectName, - String groupName, String assessmentName, String summaryName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, projectName, groupName, assessmentName, summaryName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SqlAssessmentV2SummaryImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SqlAssessmentV2Summary get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String summaryName) { - SqlAssessmentV2SummaryInner inner - = this.serviceClient().get(resourceGroupName, projectName, groupName, assessmentName, summaryName); - if (inner != null) { - return new SqlAssessmentV2SummaryImpl(inner, this.manager()); - } else { - return null; - } - } - - private SqlAssessmentV2SummaryOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3Impl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3Impl.java new file mode 100644 index 000000000000..da0e886cd532 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3Impl.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV3Inner; +import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; +import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV3; +import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV3Properties; + +public final class SqlAssessmentV3Impl implements SqlAssessmentV3, SqlAssessmentV3.Definition { + private SqlAssessmentV3Inner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + SqlAssessmentV3Impl(SqlAssessmentV3Inner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 SqlAssessmentV3Properties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SqlAssessmentV3Inner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String projectName; + + private String assessmentName; + + public SqlAssessmentV3Impl withExistingAssessmentProject(String resourceGroupName, String projectName) { + this.resourceGroupName = resourceGroupName; + this.projectName = projectName; + return this; + } + + public SqlAssessmentV3 create() { + this.innerObject = serviceManager.serviceClient() + .getSqlAssessmentV3Operations() + .create(resourceGroupName, projectName, assessmentName, this.innerModel(), Context.NONE); + return this; + } + + public SqlAssessmentV3 create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSqlAssessmentV3Operations() + .create(resourceGroupName, projectName, assessmentName, this.innerModel(), context); + return this; + } + + SqlAssessmentV3Impl(String name, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerObject = new SqlAssessmentV3Inner(); + this.serviceManager = serviceManager; + this.assessmentName = name; + } + + public SqlAssessmentV3 refresh() { + this.innerObject = serviceManager.serviceClient() + .getSqlAssessmentV3Operations() + .getWithResponse(resourceGroupName, projectName, assessmentName, Context.NONE) + .getValue(); + return this; + } + + public SqlAssessmentV3 refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSqlAssessmentV3Operations() + .getWithResponse(resourceGroupName, projectName, assessmentName, context) + .getValue(); + return this; + } + + public DownloadUrl downloadUrl(Object body) { + return serviceManager.sqlAssessmentV3Operations() + .downloadUrl(resourceGroupName, projectName, assessmentName, body); + } + + public DownloadUrl downloadUrl(Object body, Context context) { + return serviceManager.sqlAssessmentV3Operations() + .downloadUrl(resourceGroupName, projectName, assessmentName, body, context); + } + + public SqlAssessmentV3Impl withProperties(SqlAssessmentV3Properties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3OperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3OperationsClientImpl.java new file mode 100644 index 000000000000..a8068428e9ed --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3OperationsClientImpl.java @@ -0,0 +1,1098 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.SqlAssessmentV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV3Inner; +import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV3ListResult; +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 SqlAssessmentV3OperationsClient. + */ +public final class SqlAssessmentV3OperationsClientImpl implements SqlAssessmentV3OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SqlAssessmentV3OperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of SqlAssessmentV3OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlAssessmentV3OperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(SqlAssessmentV3OperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientSqlAssessmentV3Operations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface SqlAssessmentV3OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/sqlAssessments/{assessmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessments/{assessmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, + @BodyParam("application/json") SqlAssessmentV3Inner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessments/{assessmentName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessments/{assessmentName}/downloadUrl") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> downloadUrl(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, @BodyParam("application/json") Object body, + @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List SqlAssessmentV3 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 SqlAssessmentV3 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 SqlAssessmentV3 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 SqlAssessmentV3 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 SqlAssessmentV3 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 SqlAssessmentV3 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 SqlAssessmentV3 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 SqlAssessmentV3 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 SqlAssessmentV3 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 SqlAssessmentV3 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 SqlAssessmentV3 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 SqlAssessmentV3 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 a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3 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 SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3 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 SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3 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 SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3 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 SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlAssessmentV3Inner get(String resourceGroupName, String projectName, String assessmentName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, Context.NONE).getValue(); + } + + /** + * Create a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 sQL Assessment REST resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, SqlAssessmentV3Inner 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 accept = "application/json"; + return FluxUtil.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 sQL Assessment REST resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, SqlAssessmentV3Inner 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, assessmentName, resource, accept, context); + } + + /** + * Create a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqlAssessmentV3Inner> beginCreateAsync( + String resourceGroupName, String projectName, String assessmentName, SqlAssessmentV3Inner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, assessmentName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SqlAssessmentV3Inner.class, SqlAssessmentV3Inner.class, this.client.getContext()); + } + + /** + * Create a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqlAssessmentV3Inner> beginCreateAsync( + String resourceGroupName, String projectName, String assessmentName, SqlAssessmentV3Inner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, assessmentName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SqlAssessmentV3Inner.class, SqlAssessmentV3Inner.class, context); + } + + /** + * Create a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqlAssessmentV3Inner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, SqlAssessmentV3Inner resource) { + return this.beginCreateAsync(resourceGroupName, projectName, assessmentName, resource).getSyncPoller(); + } + + /** + * Create a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqlAssessmentV3Inner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, SqlAssessmentV3Inner resource, Context context) { + return this.beginCreateAsync(resourceGroupName, projectName, assessmentName, resource, context).getSyncPoller(); + } + + /** + * Create a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 sQL Assessment REST resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, String assessmentName, + SqlAssessmentV3Inner resource) { + return beginCreateAsync(resourceGroupName, projectName, assessmentName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 sQL Assessment REST resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, String assessmentName, + SqlAssessmentV3Inner resource, Context context) { + return beginCreateAsync(resourceGroupName, projectName, assessmentName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlAssessmentV3Inner create(String resourceGroupName, String projectName, String assessmentName, + SqlAssessmentV3Inner resource) { + return createAsync(resourceGroupName, projectName, assessmentName, resource).block(); + } + + /** + * Create a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 sQL Assessment REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlAssessmentV3Inner create(String resourceGroupName, String projectName, String assessmentName, + SqlAssessmentV3Inner resource, Context context) { + return createAsync(resourceGroupName, projectName, assessmentName, resource, context).block(); + } + + /** + * Delete a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SQL Assessment 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 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, Object 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.downloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, body, accept, 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 SQL Assessment 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 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, Object 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.")); + } + 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, body, accept, 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 SQL Assessment 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 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, Object 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 SQL Assessment 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 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, Object 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 SQL Assessment 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 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, Object 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 SQL Assessment 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 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, Object 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 SQL Assessment 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 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, + Object 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 SQL Assessment 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 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, + Object 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 SQL Assessment 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 URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, + Object 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 SQL Assessment 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 URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, + Object 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 SqlAssessmentV3 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 SqlAssessmentV3 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3OperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3OperationsImpl.java new file mode 100644 index 000000000000..384d40da5f48 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3OperationsImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.SqlAssessmentV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV3Inner; +import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; +import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV3; +import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV3Operations; + +public final class SqlAssessmentV3OperationsImpl implements SqlAssessmentV3Operations { + private static final ClientLogger LOGGER = new ClientLogger(SqlAssessmentV3OperationsImpl.class); + + private final SqlAssessmentV3OperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public SqlAssessmentV3OperationsImpl(SqlAssessmentV3OperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner = this.serviceClient().listByParent(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SqlAssessmentV3Impl(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 SqlAssessmentV3Impl(inner1, this.manager())); + } + + 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 SqlAssessmentV3Impl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SqlAssessmentV3 get(String resourceGroupName, String projectName, String assessmentName) { + SqlAssessmentV3Inner inner = this.serviceClient().get(resourceGroupName, projectName, assessmentName); + if (inner != null) { + return new SqlAssessmentV3Impl(inner, this.manager()); + } else { + return null; + } + } + + 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, Object 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, Object 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 SqlAssessmentV3 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, "sqlAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlAssessments'.", 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, "sqlAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlAssessments'.", 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, "sqlAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlAssessments'.", 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, "sqlAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlAssessments'.", id))); + } + return this.deleteWithResponse(resourceGroupName, projectName, assessmentName, context); + } + + private SqlAssessmentV3OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + public SqlAssessmentV3Impl define(String name) { + return new SqlAssessmentV3Impl(name, this.manager()); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3SummaryImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3SummaryImpl.java new file mode 100644 index 000000000000..4c8cacfb075b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3SummaryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV3SummaryInner; +import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV3Summary; +import com.azure.resourcemanager.migration.assessment.models.SummaryProperties; + +public final class SqlAssessmentV3SummaryImpl implements SqlAssessmentV3Summary { + private SqlAssessmentV3SummaryInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + SqlAssessmentV3SummaryImpl(SqlAssessmentV3SummaryInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 SqlAssessmentV3SummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3SummaryOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3SummaryOperationsClientImpl.java new file mode 100644 index 000000000000..d99a2fc8f699 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3SummaryOperationsClientImpl.java @@ -0,0 +1,448 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.SqlAssessmentV3SummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV3SummaryInner; +import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV3SummaryListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SqlAssessmentV3SummaryOperationsClient. + */ +public final class SqlAssessmentV3SummaryOperationsClientImpl implements SqlAssessmentV3SummaryOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SqlAssessmentV3SummaryOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of SqlAssessmentV3SummaryOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlAssessmentV3SummaryOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(SqlAssessmentV3SummaryOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientSqlAssessmentV3SummaryOperations + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface SqlAssessmentV3SummaryOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessments/{assessmentName}/summaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/sqlAssessments/{assessmentName}/summaries/{summaryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParentNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List SqlAssessmentV3Summary resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3Summary 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 SqlAssessmentV3Summary resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3Summary 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 SqlAssessmentV3Summary resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3Summary 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 SqlAssessmentV3Summary resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3Summary 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 SqlAssessmentV3Summary resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3Summary 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 SqlAssessmentV3Summary resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3Summary 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 a SqlAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV3Summary 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 SqlAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV3Summary 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 SqlAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV3Summary 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 SqlAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV3Summary 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 SqlAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV3Summary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlAssessmentV3SummaryInner get(String resourceGroupName, String projectName, String assessmentName, + String summaryName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, summaryName, Context.NONE).getValue(); + } + + /** + * 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 SqlAssessmentV3Summary 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 SqlAssessmentV3Summary 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3SummaryOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3SummaryOperationsImpl.java new file mode 100644 index 000000000000..c8f3ea294925 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlAssessmentV3SummaryOperationsImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.SqlAssessmentV3SummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV3SummaryInner; +import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV3Summary; +import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV3SummaryOperations; + +public final class SqlAssessmentV3SummaryOperationsImpl implements SqlAssessmentV3SummaryOperations { + private static final ClientLogger LOGGER = new ClientLogger(SqlAssessmentV3SummaryOperationsImpl.class); + + private final SqlAssessmentV3SummaryOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public SqlAssessmentV3SummaryOperationsImpl(SqlAssessmentV3SummaryOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SqlAssessmentV3SummaryImpl(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 SqlAssessmentV3SummaryImpl(inner1, this.manager())); + } + + 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 SqlAssessmentV3SummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SqlAssessmentV3Summary get(String resourceGroupName, String projectName, String assessmentName, + String summaryName) { + SqlAssessmentV3SummaryInner inner + = this.serviceClient().get(resourceGroupName, projectName, assessmentName, summaryName); + if (inner != null) { + return new SqlAssessmentV3SummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + private SqlAssessmentV3SummaryOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlCollectorOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlCollectorOperationsClientImpl.java index a05026e5c9cb..dfde7095411c 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlCollectorOperationsClientImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlCollectorOperationsClientImpl.java @@ -74,7 +74,7 @@ public interface SqlCollectorOperationsService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProject(@HostParam("$host") String endpoint, + Mono> listByParent(@HostParam("$host") 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); @@ -111,7 +111,7 @@ Mono> delete(@HostParam("$host") String endpoint, @QueryParam("ap @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProjectNext( + Mono> listByParentNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -128,7 +128,7 @@ Mono> listByAssessmentProjectNext( * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(String resourceGroupName, + private Mono> listByParentSinglePageAsync(String resourceGroupName, String projectName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -147,9 +147,8 @@ private Mono> listByAssessmentProjectSinglePage } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context)) + .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())); @@ -168,7 +167,7 @@ private Mono> listByAssessmentProjectSinglePage * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(String resourceGroupName, + private Mono> listByParentSinglePageAsync(String resourceGroupName, String projectName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -188,8 +187,8 @@ private Mono> listByAssessmentProjectSinglePage final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context) + .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)); } @@ -205,9 +204,9 @@ private Mono> listByAssessmentProjectSinglePage * @return the response of a SqlCollector list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink)); + private PagedFlux listByParentAsync(String resourceGroupName, String projectName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); } /** @@ -222,10 +221,10 @@ private PagedFlux listByAssessmentProjectAsync(String resourc * @return the response of a SqlCollector list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName, + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, Context context) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName, context), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); } /** @@ -239,8 +238,8 @@ private PagedFlux listByAssessmentProjectAsync(String resourc * @return the response of a SqlCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName)); + public PagedIterable listByParent(String resourceGroupName, String projectName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName)); } /** @@ -255,9 +254,9 @@ public PagedIterable listByAssessmentProject(String resourceG * @return the response of a SqlCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, + public PagedIterable listByParent(String resourceGroupName, String projectName, Context context) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName, context)); + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, context)); } /** @@ -773,7 +772,7 @@ public void delete(String resourceGroupName, String projectName, String collecto * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(String nextLink) { + private Mono> listByParentNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -783,8 +782,7 @@ private Mono> listByAssessmentProjectNextSingle } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, context)) + .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())); @@ -802,8 +800,7 @@ private Mono> listByAssessmentProjectNextSingle * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(String nextLink, - Context context) { + private Mono> listByParentNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -813,7 +810,7 @@ private Mono> listByAssessmentProjectNextSingle } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlCollectorOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlCollectorOperationsImpl.java index 3c8e9f305574..3f5c4ec9b4c0 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlCollectorOperationsImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlCollectorOperationsImpl.java @@ -27,16 +27,14 @@ public SqlCollectorOperationsImpl(SqlCollectorOperationsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName); + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner = this.serviceClient().listByParent(resourceGroupName, projectName); return ResourceManagerUtils.mapPage(inner, inner1 -> new SqlCollectorImpl(inner1, this.manager())); } - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context) { + public PagedIterable listByParent(String resourceGroupName, String projectName, Context context) { PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName, context); + = this.serviceClient().listByParent(resourceGroupName, projectName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new SqlCollectorImpl(inner1, this.manager())); } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlGraphAssessmentOptionsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlGraphAssessmentOptionsImpl.java new file mode 100644 index 000000000000..d33bec3ab5a7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlGraphAssessmentOptionsImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.SqlGraphAssessmentOptionsInner; +import com.azure.resourcemanager.migration.assessment.models.SqlGraphAssessmentOptions; +import com.azure.resourcemanager.migration.assessment.models.SqlGraphAssessmentOptionsProperties; + +public final class SqlGraphAssessmentOptionsImpl implements SqlGraphAssessmentOptions { + private SqlGraphAssessmentOptionsInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + SqlGraphAssessmentOptionsImpl(SqlGraphAssessmentOptionsInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 SqlGraphAssessmentOptionsProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SqlGraphAssessmentOptionsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlGraphAssessmentOptionsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlGraphAssessmentOptionsOperationsClientImpl.java new file mode 100644 index 000000000000..bb75b4e931c0 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlGraphAssessmentOptionsOperationsClientImpl.java @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.SqlGraphAssessmentOptionsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.SqlGraphAssessmentOptionsInner; +import com.azure.resourcemanager.migration.assessment.models.SqlGraphAssessmentOptionsListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SqlGraphAssessmentOptionsOperationsClient. + */ +public final class SqlGraphAssessmentOptionsOperationsClientImpl implements SqlGraphAssessmentOptionsOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SqlGraphAssessmentOptionsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of SqlGraphAssessmentOptionsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlGraphAssessmentOptionsOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(SqlGraphAssessmentOptionsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * MigrationAssessmentManagementClientSqlGraphAssessmentOptionsOperations to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface SqlGraphAssessmentOptionsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessmentOptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/sqlAssessmentOptions/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions 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 a SqlGraphAssessmentOptions. + * + * @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 SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions. + * + * @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 SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions. + * + * @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 SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions. + * + * @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 SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions. + * + * @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 SqlGraphAssessmentOptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlGraphAssessmentOptionsInner get(String resourceGroupName, String projectName) { + return getWithResponse(resourceGroupName, projectName, Context.NONE).getValue(); + } + + /** + * 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 SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlGraphAssessmentOptionsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlGraphAssessmentOptionsOperationsImpl.java new file mode 100644 index 000000000000..f67feec8d67c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/SqlGraphAssessmentOptionsOperationsImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.SqlGraphAssessmentOptionsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.SqlGraphAssessmentOptionsInner; +import com.azure.resourcemanager.migration.assessment.models.SqlGraphAssessmentOptions; +import com.azure.resourcemanager.migration.assessment.models.SqlGraphAssessmentOptionsOperations; + +public final class SqlGraphAssessmentOptionsOperationsImpl implements SqlGraphAssessmentOptionsOperations { + private static final ClientLogger LOGGER = new ClientLogger(SqlGraphAssessmentOptionsOperationsImpl.class); + + private final SqlGraphAssessmentOptionsOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public SqlGraphAssessmentOptionsOperationsImpl(SqlGraphAssessmentOptionsOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SqlGraphAssessmentOptionsImpl(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 SqlGraphAssessmentOptionsImpl(inner1, this.manager())); + } + + 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 SqlGraphAssessmentOptionsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SqlGraphAssessmentOptions get(String resourceGroupName, String projectName) { + SqlGraphAssessmentOptionsInner inner = this.serviceClient().get(resourceGroupName, projectName); + if (inner != null) { + return new SqlGraphAssessmentOptionsImpl(inner, this.manager()); + } else { + return null; + } + } + + private SqlGraphAssessmentOptionsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/VmwareCollectorsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/VmwareCollectorsOperationsClientImpl.java index 8ec2e0aae49f..c4f5c37afab8 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/VmwareCollectorsOperationsClientImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/VmwareCollectorsOperationsClientImpl.java @@ -74,7 +74,7 @@ public interface VmwareCollectorsOperationsService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProject(@HostParam("$host") String endpoint, + Mono> listByParent(@HostParam("$host") 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); @@ -114,7 +114,7 @@ Mono> delete(@HostParam("$host") String endpoint, @QueryParam("ap @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAssessmentProjectNext( + Mono> listByParentNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -131,7 +131,7 @@ Mono> listByAssessmentProjectNext( * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(String resourceGroupName, + private Mono> listByParentSinglePageAsync(String resourceGroupName, String projectName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -150,9 +150,8 @@ private Mono> listByAssessmentProjectSingleP } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context)) + .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())); @@ -171,7 +170,7 @@ private Mono> listByAssessmentProjectSingleP * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectSinglePageAsync(String resourceGroupName, + private Mono> listByParentSinglePageAsync(String resourceGroupName, String projectName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -191,8 +190,8 @@ private Mono> listByAssessmentProjectSingleP final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByAssessmentProject(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context) + .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)); } @@ -208,9 +207,9 @@ private Mono> listByAssessmentProjectSingleP * @return the response of a VmwareCollector list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink)); + private PagedFlux listByParentAsync(String resourceGroupName, String projectName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); } /** @@ -225,10 +224,10 @@ private PagedFlux listByAssessmentProjectAsync(String reso * @return the response of a VmwareCollector list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAssessmentProjectAsync(String resourceGroupName, String projectName, + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, Context context) { - return new PagedFlux<>(() -> listByAssessmentProjectSinglePageAsync(resourceGroupName, projectName, context), - nextLink -> listByAssessmentProjectNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); } /** @@ -242,8 +241,8 @@ private PagedFlux listByAssessmentProjectAsync(String reso * @return the response of a VmwareCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName)); + public PagedIterable listByParent(String resourceGroupName, String projectName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName)); } /** @@ -258,9 +257,9 @@ public PagedIterable listByAssessmentProject(String resour * @return the response of a VmwareCollector list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, + public PagedIterable listByParent(String resourceGroupName, String projectName, Context context) { - return new PagedIterable<>(listByAssessmentProjectAsync(resourceGroupName, projectName, context)); + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, context)); } /** @@ -788,7 +787,7 @@ public void delete(String resourceGroupName, String projectName, String vmWareCo * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(String nextLink) { + private Mono> listByParentNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -798,8 +797,7 @@ private Mono> listByAssessmentProjectNextSin } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, context)) + .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())); @@ -817,7 +815,7 @@ private Mono> listByAssessmentProjectNextSin * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAssessmentProjectNextSinglePageAsync(String nextLink, + private Mono> listByParentNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -828,7 +826,7 @@ private Mono> listByAssessmentProjectNextSin } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByAssessmentProjectNext(nextLink, this.client.getEndpoint(), accept, 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/VmwareCollectorsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/VmwareCollectorsOperationsImpl.java index 6d8f228f2e32..42d0566ab8cb 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/VmwareCollectorsOperationsImpl.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/VmwareCollectorsOperationsImpl.java @@ -27,16 +27,14 @@ public VmwareCollectorsOperationsImpl(VmwareCollectorsOperationsClient innerClie this.serviceManager = serviceManager; } - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName) { - PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName); + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner = this.serviceClient().listByParent(resourceGroupName, projectName); return ResourceManagerUtils.mapPage(inner, inner1 -> new VmwareCollectorImpl(inner1, this.manager())); } - public PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context) { + public PagedIterable listByParent(String resourceGroupName, String projectName, Context context) { PagedIterable inner - = this.serviceClient().listByAssessmentProject(resourceGroupName, projectName, context); + = this.serviceClient().listByParent(resourceGroupName, projectName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new VmwareCollectorImpl(inner1, this.manager())); } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3Impl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3Impl.java new file mode 100644 index 000000000000..10e45788e155 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3Impl.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppAssessmentV3Inner; +import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; +import com.azure.resourcemanager.migration.assessment.models.WebAppAssessmentV3; +import com.azure.resourcemanager.migration.assessment.models.WebAppAssessmentV3Properties; + +public final class WebAppAssessmentV3Impl implements WebAppAssessmentV3, WebAppAssessmentV3.Definition { + private WebAppAssessmentV3Inner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + WebAppAssessmentV3Impl(WebAppAssessmentV3Inner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 WebAppAssessmentV3Properties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public WebAppAssessmentV3Inner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String projectName; + + private String assessmentName; + + public WebAppAssessmentV3Impl withExistingAssessmentProject(String resourceGroupName, String projectName) { + this.resourceGroupName = resourceGroupName; + this.projectName = projectName; + return this; + } + + public WebAppAssessmentV3 create() { + this.innerObject = serviceManager.serviceClient() + .getWebAppAssessmentV3Operations() + .create(resourceGroupName, projectName, assessmentName, this.innerModel(), Context.NONE); + return this; + } + + public WebAppAssessmentV3 create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWebAppAssessmentV3Operations() + .create(resourceGroupName, projectName, assessmentName, this.innerModel(), context); + return this; + } + + WebAppAssessmentV3Impl(String name, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerObject = new WebAppAssessmentV3Inner(); + this.serviceManager = serviceManager; + this.assessmentName = name; + } + + public WebAppAssessmentV3 refresh() { + this.innerObject = serviceManager.serviceClient() + .getWebAppAssessmentV3Operations() + .getWithResponse(resourceGroupName, projectName, assessmentName, Context.NONE) + .getValue(); + return this; + } + + public WebAppAssessmentV3 refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWebAppAssessmentV3Operations() + .getWithResponse(resourceGroupName, projectName, assessmentName, context) + .getValue(); + return this; + } + + public DownloadUrl downloadUrl(Object body) { + return serviceManager.webAppAssessmentV3Operations() + .downloadUrl(resourceGroupName, projectName, assessmentName, body); + } + + public DownloadUrl downloadUrl(Object body, Context context) { + return serviceManager.webAppAssessmentV3Operations() + .downloadUrl(resourceGroupName, projectName, assessmentName, body, context); + } + + public WebAppAssessmentV3Impl withProperties(WebAppAssessmentV3Properties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3OperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3OperationsClientImpl.java new file mode 100644 index 000000000000..fef40b2bfb1e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3OperationsClientImpl.java @@ -0,0 +1,1081 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.WebAppAssessmentV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppAssessmentV3Inner; +import com.azure.resourcemanager.migration.assessment.models.WebAppAssessmentV3ListResult; +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 WebAppAssessmentV3OperationsClient. + */ +public final class WebAppAssessmentV3OperationsClientImpl implements WebAppAssessmentV3OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final WebAppAssessmentV3OperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of WebAppAssessmentV3OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WebAppAssessmentV3OperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(WebAppAssessmentV3OperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientWebAppAssessmentV3Operations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface WebAppAssessmentV3OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppAssessments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/webAppAssessments/{assessmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppAssessments/{assessmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, + @BodyParam("application/json") WebAppAssessmentV3Inner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppAssessments/{assessmentName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppAssessments/{assessmentName}/downloadUrl") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> downloadUrl(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, @BodyParam("application/json") Object body, + @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List WebAppAssessmentV3 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 WebAppAssessmentV3 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 WebAppAssessmentV3 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 WebAppAssessmentV3 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 WebAppAssessmentV3 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 WebAppAssessmentV3 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 WebAppAssessmentV3 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 WebAppAssessmentV3 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 WebAppAssessmentV3 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 WebAppAssessmentV3 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 WebAppAssessmentV3 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 WebAppAssessmentV3 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 a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3 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 WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3 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 WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3 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 WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3 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 WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebAppAssessmentV3Inner get(String resourceGroupName, String projectName, String assessmentName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, Context.NONE).getValue(); + } + + /** + * Create a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 webApp assessment resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, WebAppAssessmentV3Inner 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 accept = "application/json"; + return FluxUtil.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 webApp assessment resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, WebAppAssessmentV3Inner 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, assessmentName, resource, accept, context); + } + + /** + * Create a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 webApp assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WebAppAssessmentV3Inner> beginCreateAsync( + String resourceGroupName, String projectName, String assessmentName, WebAppAssessmentV3Inner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, assessmentName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), WebAppAssessmentV3Inner.class, WebAppAssessmentV3Inner.class, + this.client.getContext()); + } + + /** + * Create a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 webApp assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WebAppAssessmentV3Inner> beginCreateAsync( + String resourceGroupName, String projectName, String assessmentName, WebAppAssessmentV3Inner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, assessmentName, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), WebAppAssessmentV3Inner.class, WebAppAssessmentV3Inner.class, context); + } + + /** + * Create a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 webApp assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WebAppAssessmentV3Inner> beginCreate( + String resourceGroupName, String projectName, String assessmentName, WebAppAssessmentV3Inner resource) { + return this.beginCreateAsync(resourceGroupName, projectName, assessmentName, resource).getSyncPoller(); + } + + /** + * Create a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 webApp assessment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WebAppAssessmentV3Inner> beginCreate( + String resourceGroupName, String projectName, String assessmentName, WebAppAssessmentV3Inner resource, + Context context) { + return this.beginCreateAsync(resourceGroupName, projectName, assessmentName, resource, context).getSyncPoller(); + } + + /** + * Create a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 webApp assessment resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, + String assessmentName, WebAppAssessmentV3Inner resource) { + return beginCreateAsync(resourceGroupName, projectName, assessmentName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 webApp assessment resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, + String assessmentName, WebAppAssessmentV3Inner resource, Context context) { + return beginCreateAsync(resourceGroupName, projectName, assessmentName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 webApp assessment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebAppAssessmentV3Inner create(String resourceGroupName, String projectName, String assessmentName, + WebAppAssessmentV3Inner resource) { + return createAsync(resourceGroupName, projectName, assessmentName, resource).block(); + } + + /** + * Create a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 webApp assessment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebAppAssessmentV3Inner create(String resourceGroupName, String projectName, String assessmentName, + WebAppAssessmentV3Inner resource, Context context) { + return createAsync(resourceGroupName, projectName, assessmentName, resource, context).block(); + } + + /** + * Delete a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> downloadUrlWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, Object 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.downloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> downloadUrlWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, Object 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.")); + } + 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, body, accept, context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DownloadUrlInner> beginDownloadUrlAsync(String resourceGroupName, + String projectName, String assessmentName, Object body) { + Mono>> mono + = downloadUrlWithResponseAsync(resourceGroupName, projectName, assessmentName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DownloadUrlInner.class, DownloadUrlInner.class, this.client.getContext()); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DownloadUrlInner> beginDownloadUrlAsync(String resourceGroupName, + String projectName, String assessmentName, Object 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); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String assessmentName, Object body) { + return this.beginDownloadUrlAsync(resourceGroupName, projectName, assessmentName, body).getSyncPoller(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String assessmentName, Object body, Context context) { + return this.beginDownloadUrlAsync(resourceGroupName, projectName, assessmentName, body, context) + .getSyncPoller(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono downloadUrlAsync(String resourceGroupName, String projectName, String assessmentName, + Object body) { + return beginDownloadUrlAsync(resourceGroupName, projectName, assessmentName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono downloadUrlAsync(String resourceGroupName, String projectName, String assessmentName, + Object body, Context context) { + return beginDownloadUrlAsync(resourceGroupName, projectName, assessmentName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, + Object body) { + return downloadUrlAsync(resourceGroupName, projectName, assessmentName, body).block(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, + Object 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 WebAppAssessmentV3 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 WebAppAssessmentV3 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3OperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3OperationsImpl.java new file mode 100644 index 000000000000..8feeed812605 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3OperationsImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.WebAppAssessmentV3OperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppAssessmentV3Inner; +import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; +import com.azure.resourcemanager.migration.assessment.models.WebAppAssessmentV3; +import com.azure.resourcemanager.migration.assessment.models.WebAppAssessmentV3Operations; + +public final class WebAppAssessmentV3OperationsImpl implements WebAppAssessmentV3Operations { + private static final ClientLogger LOGGER = new ClientLogger(WebAppAssessmentV3OperationsImpl.class); + + private final WebAppAssessmentV3OperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public WebAppAssessmentV3OperationsImpl(WebAppAssessmentV3OperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WebAppAssessmentV3Impl(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 WebAppAssessmentV3Impl(inner1, this.manager())); + } + + 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 WebAppAssessmentV3Impl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WebAppAssessmentV3 get(String resourceGroupName, String projectName, String assessmentName) { + WebAppAssessmentV3Inner inner = this.serviceClient().get(resourceGroupName, projectName, assessmentName); + if (inner != null) { + return new WebAppAssessmentV3Impl(inner, this.manager()); + } else { + return null; + } + } + + 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, Object 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, Object 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 WebAppAssessmentV3 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, "webAppAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webAppAssessments'.", 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, "webAppAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webAppAssessments'.", 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, "webAppAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webAppAssessments'.", 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, "webAppAssessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webAppAssessments'.", id))); + } + return this.deleteWithResponse(resourceGroupName, projectName, assessmentName, context); + } + + private WebAppAssessmentV3OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + public WebAppAssessmentV3Impl define(String name) { + return new WebAppAssessmentV3Impl(name, this.manager()); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3SummaryImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3SummaryImpl.java new file mode 100644 index 000000000000..1145e80e8703 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3SummaryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppAssessmentV3SummaryInner; +import com.azure.resourcemanager.migration.assessment.models.WebAppAssessmentV3Summary; +import com.azure.resourcemanager.migration.assessment.models.WebAppSummaryProperties; + +public final class WebAppAssessmentV3SummaryImpl implements WebAppAssessmentV3Summary { + private WebAppAssessmentV3SummaryInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + WebAppAssessmentV3SummaryImpl(WebAppAssessmentV3SummaryInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 WebAppSummaryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public WebAppAssessmentV3SummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3SummaryOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3SummaryOperationsClientImpl.java new file mode 100644 index 000000000000..369a4f78f2a5 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3SummaryOperationsClientImpl.java @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.WebAppAssessmentV3SummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppAssessmentV3SummaryInner; +import com.azure.resourcemanager.migration.assessment.models.WebAppAssessmentV3SummaryListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in WebAppAssessmentV3SummaryOperationsClient. + */ +public final class WebAppAssessmentV3SummaryOperationsClientImpl implements WebAppAssessmentV3SummaryOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final WebAppAssessmentV3SummaryOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of WebAppAssessmentV3SummaryOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WebAppAssessmentV3SummaryOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(WebAppAssessmentV3SummaryOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * MigrationAssessmentManagementClientWebAppAssessmentV3SummaryOperations to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface WebAppAssessmentV3SummaryOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppAssessments/{assessmentName}/summaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/webAppAssessments/{assessmentName}/summaries/{summaryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParentNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List WebAppAssessmentV3Summary resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3Summary 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 WebAppAssessmentV3Summary resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3Summary 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 WebAppAssessmentV3Summary resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3Summary 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 WebAppAssessmentV3Summary resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3Summary 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 WebAppAssessmentV3Summary resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3Summary 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 WebAppAssessmentV3Summary resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3Summary 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 a WebAppAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param summaryName Gets the Name of the WebApp assessment 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 WebAppAssessmentV3Summary 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 WebAppAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param summaryName Gets the Name of the WebApp assessment 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 WebAppAssessmentV3Summary 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 WebAppAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param summaryName Gets the Name of the WebApp assessment 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 WebAppAssessmentV3Summary 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 WebAppAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param summaryName Gets the Name of the WebApp assessment 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 WebAppAssessmentV3Summary 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 WebAppAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param summaryName Gets the Name of the WebApp assessment 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 WebAppAssessmentV3Summary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebAppAssessmentV3SummaryInner get(String resourceGroupName, String projectName, String assessmentName, + String summaryName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, summaryName, Context.NONE).getValue(); + } + + /** + * 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 WebAppAssessmentV3Summary 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 WebAppAssessmentV3Summary 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3SummaryOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3SummaryOperationsImpl.java new file mode 100644 index 000000000000..4eda82061afd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppAssessmentV3SummaryOperationsImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.WebAppAssessmentV3SummaryOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppAssessmentV3SummaryInner; +import com.azure.resourcemanager.migration.assessment.models.WebAppAssessmentV3Summary; +import com.azure.resourcemanager.migration.assessment.models.WebAppAssessmentV3SummaryOperations; + +public final class WebAppAssessmentV3SummaryOperationsImpl implements WebAppAssessmentV3SummaryOperations { + private static final ClientLogger LOGGER = new ClientLogger(WebAppAssessmentV3SummaryOperationsImpl.class); + + private final WebAppAssessmentV3SummaryOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public WebAppAssessmentV3SummaryOperationsImpl(WebAppAssessmentV3SummaryOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WebAppAssessmentV3SummaryImpl(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 WebAppAssessmentV3SummaryImpl(inner1, this.manager())); + } + + 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 WebAppAssessmentV3SummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WebAppAssessmentV3Summary get(String resourceGroupName, String projectName, String assessmentName, + String summaryName) { + WebAppAssessmentV3SummaryInner inner + = this.serviceClient().get(resourceGroupName, projectName, assessmentName, summaryName); + if (inner != null) { + return new WebAppAssessmentV3SummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + private WebAppAssessmentV3SummaryOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppCollectorImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppCollectorImpl.java new file mode 100644 index 000000000000..2d97beb42d37 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppCollectorImpl.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppCollectorInner; +import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; +import com.azure.resourcemanager.migration.assessment.models.WebAppCollector; + +public final class WebAppCollectorImpl implements WebAppCollector, WebAppCollector.Definition { + private WebAppCollectorInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + WebAppCollectorImpl(WebAppCollectorInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 CollectorPropertiesBaseWithAgent properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public WebAppCollectorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String projectName; + + private String collectorName; + + public WebAppCollectorImpl withExistingAssessmentProject(String resourceGroupName, String projectName) { + this.resourceGroupName = resourceGroupName; + this.projectName = projectName; + return this; + } + + public WebAppCollector create() { + this.innerObject = serviceManager.serviceClient() + .getWebAppCollectorOperations() + .create(resourceGroupName, projectName, collectorName, this.innerModel(), Context.NONE); + return this; + } + + public WebAppCollector create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWebAppCollectorOperations() + .create(resourceGroupName, projectName, collectorName, this.innerModel(), context); + return this; + } + + WebAppCollectorImpl(String name, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerObject = new WebAppCollectorInner(); + this.serviceManager = serviceManager; + this.collectorName = name; + } + + public WebAppCollector refresh() { + this.innerObject = serviceManager.serviceClient() + .getWebAppCollectorOperations() + .getWithResponse(resourceGroupName, projectName, collectorName, Context.NONE) + .getValue(); + return this; + } + + public WebAppCollector refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWebAppCollectorOperations() + .getWithResponse(resourceGroupName, projectName, collectorName, context) + .getValue(); + return this; + } + + public WebAppCollectorImpl withProperties(CollectorPropertiesBaseWithAgent properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppCollectorOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppCollectorOperationsClientImpl.java new file mode 100644 index 000000000000..0f8f8b2731ce --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppCollectorOperationsClientImpl.java @@ -0,0 +1,820 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.migration.assessment.fluent.WebAppCollectorOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppCollectorInner; +import com.azure.resourcemanager.migration.assessment.models.WebAppCollectorListResult; +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 WebAppCollectorOperationsClient. + */ +public final class WebAppCollectorOperationsClientImpl implements WebAppCollectorOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final WebAppCollectorOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of WebAppCollectorOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WebAppCollectorOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(WebAppCollectorOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientWebAppCollectorOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface WebAppCollectorOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCollectors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/webAppCollectors/{collectorName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("collectorName") String collectorName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCollectors/{collectorName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("collectorName") String collectorName, + @BodyParam("application/json") WebAppCollectorInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCollectors/{collectorName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("collectorName") String collectorName, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List WebAppCollector 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 WebAppCollector 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 WebAppCollector 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 WebAppCollector 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 WebAppCollector 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 WebAppCollector 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 WebAppCollector 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 WebAppCollector 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 WebAppCollector 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 WebAppCollector 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 WebAppCollector 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 WebAppCollector 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 a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 WebAppCollector along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String collectorName) { + 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 (collectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectorName 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, collectorName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 WebAppCollector along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String collectorName, 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 (collectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectorName 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, collectorName, accept, context); + } + + /** + * Get a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 WebAppCollector on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, String collectorName) { + return getWithResponseAsync(resourceGroupName, projectName, collectorName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 WebAppCollector along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String collectorName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, collectorName, context).block(); + } + + /** + * Get a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 WebAppCollector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebAppCollectorInner get(String resourceGroupName, String projectName, String collectorName) { + return getWithResponse(resourceGroupName, projectName, collectorName, Context.NONE).getValue(); + } + + /** + * Create a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 web app collector REST object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String collectorName, WebAppCollectorInner 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 (collectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectorName 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 accept = "application/json"; + return FluxUtil.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, collectorName, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 web app collector REST object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String collectorName, WebAppCollectorInner 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 (collectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectorName 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, collectorName, resource, accept, context); + } + + /** + * Create a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 the web app collector REST object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WebAppCollectorInner> beginCreateAsync( + String resourceGroupName, String projectName, String collectorName, WebAppCollectorInner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, collectorName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + WebAppCollectorInner.class, WebAppCollectorInner.class, this.client.getContext()); + } + + /** + * Create a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 the web app collector REST object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WebAppCollectorInner> beginCreateAsync( + String resourceGroupName, String projectName, String collectorName, WebAppCollectorInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, collectorName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + WebAppCollectorInner.class, WebAppCollectorInner.class, context); + } + + /** + * Create a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 the web app collector REST object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WebAppCollectorInner> beginCreate(String resourceGroupName, + String projectName, String collectorName, WebAppCollectorInner resource) { + return this.beginCreateAsync(resourceGroupName, projectName, collectorName, resource).getSyncPoller(); + } + + /** + * Create a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 the web app collector REST object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WebAppCollectorInner> beginCreate(String resourceGroupName, + String projectName, String collectorName, WebAppCollectorInner resource, Context context) { + return this.beginCreateAsync(resourceGroupName, projectName, collectorName, resource, context).getSyncPoller(); + } + + /** + * Create a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 web app collector REST object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, String collectorName, + WebAppCollectorInner resource) { + return beginCreateAsync(resourceGroupName, projectName, collectorName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 web app collector REST object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, String collectorName, + WebAppCollectorInner resource, Context context) { + return beginCreateAsync(resourceGroupName, projectName, collectorName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 web app collector REST object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebAppCollectorInner create(String resourceGroupName, String projectName, String collectorName, + WebAppCollectorInner resource) { + return createAsync(resourceGroupName, projectName, collectorName, resource).block(); + } + + /** + * Create a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 web app collector REST object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebAppCollectorInner create(String resourceGroupName, String projectName, String collectorName, + WebAppCollectorInner resource, Context context) { + return createAsync(resourceGroupName, projectName, collectorName, resource, context).block(); + } + + /** + * Delete a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 collectorName) { + 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 (collectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectorName 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, collectorName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 collectorName, 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 (collectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectorName 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, collectorName, accept, context); + } + + /** + * Delete a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 collectorName) { + return deleteWithResponseAsync(resourceGroupName, projectName, collectorName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 collectorName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, projectName, collectorName, context).block(); + } + + /** + * Delete a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 collectorName) { + deleteWithResponse(resourceGroupName, projectName, collectorName, Context.NONE); + } + + /** + * 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 WebAppCollector 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 WebAppCollector 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppCollectorOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppCollectorOperationsImpl.java new file mode 100644 index 000000000000..124ae553c20b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppCollectorOperationsImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.WebAppCollectorOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppCollectorInner; +import com.azure.resourcemanager.migration.assessment.models.WebAppCollector; +import com.azure.resourcemanager.migration.assessment.models.WebAppCollectorOperations; + +public final class WebAppCollectorOperationsImpl implements WebAppCollectorOperations { + private static final ClientLogger LOGGER = new ClientLogger(WebAppCollectorOperationsImpl.class); + + private final WebAppCollectorOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public WebAppCollectorOperationsImpl(WebAppCollectorOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner = this.serviceClient().listByParent(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WebAppCollectorImpl(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 WebAppCollectorImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, String collectorName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, projectName, collectorName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WebAppCollectorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WebAppCollector get(String resourceGroupName, String projectName, String collectorName) { + WebAppCollectorInner inner = this.serviceClient().get(resourceGroupName, projectName, collectorName); + if (inner != null) { + return new WebAppCollectorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String projectName, String collectorName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, projectName, collectorName, context); + } + + public void delete(String resourceGroupName, String projectName, String collectorName) { + this.serviceClient().delete(resourceGroupName, projectName, collectorName); + } + + public WebAppCollector 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 collectorName = ResourceManagerUtils.getValueFromIdByName(id, "webAppCollectors"); + if (collectorName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webAppCollectors'.", id))); + } + return this.getWithResponse(resourceGroupName, projectName, collectorName, 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 collectorName = ResourceManagerUtils.getValueFromIdByName(id, "webAppCollectors"); + if (collectorName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webAppCollectors'.", id))); + } + return this.getWithResponse(resourceGroupName, projectName, collectorName, 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 collectorName = ResourceManagerUtils.getValueFromIdByName(id, "webAppCollectors"); + if (collectorName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webAppCollectors'.", id))); + } + this.deleteWithResponse(resourceGroupName, projectName, collectorName, 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 collectorName = ResourceManagerUtils.getValueFromIdByName(id, "webAppCollectors"); + if (collectorName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webAppCollectors'.", id))); + } + return this.deleteWithResponse(resourceGroupName, projectName, collectorName, context); + } + + private WebAppCollectorOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } + + public WebAppCollectorImpl define(String name) { + return new WebAppCollectorImpl(name, this.manager()); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppCompoundAssessmentSummaryImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppCompoundAssessmentSummaryImpl.java new file mode 100644 index 000000000000..64a93b94eb3f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppCompoundAssessmentSummaryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppCompoundAssessmentSummaryInner; +import com.azure.resourcemanager.migration.assessment.models.WebAppCompoundAssessmentSummary; +import com.azure.resourcemanager.migration.assessment.models.WebAppCompoundAssessmentSummaryProperties; + +public final class WebAppCompoundAssessmentSummaryImpl implements WebAppCompoundAssessmentSummary { + private WebAppCompoundAssessmentSummaryInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + WebAppCompoundAssessmentSummaryImpl(WebAppCompoundAssessmentSummaryInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 WebAppCompoundAssessmentSummaryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public WebAppCompoundAssessmentSummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppGraphAssessmentOptionsOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppGraphAssessmentOptionsOperationsClientImpl.java new file mode 100644 index 000000000000..09fd03056b39 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppGraphAssessmentOptionsOperationsClientImpl.java @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.WebAppGraphAssessmentOptionsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.WepAppGraphAssessmentOptionsInner; +import com.azure.resourcemanager.migration.assessment.models.WepAppGraphAssessmentOptionsListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * WebAppGraphAssessmentOptionsOperationsClient. + */ +public final class WebAppGraphAssessmentOptionsOperationsClientImpl + implements WebAppGraphAssessmentOptionsOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final WebAppGraphAssessmentOptionsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of WebAppGraphAssessmentOptionsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WebAppGraphAssessmentOptionsOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(WebAppGraphAssessmentOptionsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * MigrationAssessmentManagementClientWebAppGraphAssessmentOptionsOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface WebAppGraphAssessmentOptionsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppAssessmentOptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/webAppAssessmentOptions/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions 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 a WepAppGraphAssessmentOptions. + * + * @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 WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions. + * + * @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 WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions. + * + * @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 WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions. + * + * @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 WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions. + * + * @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 WepAppGraphAssessmentOptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WepAppGraphAssessmentOptionsInner get(String resourceGroupName, String projectName) { + return getWithResponse(resourceGroupName, projectName, Context.NONE).getValue(); + } + + /** + * 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 WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppGraphAssessmentOptionsOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppGraphAssessmentOptionsOperationsImpl.java new file mode 100644 index 000000000000..e4736521b3a5 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppGraphAssessmentOptionsOperationsImpl.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.WebAppGraphAssessmentOptionsOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.WepAppGraphAssessmentOptionsInner; +import com.azure.resourcemanager.migration.assessment.models.WebAppGraphAssessmentOptionsOperations; +import com.azure.resourcemanager.migration.assessment.models.WepAppGraphAssessmentOptions; + +public final class WebAppGraphAssessmentOptionsOperationsImpl implements WebAppGraphAssessmentOptionsOperations { + private static final ClientLogger LOGGER = new ClientLogger(WebAppGraphAssessmentOptionsOperationsImpl.class); + + private final WebAppGraphAssessmentOptionsOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public WebAppGraphAssessmentOptionsOperationsImpl(WebAppGraphAssessmentOptionsOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new WepAppGraphAssessmentOptionsImpl(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 WepAppGraphAssessmentOptionsImpl(inner1, this.manager())); + } + + 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 WepAppGraphAssessmentOptionsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WepAppGraphAssessmentOptions get(String resourceGroupName, String projectName) { + WepAppGraphAssessmentOptionsInner inner = this.serviceClient().get(resourceGroupName, projectName); + if (inner != null) { + return new WepAppGraphAssessmentOptionsImpl(inner, this.manager()); + } else { + return null; + } + } + + private WebAppGraphAssessmentOptionsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppServicePlanV3Impl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppServicePlanV3Impl.java new file mode 100644 index 000000000000..6987a21525aa --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppServicePlanV3Impl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppServicePlanV3Inner; +import com.azure.resourcemanager.migration.assessment.models.WebAppServicePlanV3; +import com.azure.resourcemanager.migration.assessment.models.WebAppServicePlanV3Properties; + +public final class WebAppServicePlanV3Impl implements WebAppServicePlanV3 { + private WebAppServicePlanV3Inner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + WebAppServicePlanV3Impl(WebAppServicePlanV3Inner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 WebAppServicePlanV3Properties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public WebAppServicePlanV3Inner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppServicePlansOperationsClientImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppServicePlansOperationsClientImpl.java new file mode 100644 index 000000000000..249533db7d7f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppServicePlansOperationsClientImpl.java @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.WebAppServicePlansOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppServicePlanV3Inner; +import com.azure.resourcemanager.migration.assessment.models.WebAppServicePlanV3ListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in WebAppServicePlansOperationsClient. + */ +public final class WebAppServicePlansOperationsClientImpl implements WebAppServicePlansOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final WebAppServicePlansOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrationAssessmentManagementClientImpl client; + + /** + * Initializes an instance of WebAppServicePlansOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WebAppServicePlansOperationsClientImpl(MigrationAssessmentManagementClientImpl client) { + this.service = RestProxy.create(WebAppServicePlansOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrationAssessmentManagementClientWebAppServicePlansOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MigrationAssessmentM") + public interface WebAppServicePlansOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppAssessments/{assessmentName}/webAppServicePlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("$host") 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}/webAppAssessments/{assessmentName}/webAppServicePlans/{servicePlanName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, @PathParam("servicePlanName") String servicePlanName, + @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List WebAppServicePlanV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppServicePlanV3 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 WebAppServicePlanV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppServicePlanV3 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 WebAppServicePlanV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppServicePlanV3 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 WebAppServicePlanV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppServicePlanV3 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 WebAppServicePlanV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppServicePlanV3 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 WebAppServicePlanV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppServicePlanV3 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 a WebAppServicePlanV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param servicePlanName Gets the Name of the WebApp assessment service plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a WebAppServicePlanV3 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, String servicePlanName) { + 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 (servicePlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter servicePlanName 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, servicePlanName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a WebAppServicePlanV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param servicePlanName Gets the Name of the WebApp assessment service plan. + * @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 WebAppServicePlanV3 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, String servicePlanName, 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 (servicePlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter servicePlanName 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, servicePlanName, accept, context); + } + + /** + * Get a WebAppServicePlanV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param servicePlanName Gets the Name of the WebApp assessment service plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a WebAppServicePlanV3 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, String assessmentName, + String servicePlanName) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, servicePlanName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a WebAppServicePlanV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param servicePlanName Gets the Name of the WebApp assessment service plan. + * @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 WebAppServicePlanV3 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String servicePlanName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, servicePlanName, context).block(); + } + + /** + * Get a WebAppServicePlanV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param servicePlanName Gets the Name of the WebApp assessment service plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a WebAppServicePlanV3. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebAppServicePlanV3Inner get(String resourceGroupName, String projectName, String assessmentName, + String servicePlanName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, servicePlanName, Context.NONE) + .getValue(); + } + + /** + * 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 WebAppServicePlanV3 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 WebAppServicePlanV3 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppServicePlansOperationsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppServicePlansOperationsImpl.java new file mode 100644 index 000000000000..acfcf6184796 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WebAppServicePlansOperationsImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.WebAppServicePlansOperationsClient; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppServicePlanV3Inner; +import com.azure.resourcemanager.migration.assessment.models.WebAppServicePlanV3; +import com.azure.resourcemanager.migration.assessment.models.WebAppServicePlansOperations; + +public final class WebAppServicePlansOperationsImpl implements WebAppServicePlansOperations { + private static final ClientLogger LOGGER = new ClientLogger(WebAppServicePlansOperationsImpl.class); + + private final WebAppServicePlansOperationsClient innerClient; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + public WebAppServicePlansOperationsImpl(WebAppServicePlansOperationsClient innerClient, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WebAppServicePlanV3Impl(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 WebAppServicePlanV3Impl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String servicePlanName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, assessmentName, servicePlanName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WebAppServicePlanV3Impl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WebAppServicePlanV3 get(String resourceGroupName, String projectName, String assessmentName, + String servicePlanName) { + WebAppServicePlanV3Inner inner + = this.serviceClient().get(resourceGroupName, projectName, assessmentName, servicePlanName); + if (inner != null) { + return new WebAppServicePlanV3Impl(inner, this.manager()); + } else { + return null; + } + } + + private WebAppServicePlansOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WepAppGraphAssessmentOptionsImpl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WepAppGraphAssessmentOptionsImpl.java new file mode 100644 index 000000000000..1a653f6555d2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/implementation/WepAppGraphAssessmentOptionsImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.WepAppGraphAssessmentOptionsInner; +import com.azure.resourcemanager.migration.assessment.models.WepAppGraphAssessmentOptions; +import com.azure.resourcemanager.migration.assessment.models.WepAppGraphAssessmentOptionsProperties; + +public final class WepAppGraphAssessmentOptionsImpl implements WepAppGraphAssessmentOptions { + private WepAppGraphAssessmentOptionsInner innerObject; + + private final com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager serviceManager; + + WepAppGraphAssessmentOptionsImpl(WepAppGraphAssessmentOptionsInner innerObject, + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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 WepAppGraphAssessmentOptionsProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public WepAppGraphAssessmentOptionsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessment.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessment.java new file mode 100644 index 000000000000..a3ef7b6c57ab --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessment.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksAssessmentInner; + +/** + * An immutable client-side representation of AksAssessment. + */ +public interface AksAssessment { + /** + * 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. + */ + AksAssessmentProperties 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.migration.assessment.fluent.models.AksAssessmentInner object. + * + * @return the inner object. + */ + AksAssessmentInner innerModel(); + + /** + * The entirety of the AksAssessment definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The AksAssessment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AksAssessment definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the AksAssessment 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 AksAssessment 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. + */ + AksAssessment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AksAssessment create(Context context); + } + + /** + * The stage of the AksAssessment 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(AksAssessmentProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AksAssessment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AksAssessment refresh(Context context); + + /** + * Get URL for downloading AKS Assessment Report. + * + * @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 uRL for downloading AKS Assessment Report. + */ + DownloadUrl downloadUrl(Object body); + + /** + * Get URL for downloading AKS Assessment Report. + * + * @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 uRL for downloading AKS Assessment Report. + */ + DownloadUrl downloadUrl(Object body, Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentListResult.java new file mode 100644 index 000000000000..50bd5a120e3f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AksAssessmentInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AKSAssessment list operation. + */ +@Fluent +public final class AksAssessmentListResult implements JsonSerializable { + /* + * The AKSAssessment items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AksAssessmentListResult class. + */ + public AksAssessmentListResult() { + } + + /** + * Get the value property: The AKSAssessment items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AKSAssessment items on this page. + * + * @param value the value value to set. + * @return the AksAssessmentListResult object itself. + */ + public AksAssessmentListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AksAssessmentListResult object itself. + */ + public AksAssessmentListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 AksAssessmentListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AksAssessmentListResult.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 AksAssessmentListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksAssessmentListResult 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 AksAssessmentListResult. + */ + public static AksAssessmentListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksAssessmentListResult deserializedAksAssessmentListResult = new AksAssessmentListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AksAssessmentInner.fromJson(reader1)); + deserializedAksAssessmentListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAksAssessmentListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAksAssessmentListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentOperations.java new file mode 100644 index 000000000000..d1ec7b184589 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentOperations.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AksAssessmentOperations. + */ +public interface AksAssessmentOperations { + /** + * List AKSAssessment 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 AKSAssessment list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List AKSAssessment 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 AKSAssessment list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSAssessment along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + Context context); + + /** + * Get a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSAssessment. + */ + AksAssessment get(String resourceGroupName, String projectName, String assessmentName); + + /** + * Delete a AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report. + */ + DownloadUrl downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object body); + + /** + * Get URL for downloading AKS Assessment Report. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 uRL for downloading AKS Assessment Report. + */ + DownloadUrl downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object body, + Context context); + + /** + * Get a AKSAssessment. + * + * @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 AKSAssessment along with {@link Response}. + */ + AksAssessment getById(String id); + + /** + * Get a AKSAssessment. + * + * @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 AKSAssessment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a AKSAssessment. + * + * @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 AKSAssessment. + * + * @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 AksAssessment resource. + * + * @param name resource name. + * @return the first stage of the new AksAssessment definition. + */ + AksAssessment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentOptions.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentOptions.java new file mode 100644 index 000000000000..a02120ebd867 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentOptions.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksAssessmentOptionsInner; + +/** + * An immutable client-side representation of AksAssessmentOptions. + */ +public interface AksAssessmentOptions { + /** + * 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. + */ + AksAssessmentOptionsProperties 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.migration.assessment.fluent.models.AksAssessmentOptionsInner object. + * + * @return the inner object. + */ + AksAssessmentOptionsInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentOptionsListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentOptionsListResult.java new file mode 100644 index 000000000000..1e5be22e9a98 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentOptionsListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AksAssessmentOptionsInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AKSAssessmentOptions list operation. + */ +@Fluent +public final class AksAssessmentOptionsListResult implements JsonSerializable { + /* + * The AKSAssessmentOptions items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AksAssessmentOptionsListResult class. + */ + public AksAssessmentOptionsListResult() { + } + + /** + * Get the value property: The AKSAssessmentOptions items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AKSAssessmentOptions items on this page. + * + * @param value the value value to set. + * @return the AksAssessmentOptionsListResult object itself. + */ + public AksAssessmentOptionsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AksAssessmentOptionsListResult object itself. + */ + public AksAssessmentOptionsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 AksAssessmentOptionsListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AksAssessmentOptionsListResult.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 AksAssessmentOptionsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksAssessmentOptionsListResult 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 AksAssessmentOptionsListResult. + */ + public static AksAssessmentOptionsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksAssessmentOptionsListResult deserializedAksAssessmentOptionsListResult + = new AksAssessmentOptionsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AksAssessmentOptionsInner.fromJson(reader1)); + deserializedAksAssessmentOptionsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAksAssessmentOptionsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAksAssessmentOptionsListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentOptionsOutboundEdgeGroup.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentOptionsOutboundEdgeGroup.java new file mode 100644 index 000000000000..a2108d469231 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentOptionsOutboundEdgeGroup.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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. + */ +@Fluent +public final class AksAssessmentOptionsOutboundEdgeGroup + implements JsonSerializable { + /* + * Gets or sets the Azure VM Category. + */ + private List categories; + + /* + * Gets or sets the Consolidation Type. + */ + private List consolidations; + + /* + * Gets or sets the Pricing Tier. + */ + private List tiers; + + /* + * 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; + + /** + * Creates an instance of AksAssessmentOptionsOutboundEdgeGroup class. + */ + public AksAssessmentOptionsOutboundEdgeGroup() { + } + + /** + * Get the categories property: Gets or sets the Azure VM Category. + * + * @return the categories value. + */ + public List categories() { + return this.categories; + } + + /** + * Set the categories property: Gets or sets the Azure VM Category. + * + * @param categories the categories value to set. + * @return the AksAssessmentOptionsOutboundEdgeGroup object itself. + */ + public AksAssessmentOptionsOutboundEdgeGroup withCategories(List categories) { + this.categories = categories; + return this; + } + + /** + * Get the consolidations property: Gets or sets the Consolidation Type. + * + * @return the consolidations value. + */ + public List consolidations() { + return this.consolidations; + } + + /** + * Set the consolidations property: Gets or sets the Consolidation Type. + * + * @param consolidations the consolidations value to set. + * @return the AksAssessmentOptionsOutboundEdgeGroup object itself. + */ + public AksAssessmentOptionsOutboundEdgeGroup withConsolidations(List consolidations) { + this.consolidations = consolidations; + return this; + } + + /** + * Get the tiers property: Gets or sets the Pricing Tier. + * + * @return the tiers value. + */ + public List tiers() { + return this.tiers; + } + + /** + * Set the tiers property: Gets or sets the Pricing Tier. + * + * @param tiers the tiers value to set. + * @return the AksAssessmentOptionsOutboundEdgeGroup object itself. + */ + public AksAssessmentOptionsOutboundEdgeGroup withTiers(List tiers) { + this.tiers = tiers; + return this; + } + + /** + * Get the targetLocations property: Gets or sets the Azure Locations. + * + * @return the targetLocations value. + */ + public List targetLocations() { + return this.targetLocations; + } + + /** + * Set the targetLocations property: Gets or sets the Azure Locations. + * + * @param targetLocations the targetLocations value to set. + * @return the AksAssessmentOptionsOutboundEdgeGroup object itself. + */ + public AksAssessmentOptionsOutboundEdgeGroup withTargetLocations(List targetLocations) { + this.targetLocations = targetLocations; + return this; + } + + /** + * Get the currencies property: Gets or sets the Azure Currency. + * + * @return the currencies value. + */ + public List currencies() { + return this.currencies; + } + + /** + * Set the currencies property: Gets or sets the Azure Currency. + * + * @param currencies the currencies value to set. + * @return the AksAssessmentOptionsOutboundEdgeGroup object itself. + */ + public AksAssessmentOptionsOutboundEdgeGroup withCurrencies(List currencies) { + this.currencies = currencies; + return this; + } + + /** + * Get the savingsOptions property: Gets or sets the Assessment Savings Options. + * + * @return the savingsOptions value. + */ + public List savingsOptions() { + return this.savingsOptions; + } + + /** + * Set the savingsOptions property: Gets or sets the Assessment Savings Options. + * + * @param savingsOptions the savingsOptions value to set. + * @return the AksAssessmentOptionsOutboundEdgeGroup object itself. + */ + public AksAssessmentOptionsOutboundEdgeGroup withSavingsOptions(List savingsOptions) { + this.savingsOptions = savingsOptions; + return this; + } + + /** + * Get the licensingProgram property: Gets or sets the Licensing Program. + * + * @return the licensingProgram value. + */ + public List licensingProgram() { + return this.licensingProgram; + } + + /** + * Set the licensingProgram property: Gets or sets the Licensing Program. + * + * @param licensingProgram the licensingProgram value to set. + * @return the AksAssessmentOptionsOutboundEdgeGroup object itself. + */ + public AksAssessmentOptionsOutboundEdgeGroup withLicensingProgram(List licensingProgram) { + this.licensingProgram = licensingProgram; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (categories() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property categories in model AksAssessmentOptionsOutboundEdgeGroup")); + } + if (consolidations() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property consolidations in model AksAssessmentOptionsOutboundEdgeGroup")); + } + if (tiers() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tiers in model AksAssessmentOptionsOutboundEdgeGroup")); + } + if (targetLocations() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetLocations in model AksAssessmentOptionsOutboundEdgeGroup")); + } + if (currencies() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property currencies in model AksAssessmentOptionsOutboundEdgeGroup")); + } + if (savingsOptions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property savingsOptions in model AksAssessmentOptionsOutboundEdgeGroup")); + } + if (licensingProgram() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property licensingProgram in model AksAssessmentOptionsOutboundEdgeGroup")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AksAssessmentOptionsOutboundEdgeGroup.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("categories", this.categories, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("consolidations", this.consolidations, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("tiers", this.tiers, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + 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())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AksAssessmentOptionsOutboundEdgeGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksAssessmentOptionsOutboundEdgeGroup 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 AksAssessmentOptionsOutboundEdgeGroup. + */ + public static AksAssessmentOptionsOutboundEdgeGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksAssessmentOptionsOutboundEdgeGroup deserializedAksAssessmentOptionsOutboundEdgeGroup + = new AksAssessmentOptionsOutboundEdgeGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("categories".equals(fieldName)) { + List categories + = reader.readArray(reader1 -> AzureVmCategory.fromString(reader1.getString())); + deserializedAksAssessmentOptionsOutboundEdgeGroup.categories = categories; + } else if ("consolidations".equals(fieldName)) { + List consolidations + = reader.readArray(reader1 -> ConsolidationType.fromString(reader1.getString())); + deserializedAksAssessmentOptionsOutboundEdgeGroup.consolidations = consolidations; + } else if ("tiers".equals(fieldName)) { + List tiers = reader.readArray(reader1 -> PricingTier.fromString(reader1.getString())); + deserializedAksAssessmentOptionsOutboundEdgeGroup.tiers = tiers; + } else if ("targetLocations".equals(fieldName)) { + List targetLocations + = reader.readArray(reader1 -> AzureLocation.fromString(reader1.getString())); + deserializedAksAssessmentOptionsOutboundEdgeGroup.targetLocations = targetLocations; + } else if ("currencies".equals(fieldName)) { + List currencies + = reader.readArray(reader1 -> AzureCurrency.fromString(reader1.getString())); + deserializedAksAssessmentOptionsOutboundEdgeGroup.currencies = currencies; + } else if ("savingsOptions".equals(fieldName)) { + List savingsOptions + = reader.readArray(reader1 -> SavingsOptions.fromString(reader1.getString())); + deserializedAksAssessmentOptionsOutboundEdgeGroup.savingsOptions = savingsOptions; + } else if ("licensingProgram".equals(fieldName)) { + List licensingProgram + = reader.readArray(reader1 -> LicensingProgram.fromString(reader1.getString())); + deserializedAksAssessmentOptionsOutboundEdgeGroup.licensingProgram = licensingProgram; + } else { + reader.skipChildren(); + } + } + + return deserializedAksAssessmentOptionsOutboundEdgeGroup; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentOptionsProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentOptionsProperties.java new file mode 100644 index 000000000000..afa7163c2032 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentOptionsProperties.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.Map; + +/** + * AKS Assessment Options Properties. + */ +@Immutable +public final class AksAssessmentOptionsProperties implements JsonSerializable { + /* + * Gets the mapping of Assessment Options in graph representation. + */ + private Map edges; + + /** + * Creates an instance of AksAssessmentOptionsProperties class. + */ + public AksAssessmentOptionsProperties() { + } + + /** + * Get the edges property: Gets the mapping of Assessment Options in graph representation. + * + * @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) { + edges().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AksAssessmentOptionsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksAssessmentOptionsProperties 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 AksAssessmentOptionsProperties. + */ + public static AksAssessmentOptionsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksAssessmentOptionsProperties deserializedAksAssessmentOptionsProperties + = new AksAssessmentOptionsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("edges".equals(fieldName)) { + Map edges + = reader.readMap(reader1 -> AksAssessmentOptionsOutboundEdgeGroup.fromJson(reader1)); + deserializedAksAssessmentOptionsProperties.edges = edges; + } else { + reader.skipChildren(); + } + } + + return deserializedAksAssessmentOptionsProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentProperties.java new file mode 100644 index 000000000000..a917ff93806f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentProperties.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * AKS Assessment Properties. + */ +@Fluent +public final class AksAssessmentProperties 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 AksAssessmentSettings settings; + + /* + * Gets or sets the details of the assessment. + */ + private AssessmentDetails details; + + /** + * Creates an instance of AksAssessmentProperties class. + */ + public AksAssessmentProperties() { + } + + /** + * 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 AksAssessmentProperties object itself. + */ + public AksAssessmentProperties 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 AksAssessmentSettings 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 AksAssessmentProperties object itself. + */ + public AksAssessmentProperties withSettings(AksAssessmentSettings 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 AksAssessmentProperties object itself. + */ + public AksAssessmentProperties 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 AksAssessmentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksAssessmentProperties 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 AksAssessmentProperties. + */ + public static AksAssessmentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksAssessmentProperties deserializedAksAssessmentProperties = new AksAssessmentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedAksAssessmentProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("scope".equals(fieldName)) { + deserializedAksAssessmentProperties.scope = Scope.fromJson(reader); + } else if ("settings".equals(fieldName)) { + deserializedAksAssessmentProperties.settings = AksAssessmentSettings.fromJson(reader); + } else if ("details".equals(fieldName)) { + deserializedAksAssessmentProperties.details = AssessmentDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAksAssessmentProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentSettings.java new file mode 100644 index 000000000000..785fe67c23b9 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksAssessmentSettings.java @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Data model of AKS Assessment Settings. + */ +@Fluent +public final class AksAssessmentSettings 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 Float scalingFactor; + + /* + * Custom discount percentage. + */ + private Float 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; + + /* + * Gets or sets azure VM category. + */ + private AzureVmCategory category; + + /* + * Gets or sets consolidation type. + */ + private ConsolidationType consolidation; + + /* + * Gets or sets pricing tier. + */ + private PricingTier pricingTier; + + /** + * Creates an instance of AksAssessmentSettings class. + */ + public AksAssessmentSettings() { + } + + /** + * 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 AksAssessmentSettings object itself. + */ + public AksAssessmentSettings 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 AksAssessmentSettings object itself. + */ + public AksAssessmentSettings 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 Float 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 AksAssessmentSettings object itself. + */ + public AksAssessmentSettings withScalingFactor(Float scalingFactor) { + this.scalingFactor = scalingFactor; + return this; + } + + /** + * Get the discountPercentage property: Custom discount percentage. + * + * @return the discountPercentage value. + */ + public Float discountPercentage() { + return this.discountPercentage; + } + + /** + * Set the discountPercentage property: Custom discount percentage. + * + * @param discountPercentage the discountPercentage value to set. + * @return the AksAssessmentSettings object itself. + */ + public AksAssessmentSettings withDiscountPercentage(Float 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 AksAssessmentSettings object itself. + */ + public AksAssessmentSettings 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 AksAssessmentSettings object itself. + */ + public AksAssessmentSettings 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 AksAssessmentSettings object itself. + */ + public AksAssessmentSettings 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 AksAssessmentSettings object itself. + */ + public AksAssessmentSettings 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 AksAssessmentSettings object itself. + */ + public AksAssessmentSettings withEnvironmentType(EnvironmentType environmentType) { + this.environmentType = environmentType; + return this; + } + + /** + * Get the category property: Gets or sets azure VM category. + * + * @return the category value. + */ + public AzureVmCategory category() { + return this.category; + } + + /** + * Set the category property: Gets or sets azure VM category. + * + * @param category the category value to set. + * @return the AksAssessmentSettings object itself. + */ + public AksAssessmentSettings withCategory(AzureVmCategory category) { + this.category = category; + return this; + } + + /** + * Get the consolidation property: Gets or sets consolidation type. + * + * @return the consolidation value. + */ + public ConsolidationType consolidation() { + return this.consolidation; + } + + /** + * Set the consolidation property: Gets or sets consolidation type. + * + * @param consolidation the consolidation value to set. + * @return the AksAssessmentSettings object itself. + */ + public AksAssessmentSettings withConsolidation(ConsolidationType consolidation) { + this.consolidation = consolidation; + return this; + } + + /** + * Get the pricingTier property: Gets or sets pricing tier. + * + * @return the pricingTier value. + */ + public PricingTier pricingTier() { + return this.pricingTier; + } + + /** + * Set the pricingTier property: Gets or sets pricing tier. + * + * @param pricingTier the pricingTier value to set. + * @return the AksAssessmentSettings object itself. + */ + public AksAssessmentSettings withPricingTier(PricingTier pricingTier) { + this.pricingTier = pricingTier; + 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 (category() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property category in model AksAssessmentSettings")); + } + if (consolidation() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property consolidation in model AksAssessmentSettings")); + } + if (pricingTier() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property pricingTier in model AksAssessmentSettings")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AksAssessmentSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category == null ? null : this.category.toString()); + jsonWriter.writeStringField("consolidation", this.consolidation == null ? null : this.consolidation.toString()); + jsonWriter.writeStringField("pricingTier", this.pricingTier == null ? null : this.pricingTier.toString()); + 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()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AksAssessmentSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksAssessmentSettings 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 AksAssessmentSettings. + */ + public static AksAssessmentSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksAssessmentSettings deserializedAksAssessmentSettings = new AksAssessmentSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedAksAssessmentSettings.category = AzureVmCategory.fromString(reader.getString()); + } else if ("consolidation".equals(fieldName)) { + deserializedAksAssessmentSettings.consolidation = ConsolidationType.fromString(reader.getString()); + } else if ("pricingTier".equals(fieldName)) { + deserializedAksAssessmentSettings.pricingTier = PricingTier.fromString(reader.getString()); + } else if ("azureLocation".equals(fieldName)) { + deserializedAksAssessmentSettings.azureLocation = reader.getString(); + } else if ("currency".equals(fieldName)) { + deserializedAksAssessmentSettings.currency = AzureCurrency.fromString(reader.getString()); + } else if ("scalingFactor".equals(fieldName)) { + deserializedAksAssessmentSettings.scalingFactor = reader.getNullable(JsonReader::getFloat); + } else if ("discountPercentage".equals(fieldName)) { + deserializedAksAssessmentSettings.discountPercentage = reader.getNullable(JsonReader::getFloat); + } else if ("sizingCriterion".equals(fieldName)) { + deserializedAksAssessmentSettings.sizingCriterion + = AssessmentSizingCriterion.fromString(reader.getString()); + } else if ("performanceData".equals(fieldName)) { + deserializedAksAssessmentSettings.performanceData = PerformanceData.fromJson(reader); + } else if ("savingsSettings".equals(fieldName)) { + deserializedAksAssessmentSettings.savingsSettings = SavingsSettings.fromJson(reader); + } else if ("billingSettings".equals(fieldName)) { + deserializedAksAssessmentSettings.billingSettings = BillingSettings.fromJson(reader); + } else if ("environmentType".equals(fieldName)) { + deserializedAksAssessmentSettings.environmentType = EnvironmentType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAksAssessmentSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksCluster.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksCluster.java new file mode 100644 index 000000000000..3f386db69da3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksCluster.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksClusterInner; + +/** + * An immutable client-side representation of AksCluster. + */ +public interface AksCluster { + /** + * 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. + */ + AksClusterProperties 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.migration.assessment.fluent.models.AksClusterInner object. + * + * @return the inner object. + */ + AksClusterInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksClusterListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksClusterListResult.java new file mode 100644 index 000000000000..fb78c81ea73e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksClusterListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AksClusterInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AKSCluster list operation. + */ +@Fluent +public final class AksClusterListResult implements JsonSerializable { + /* + * The AKSCluster items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AksClusterListResult class. + */ + public AksClusterListResult() { + } + + /** + * Get the value property: The AKSCluster items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AKSCluster items on this page. + * + * @param value the value value to set. + * @return the AksClusterListResult object itself. + */ + public AksClusterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AksClusterListResult object itself. + */ + public AksClusterListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 AksClusterListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AksClusterListResult.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 AksClusterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksClusterListResult 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 AksClusterListResult. + */ + public static AksClusterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksClusterListResult deserializedAksClusterListResult = new AksClusterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AksClusterInner.fromJson(reader1)); + deserializedAksClusterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAksClusterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAksClusterListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksClusterOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksClusterOperations.java new file mode 100644 index 000000000000..4368c8b3484e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksClusterOperations.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AksClusterOperations. + */ +public interface AksClusterOperations { + /** + * List AKSCluster resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName); + + /** + * List AKSCluster resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName, + Context context); + + /** + * Get a AKSCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param clusterName AKS Cluster 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 AKSCluster along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + String clusterName, Context context); + + /** + * Get a AKSCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param clusterName AKS Cluster 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 AKSCluster. + */ + AksCluster get(String resourceGroupName, String projectName, String assessmentName, String clusterName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksClusterProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksClusterProperties.java new file mode 100644 index 000000000000..043cacd19e33 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksClusterProperties.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * ARM model of AKS Cluster Properties. + */ +@Immutable +public final class AksClusterProperties implements JsonSerializable { + /* + * Gets list of node pools. + */ + private List nodePools; + + /* + * Gets region. + */ + private String region; + + /* + * Gets user node pool count. + */ + private int userNodePoolCount; + + /* + * Gets user node count. + */ + private int userNodeCount; + + /* + * Gets system node pool count. + */ + private int systemNodePoolCount; + + /* + * Gets system node count. + */ + private int systemNodeCount; + + /* + * Gets pod count. + */ + private int podCount; + + /* + * Gets monthly cost. + */ + private float monthlyCost; + + /** + * Creates an instance of AksClusterProperties class. + */ + public AksClusterProperties() { + } + + /** + * Get the nodePools property: Gets list of node pools. + * + * @return the nodePools value. + */ + public List nodePools() { + return this.nodePools; + } + + /** + * Get the region property: Gets region. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Get the userNodePoolCount property: Gets user node pool count. + * + * @return the userNodePoolCount value. + */ + public int userNodePoolCount() { + return this.userNodePoolCount; + } + + /** + * Get the userNodeCount property: Gets user node count. + * + * @return the userNodeCount value. + */ + public int userNodeCount() { + return this.userNodeCount; + } + + /** + * Get the systemNodePoolCount property: Gets system node pool count. + * + * @return the systemNodePoolCount value. + */ + public int systemNodePoolCount() { + return this.systemNodePoolCount; + } + + /** + * Get the systemNodeCount property: Gets system node count. + * + * @return the systemNodeCount value. + */ + public int systemNodeCount() { + return this.systemNodeCount; + } + + /** + * Get the podCount property: Gets pod count. + * + * @return the podCount value. + */ + public int podCount() { + return this.podCount; + } + + /** + * Get the monthlyCost property: Gets monthly cost. + * + * @return the monthlyCost value. + */ + public float monthlyCost() { + return this.monthlyCost; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nodePools() != null) { + nodePools().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AksClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksClusterProperties 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 AksClusterProperties. + */ + public static AksClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksClusterProperties deserializedAksClusterProperties = new AksClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodePools".equals(fieldName)) { + List nodePools = reader.readArray(reader1 -> NodePool.fromJson(reader1)); + deserializedAksClusterProperties.nodePools = nodePools; + } else if ("region".equals(fieldName)) { + deserializedAksClusterProperties.region = reader.getString(); + } else if ("userNodePoolCount".equals(fieldName)) { + deserializedAksClusterProperties.userNodePoolCount = reader.getInt(); + } else if ("userNodeCount".equals(fieldName)) { + deserializedAksClusterProperties.userNodeCount = reader.getInt(); + } else if ("systemNodePoolCount".equals(fieldName)) { + deserializedAksClusterProperties.systemNodePoolCount = reader.getInt(); + } else if ("systemNodeCount".equals(fieldName)) { + deserializedAksClusterProperties.systemNodeCount = reader.getInt(); + } else if ("podCount".equals(fieldName)) { + deserializedAksClusterProperties.podCount = reader.getInt(); + } else if ("monthlyCost".equals(fieldName)) { + deserializedAksClusterProperties.monthlyCost = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedAksClusterProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksCostDetail.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksCostDetail.java new file mode 100644 index 000000000000..c1879ecf9f63 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksCostDetail.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksCostDetailInner; + +/** + * An immutable client-side representation of AksCostDetail. + */ +public interface AksCostDetail { + /** + * 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. + */ + AksCostDetailProperties 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.migration.assessment.fluent.models.AksCostDetailInner object. + * + * @return the inner object. + */ + AksCostDetailInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksCostDetailListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksCostDetailListResult.java new file mode 100644 index 000000000000..244ce0f2eb60 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksCostDetailListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AksCostDetailInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AKSCostDetail list operation. + */ +@Fluent +public final class AksCostDetailListResult implements JsonSerializable { + /* + * The AKSCostDetail items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AksCostDetailListResult class. + */ + public AksCostDetailListResult() { + } + + /** + * Get the value property: The AKSCostDetail items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AKSCostDetail items on this page. + * + * @param value the value value to set. + * @return the AksCostDetailListResult object itself. + */ + public AksCostDetailListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AksCostDetailListResult object itself. + */ + public AksCostDetailListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 AksCostDetailListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AksCostDetailListResult.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 AksCostDetailListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksCostDetailListResult 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 AksCostDetailListResult. + */ + public static AksCostDetailListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksCostDetailListResult deserializedAksCostDetailListResult = new AksCostDetailListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AksCostDetailInner.fromJson(reader1)); + deserializedAksCostDetailListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAksCostDetailListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAksCostDetailListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksCostDetailOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksCostDetailOperations.java new file mode 100644 index 000000000000..74137a5ed759 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksCostDetailOperations.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of AksCostDetailOperations. + */ +public interface AksCostDetailOperations { + /** + * List AKSCostDetail resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCostDetail list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName); + + /** + * List AKSCostDetail resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSCostDetail list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName, + Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksCostDetailProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksCostDetailProperties.java new file mode 100644 index 000000000000..1b8d3667afed --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksCostDetailProperties.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * ARM model of AKS Cost Detail Properties. + */ +@Immutable +public final class AksCostDetailProperties implements JsonSerializable { + /* + * Gets id. + */ + private String id; + + /* + * Gets name. + */ + private String name; + + /* + * Gets cluster name. + */ + private String clusterName; + + /* + * Gets mode. + */ + private NodePoolMode mode; + + /* + * Gets os type. + */ + private OSType osType; + + /* + * Gets arm sku name. + */ + private String armSkuName; + + /* + * Gets node count. + */ + private int nodeCount; + + /* + * Gets pod count. + */ + private int podCount; + + /* + * Gets monthly cost. + */ + private float monthlyCost; + + /* + * Gets pod approximate monthly cost. + */ + private float podApproxMonthlyCost; + + /** + * Creates an instance of AksCostDetailProperties class. + */ + public AksCostDetailProperties() { + } + + /** + * Get the id property: Gets id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Gets name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the clusterName property: Gets cluster name. + * + * @return the clusterName value. + */ + public String clusterName() { + return this.clusterName; + } + + /** + * Get the mode property: Gets mode. + * + * @return the mode value. + */ + public NodePoolMode mode() { + return this.mode; + } + + /** + * Get the osType property: Gets os type. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + + /** + * Get the armSkuName property: Gets arm sku name. + * + * @return the armSkuName value. + */ + public String armSkuName() { + return this.armSkuName; + } + + /** + * Get the nodeCount property: Gets node count. + * + * @return the nodeCount value. + */ + public int nodeCount() { + return this.nodeCount; + } + + /** + * Get the podCount property: Gets pod count. + * + * @return the podCount value. + */ + public int podCount() { + return this.podCount; + } + + /** + * Get the monthlyCost property: Gets monthly cost. + * + * @return the monthlyCost value. + */ + public float monthlyCost() { + return this.monthlyCost; + } + + /** + * Get the podApproxMonthlyCost property: Gets pod approximate monthly cost. + * + * @return the podApproxMonthlyCost value. + */ + public float podApproxMonthlyCost() { + return this.podApproxMonthlyCost; + } + + /** + * 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 AksCostDetailProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksCostDetailProperties 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 AksCostDetailProperties. + */ + public static AksCostDetailProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksCostDetailProperties deserializedAksCostDetailProperties = new AksCostDetailProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAksCostDetailProperties.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAksCostDetailProperties.name = reader.getString(); + } else if ("clusterName".equals(fieldName)) { + deserializedAksCostDetailProperties.clusterName = reader.getString(); + } else if ("mode".equals(fieldName)) { + deserializedAksCostDetailProperties.mode = NodePoolMode.fromString(reader.getString()); + } else if ("osType".equals(fieldName)) { + deserializedAksCostDetailProperties.osType = OSType.fromString(reader.getString()); + } else if ("armSkuName".equals(fieldName)) { + deserializedAksCostDetailProperties.armSkuName = reader.getString(); + } else if ("nodeCount".equals(fieldName)) { + deserializedAksCostDetailProperties.nodeCount = reader.getInt(); + } else if ("podCount".equals(fieldName)) { + deserializedAksCostDetailProperties.podCount = reader.getInt(); + } else if ("monthlyCost".equals(fieldName)) { + deserializedAksCostDetailProperties.monthlyCost = reader.getFloat(); + } else if ("podApproxMonthlyCost".equals(fieldName)) { + deserializedAksCostDetailProperties.podApproxMonthlyCost = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedAksCostDetailProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksOptionsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksOptionsOperations.java new file mode 100644 index 000000000000..6a141ad87f80 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksOptionsOperations.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AksOptionsOperations. + */ +public interface AksOptionsOperations { + /** + * List AKSAssessmentOptions 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 AKSAssessmentOptions list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List AKSAssessmentOptions 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 AKSAssessmentOptions list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a AKSAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentOptionsName AKS Assessment Options 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 AKSAssessmentOptions along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentOptionsName, Context context); + + /** + * Get a AKSAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentOptionsName AKS Assessment Options 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 AKSAssessmentOptions. + */ + AksAssessmentOptions get(String resourceGroupName, String projectName, String assessmentOptionsName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksSummary.java new file mode 100644 index 000000000000..10930938d7e4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksSummary.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AksSummaryInner; + +/** + * An immutable client-side representation of AksSummary. + */ +public interface AksSummary { + /** + * 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. + */ + AksSummaryProperties 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.migration.assessment.fluent.models.AksSummaryInner object. + * + * @return the inner object. + */ + AksSummaryInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksSummaryListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksSummaryListResult.java new file mode 100644 index 000000000000..3c547bd4eabf --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksSummaryListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AksSummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AKSSummary list operation. + */ +@Fluent +public final class AksSummaryListResult implements JsonSerializable { + /* + * The AKSSummary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AksSummaryListResult class. + */ + public AksSummaryListResult() { + } + + /** + * Get the value property: The AKSSummary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AKSSummary items on this page. + * + * @param value the value value to set. + * @return the AksSummaryListResult object itself. + */ + public AksSummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AksSummaryListResult object itself. + */ + public AksSummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 AksSummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AksSummaryListResult.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 AksSummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksSummaryListResult 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 AksSummaryListResult. + */ + public static AksSummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksSummaryListResult deserializedAksSummaryListResult = new AksSummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AksSummaryInner.fromJson(reader1)); + deserializedAksSummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAksSummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAksSummaryListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksSummaryOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksSummaryOperations.java new file mode 100644 index 000000000000..9cd7c7be15b7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksSummaryOperations.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AksSummaryOperations. + */ +public interface AksSummaryOperations { + /** + * List AKSSummary resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName); + + /** + * List AKSSummary resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AKSSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName, + Context context); + + /** + * Get a AKSSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param summaryName AKS Assessment Summary 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 AKSSummary along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + String summaryName, Context context); + + /** + * Get a AKSSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param summaryName AKS Assessment Summary 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 AKSSummary. + */ + AksSummary get(String resourceGroupName, String projectName, String assessmentName, String summaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksSummaryProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksSummaryProperties.java new file mode 100644 index 000000000000..257e04a49f10 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AksSummaryProperties.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * AKS Summary Properties. + */ +@Immutable +public final class AksSummaryProperties 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; + + /* + * Gets the number of web apps. + */ + private int webAppCount; + + /* + * Gets the number of web servers. + */ + private int webServerCount; + + /* + * Gets the number of machines. + */ + private int machineCount; + + /** + * Creates an instance of AksSummaryProperties class. + */ + public AksSummaryProperties() { + } + + /** + * 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; + } + + /** + * Get the webAppCount property: Gets the number of web apps. + * + * @return the webAppCount value. + */ + public int webAppCount() { + return this.webAppCount; + } + + /** + * Get the webServerCount property: Gets the number of web servers. + * + * @return the webServerCount value. + */ + public int webServerCount() { + return this.webServerCount; + } + + /** + * Get the machineCount property: Gets the number of machines. + * + * @return the machineCount value. + */ + public int machineCount() { + return this.machineCount; + } + + /** + * 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 AksSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksSummaryProperties 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 AksSummaryProperties. + */ + public static AksSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksSummaryProperties deserializedAksSummaryProperties = new AksSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("webAppCount".equals(fieldName)) { + deserializedAksSummaryProperties.webAppCount = reader.getInt(); + } else if ("webServerCount".equals(fieldName)) { + deserializedAksSummaryProperties.webServerCount = reader.getInt(); + } else if ("machineCount".equals(fieldName)) { + deserializedAksSummaryProperties.machineCount = reader.getInt(); + } else if ("summaryType".equals(fieldName)) { + deserializedAksSummaryProperties.summaryType = SummaryType.fromString(reader.getString()); + } else if ("summaryName".equals(fieldName)) { + deserializedAksSummaryProperties.summaryName = reader.getString(); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> SourceDetails.fromJson(reader1)); + deserializedAksSummaryProperties.sources = sources; + } else if ("targets".equals(fieldName)) { + List targets = reader.readArray(reader1 -> TargetDetails.fromJson(reader1)); + deserializedAksSummaryProperties.targets = targets; + } else if ("targetSourceMapping".equals(fieldName)) { + List targetSourceMapping + = reader.readArray(reader1 -> TargetSourcePair.fromJson(reader1)); + deserializedAksSummaryProperties.targetSourceMapping = targetSourceMapping; + } else if ("costComponents".equals(fieldName)) { + List costComponents + = reader.readArray(reader1 -> CostDetailsCommon.fromJson(reader1)); + deserializedAksSummaryProperties.costComponents = costComponents; + } else if ("savingsComponents".equals(fieldName)) { + List savingsComponents + = reader.readArray(reader1 -> SavingsDetailsCommon.fromJson(reader1)); + deserializedAksSummaryProperties.savingsComponents = savingsComponents; + } else { + reader.skipChildren(); + } + } + + return deserializedAksSummaryProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AppServiceSku.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AppServiceSku.java new file mode 100644 index 000000000000..7152c6689cc7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AppServiceSku.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 app service SKU with corresponding cost. + */ +@Immutable +public final class AppServiceSku implements JsonSerializable { + /* + * The SKU name. + */ + private String skuName; + + /* + * The cost details. + */ + private Float cost; + + /* + * The number of service plans recommended. + */ + private Integer count; + + /** + * Creates an instance of AppServiceSku class. + */ + public AppServiceSku() { + } + + /** + * Get the skuName property: The SKU name. + * + * @return the skuName value. + */ + public String skuName() { + return this.skuName; + } + + /** + * Get the cost property: The cost details. + * + * @return the cost value. + */ + public Float cost() { + return this.cost; + } + + /** + * Get the count property: The number of service plans recommended. + * + * @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 AppServiceSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppServiceSku 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 AppServiceSku. + */ + public static AppServiceSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppServiceSku deserializedAppServiceSku = new AppServiceSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("skuName".equals(fieldName)) { + deserializedAppServiceSku.skuName = reader.getString(); + } else if ("cost".equals(fieldName)) { + deserializedAppServiceSku.cost = reader.getNullable(JsonReader::getFloat); + } else if ("count".equals(fieldName)) { + deserializedAppServiceSku.count = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAppServiceSku; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AppSvcContainerSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AppSvcContainerSettings.java new file mode 100644 index 000000000000..d4d6b6165d56 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AppSvcContainerSettings.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * App service container settings. + */ +@Fluent +public final class AppSvcContainerSettings implements JsonSerializable { + /* + * Gets or sets the isolation required. + */ + private boolean isolationRequired; + + /** + * Creates an instance of AppSvcContainerSettings class. + */ + public AppSvcContainerSettings() { + } + + /** + * Get the isolationRequired property: Gets or sets the isolation required. + * + * @return the isolationRequired value. + */ + public boolean isolationRequired() { + return this.isolationRequired; + } + + /** + * Set the isolationRequired property: Gets or sets the isolation required. + * + * @param isolationRequired the isolationRequired value to set. + * @return the AppSvcContainerSettings object itself. + */ + public AppSvcContainerSettings withIsolationRequired(boolean isolationRequired) { + this.isolationRequired = isolationRequired; + 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.writeBooleanField("isolationRequired", this.isolationRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppSvcContainerSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppSvcContainerSettings 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 AppSvcContainerSettings. + */ + public static AppSvcContainerSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppSvcContainerSettings deserializedAppSvcContainerSettings = new AppSvcContainerSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isolationRequired".equals(fieldName)) { + deserializedAppSvcContainerSettings.isolationRequired = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedAppSvcContainerSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AppSvcNativeSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AppSvcNativeSettings.java new file mode 100644 index 000000000000..099759286f9c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AppSvcNativeSettings.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * App service native settings. + */ +@Fluent +public final class AppSvcNativeSettings implements JsonSerializable { + /* + * Gets or sets the isolation required. + */ + private boolean isolationRequired; + + /** + * Creates an instance of AppSvcNativeSettings class. + */ + public AppSvcNativeSettings() { + } + + /** + * Get the isolationRequired property: Gets or sets the isolation required. + * + * @return the isolationRequired value. + */ + public boolean isolationRequired() { + return this.isolationRequired; + } + + /** + * Set the isolationRequired property: Gets or sets the isolation required. + * + * @param isolationRequired the isolationRequired value to set. + * @return the AppSvcNativeSettings object itself. + */ + public AppSvcNativeSettings withIsolationRequired(boolean isolationRequired) { + this.isolationRequired = isolationRequired; + 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.writeBooleanField("isolationRequired", this.isolationRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppSvcNativeSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppSvcNativeSettings 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 AppSvcNativeSettings. + */ + public static AppSvcNativeSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppSvcNativeSettings deserializedAppSvcNativeSettings = new AppSvcNativeSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isolationRequired".equals(fieldName)) { + deserializedAppSvcNativeSettings.isolationRequired = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedAppSvcNativeSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedDisk.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedDisk.java deleted file mode 100644 index 3002c537d50a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedDisk.java +++ /dev/null @@ -1,520 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * The AssessedDisk model. - */ -@Fluent -public final class AssessedDisk implements JsonSerializable { - /* - * Gets the suitability. - */ - private CloudSuitability suitability; - - /* - * Gets the suitability explanation. - */ - private AzureDiskSuitabilityExplanation suitabilityExplanation; - - /* - * Gets the suitability detail. - */ - private AzureDiskSuitabilityDetail suitabilityDetail; - - /* - * Gets the recommended disk size. - */ - private AzureDiskSize recommendedDiskSize; - - /* - * Gets the recommended disk type. - */ - private AzureDiskType recommendedDiskType; - - /* - * Gets the recommended disk size. - */ - private Integer gigabytesForRecommendedDiskSize; - - /* - * Gets the recommended disk throughput. - */ - private Float recommendDiskThroughputInMbps; - - /* - * Gets the recommended disk iops. - */ - private Float recommendedDiskIops; - - /* - * Gets the monthly storage cost. - */ - private Float monthlyStorageCost; - - /* - * Gets the name. - */ - private String name; - - /* - * Gets the machine display name. - */ - private String displayName; - - /* - * Gets the gigabytes provisioned. - */ - private Float gigabytesProvisioned; - - /* - * Gets the megabytes per second of read. - */ - private Float megabytesPerSecondOfRead; - - /* - * Gets the megabytes per second of write. - */ - private Float megabytesPerSecondOfWrite; - - /* - * Gets the number of read operations per second. - */ - private Float numberOfReadOperationsPerSecond; - - /* - * Gets the number of write operations per second. - */ - private Float numberOfWriteOperationsPerSecond; - - /** - * Creates an instance of AssessedDisk class. - */ - public AssessedDisk() { - } - - /** - * Get the suitability property: Gets the suitability. - * - * @return the suitability value. - */ - public CloudSuitability suitability() { - return this.suitability; - } - - /** - * Set the suitability property: Gets the suitability. - * - * @param suitability the suitability value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withSuitability(CloudSuitability suitability) { - this.suitability = suitability; - return this; - } - - /** - * Get the suitabilityExplanation property: Gets the suitability explanation. - * - * @return the suitabilityExplanation value. - */ - public AzureDiskSuitabilityExplanation suitabilityExplanation() { - return this.suitabilityExplanation; - } - - /** - * Set the suitabilityExplanation property: Gets the suitability explanation. - * - * @param suitabilityExplanation the suitabilityExplanation value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withSuitabilityExplanation(AzureDiskSuitabilityExplanation suitabilityExplanation) { - this.suitabilityExplanation = suitabilityExplanation; - return this; - } - - /** - * Get the suitabilityDetail property: Gets the suitability detail. - * - * @return the suitabilityDetail value. - */ - public AzureDiskSuitabilityDetail suitabilityDetail() { - return this.suitabilityDetail; - } - - /** - * Set the suitabilityDetail property: Gets the suitability detail. - * - * @param suitabilityDetail the suitabilityDetail value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withSuitabilityDetail(AzureDiskSuitabilityDetail suitabilityDetail) { - this.suitabilityDetail = suitabilityDetail; - return this; - } - - /** - * Get the recommendedDiskSize property: Gets the recommended disk size. - * - * @return the recommendedDiskSize value. - */ - public AzureDiskSize recommendedDiskSize() { - return this.recommendedDiskSize; - } - - /** - * Set the recommendedDiskSize property: Gets the recommended disk size. - * - * @param recommendedDiskSize the recommendedDiskSize value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withRecommendedDiskSize(AzureDiskSize recommendedDiskSize) { - this.recommendedDiskSize = recommendedDiskSize; - return this; - } - - /** - * Get the recommendedDiskType property: Gets the recommended disk type. - * - * @return the recommendedDiskType value. - */ - public AzureDiskType recommendedDiskType() { - return this.recommendedDiskType; - } - - /** - * Set the recommendedDiskType property: Gets the recommended disk type. - * - * @param recommendedDiskType the recommendedDiskType value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withRecommendedDiskType(AzureDiskType recommendedDiskType) { - this.recommendedDiskType = recommendedDiskType; - return this; - } - - /** - * Get the gigabytesForRecommendedDiskSize property: Gets the recommended disk size. - * - * @return the gigabytesForRecommendedDiskSize value. - */ - public Integer gigabytesForRecommendedDiskSize() { - return this.gigabytesForRecommendedDiskSize; - } - - /** - * Set the gigabytesForRecommendedDiskSize property: Gets the recommended disk size. - * - * @param gigabytesForRecommendedDiskSize the gigabytesForRecommendedDiskSize value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withGigabytesForRecommendedDiskSize(Integer gigabytesForRecommendedDiskSize) { - this.gigabytesForRecommendedDiskSize = gigabytesForRecommendedDiskSize; - return this; - } - - /** - * Get the recommendDiskThroughputInMbps property: Gets the recommended disk throughput. - * - * @return the recommendDiskThroughputInMbps value. - */ - public Float recommendDiskThroughputInMbps() { - return this.recommendDiskThroughputInMbps; - } - - /** - * Set the recommendDiskThroughputInMbps property: Gets the recommended disk throughput. - * - * @param recommendDiskThroughputInMbps the recommendDiskThroughputInMbps value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withRecommendDiskThroughputInMbps(Float recommendDiskThroughputInMbps) { - this.recommendDiskThroughputInMbps = recommendDiskThroughputInMbps; - return this; - } - - /** - * Get the recommendedDiskIops property: Gets the recommended disk iops. - * - * @return the recommendedDiskIops value. - */ - public Float recommendedDiskIops() { - return this.recommendedDiskIops; - } - - /** - * Set the recommendedDiskIops property: Gets the recommended disk iops. - * - * @param recommendedDiskIops the recommendedDiskIops value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withRecommendedDiskIops(Float recommendedDiskIops) { - this.recommendedDiskIops = recommendedDiskIops; - return this; - } - - /** - * Get the monthlyStorageCost property: Gets the monthly storage cost. - * - * @return the monthlyStorageCost value. - */ - public Float monthlyStorageCost() { - return this.monthlyStorageCost; - } - - /** - * Set the monthlyStorageCost property: Gets the monthly storage cost. - * - * @param monthlyStorageCost the monthlyStorageCost value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withMonthlyStorageCost(Float monthlyStorageCost) { - this.monthlyStorageCost = monthlyStorageCost; - return this; - } - - /** - * Get the name property: Gets the name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets the name. - * - * @param name the name value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: Gets the machine display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Gets the machine display name. - * - * @param displayName the displayName value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the gigabytesProvisioned property: Gets the gigabytes provisioned. - * - * @return the gigabytesProvisioned value. - */ - public Float gigabytesProvisioned() { - return this.gigabytesProvisioned; - } - - /** - * Set the gigabytesProvisioned property: Gets the gigabytes provisioned. - * - * @param gigabytesProvisioned the gigabytesProvisioned value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withGigabytesProvisioned(Float gigabytesProvisioned) { - this.gigabytesProvisioned = gigabytesProvisioned; - return this; - } - - /** - * Get the megabytesPerSecondOfRead property: Gets the megabytes per second of read. - * - * @return the megabytesPerSecondOfRead value. - */ - public Float megabytesPerSecondOfRead() { - return this.megabytesPerSecondOfRead; - } - - /** - * Set the megabytesPerSecondOfRead property: Gets the megabytes per second of read. - * - * @param megabytesPerSecondOfRead the megabytesPerSecondOfRead value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withMegabytesPerSecondOfRead(Float megabytesPerSecondOfRead) { - this.megabytesPerSecondOfRead = megabytesPerSecondOfRead; - return this; - } - - /** - * Get the megabytesPerSecondOfWrite property: Gets the megabytes per second of write. - * - * @return the megabytesPerSecondOfWrite value. - */ - public Float megabytesPerSecondOfWrite() { - return this.megabytesPerSecondOfWrite; - } - - /** - * Set the megabytesPerSecondOfWrite property: Gets the megabytes per second of write. - * - * @param megabytesPerSecondOfWrite the megabytesPerSecondOfWrite value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withMegabytesPerSecondOfWrite(Float megabytesPerSecondOfWrite) { - this.megabytesPerSecondOfWrite = megabytesPerSecondOfWrite; - return this; - } - - /** - * Get the numberOfReadOperationsPerSecond property: Gets the number of read operations per second. - * - * @return the numberOfReadOperationsPerSecond value. - */ - public Float numberOfReadOperationsPerSecond() { - return this.numberOfReadOperationsPerSecond; - } - - /** - * Set the numberOfReadOperationsPerSecond property: Gets the number of read operations per second. - * - * @param numberOfReadOperationsPerSecond the numberOfReadOperationsPerSecond value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withNumberOfReadOperationsPerSecond(Float numberOfReadOperationsPerSecond) { - this.numberOfReadOperationsPerSecond = numberOfReadOperationsPerSecond; - return this; - } - - /** - * Get the numberOfWriteOperationsPerSecond property: Gets the number of write operations per second. - * - * @return the numberOfWriteOperationsPerSecond value. - */ - public Float numberOfWriteOperationsPerSecond() { - return this.numberOfWriteOperationsPerSecond; - } - - /** - * Set the numberOfWriteOperationsPerSecond property: Gets the number of write operations per second. - * - * @param numberOfWriteOperationsPerSecond the numberOfWriteOperationsPerSecond value to set. - * @return the AssessedDisk object itself. - */ - public AssessedDisk withNumberOfWriteOperationsPerSecond(Float numberOfWriteOperationsPerSecond) { - this.numberOfWriteOperationsPerSecond = numberOfWriteOperationsPerSecond; - 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("suitability", this.suitability == null ? null : this.suitability.toString()); - jsonWriter.writeStringField("suitabilityExplanation", - this.suitabilityExplanation == null ? null : this.suitabilityExplanation.toString()); - jsonWriter.writeStringField("suitabilityDetail", - this.suitabilityDetail == null ? null : this.suitabilityDetail.toString()); - jsonWriter.writeStringField("recommendedDiskSize", - this.recommendedDiskSize == null ? null : this.recommendedDiskSize.toString()); - jsonWriter.writeStringField("recommendedDiskType", - this.recommendedDiskType == null ? null : this.recommendedDiskType.toString()); - jsonWriter.writeNumberField("gigabytesForRecommendedDiskSize", this.gigabytesForRecommendedDiskSize); - jsonWriter.writeNumberField("recommendDiskThroughputInMbps", this.recommendDiskThroughputInMbps); - jsonWriter.writeNumberField("recommendedDiskIops", this.recommendedDiskIops); - jsonWriter.writeNumberField("monthlyStorageCost", this.monthlyStorageCost); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("displayName", this.displayName); - 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 AssessedDisk from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedDisk 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 AssessedDisk. - */ - public static AssessedDisk fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedDisk deserializedAssessedDisk = new AssessedDisk(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("suitability".equals(fieldName)) { - deserializedAssessedDisk.suitability = CloudSuitability.fromString(reader.getString()); - } else if ("suitabilityExplanation".equals(fieldName)) { - deserializedAssessedDisk.suitabilityExplanation - = AzureDiskSuitabilityExplanation.fromString(reader.getString()); - } else if ("suitabilityDetail".equals(fieldName)) { - deserializedAssessedDisk.suitabilityDetail - = AzureDiskSuitabilityDetail.fromString(reader.getString()); - } else if ("recommendedDiskSize".equals(fieldName)) { - deserializedAssessedDisk.recommendedDiskSize = AzureDiskSize.fromString(reader.getString()); - } else if ("recommendedDiskType".equals(fieldName)) { - deserializedAssessedDisk.recommendedDiskType = AzureDiskType.fromString(reader.getString()); - } else if ("gigabytesForRecommendedDiskSize".equals(fieldName)) { - deserializedAssessedDisk.gigabytesForRecommendedDiskSize = reader.getNullable(JsonReader::getInt); - } else if ("recommendDiskThroughputInMbps".equals(fieldName)) { - deserializedAssessedDisk.recommendDiskThroughputInMbps = reader.getNullable(JsonReader::getFloat); - } else if ("recommendedDiskIops".equals(fieldName)) { - deserializedAssessedDisk.recommendedDiskIops = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyStorageCost".equals(fieldName)) { - deserializedAssessedDisk.monthlyStorageCost = reader.getNullable(JsonReader::getFloat); - } else if ("name".equals(fieldName)) { - deserializedAssessedDisk.name = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedAssessedDisk.displayName = reader.getString(); - } else if ("gigabytesProvisioned".equals(fieldName)) { - deserializedAssessedDisk.gigabytesProvisioned = reader.getNullable(JsonReader::getFloat); - } else if ("megabytesPerSecondOfRead".equals(fieldName)) { - deserializedAssessedDisk.megabytesPerSecondOfRead = reader.getNullable(JsonReader::getFloat); - } else if ("megabytesPerSecondOfWrite".equals(fieldName)) { - deserializedAssessedDisk.megabytesPerSecondOfWrite = reader.getNullable(JsonReader::getFloat); - } else if ("numberOfReadOperationsPerSecond".equals(fieldName)) { - deserializedAssessedDisk.numberOfReadOperationsPerSecond = reader.getNullable(JsonReader::getFloat); - } else if ("numberOfWriteOperationsPerSecond".equals(fieldName)) { - deserializedAssessedDisk.numberOfWriteOperationsPerSecond - = reader.getNullable(JsonReader::getFloat); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedDisk; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedDiskData.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedDiskData.java deleted file mode 100644 index b2c91080695c..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedDiskData.java +++ /dev/null @@ -1,522 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Assessed Disk data. Used in Assessed SQL machine DTO. - */ -@Fluent -public final class AssessedDiskData implements JsonSerializable { - /* - * Gets the suitability. - */ - private CloudSuitability suitability; - - /* - * Gets the suitability explanation. - */ - private AzureDiskSuitabilityExplanation suitabilityExplanation; - - /* - * Gets the suitability detail. - */ - private AzureDiskSuitabilityDetail suitabilityDetail; - - /* - * Gets the recommended disk size. - */ - private AzureDiskSize recommendedDiskSize; - - /* - * Gets the recommended disk type. - */ - private AzureDiskType recommendedDiskType; - - /* - * Gets the recommended disk size. - */ - private Integer recommendedDiskSizeGigabytes; - - /* - * Gets the recommended disk throughput. - */ - private Float recommendDiskThroughputInMbps; - - /* - * Gets the recommended disk iops. - */ - private Float recommendedDiskIops; - - /* - * Gets the monthly storage cost. - */ - private Float monthlyStorageCost; - - /* - * Gets the name. - */ - private String name; - - /* - * Gets the machine display name. - */ - private String displayName; - - /* - * Gets the gigabytes provisioned. - */ - private Float gigabytesProvisioned; - - /* - * Gets the megabytes per second of read. - */ - private Float megabytesPerSecondOfRead; - - /* - * Gets the megabytes per second of write. - */ - private Float megabytesPerSecondOfWrite; - - /* - * Gets the number of read operations per second. - */ - private Float numberOfReadOperationsPerSecond; - - /* - * Gets the number of write operations per second. - */ - private Float numberOfWriteOperationsPerSecond; - - /** - * Creates an instance of AssessedDiskData class. - */ - public AssessedDiskData() { - } - - /** - * Get the suitability property: Gets the suitability. - * - * @return the suitability value. - */ - public CloudSuitability suitability() { - return this.suitability; - } - - /** - * Set the suitability property: Gets the suitability. - * - * @param suitability the suitability value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withSuitability(CloudSuitability suitability) { - this.suitability = suitability; - return this; - } - - /** - * Get the suitabilityExplanation property: Gets the suitability explanation. - * - * @return the suitabilityExplanation value. - */ - public AzureDiskSuitabilityExplanation suitabilityExplanation() { - return this.suitabilityExplanation; - } - - /** - * Set the suitabilityExplanation property: Gets the suitability explanation. - * - * @param suitabilityExplanation the suitabilityExplanation value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withSuitabilityExplanation(AzureDiskSuitabilityExplanation suitabilityExplanation) { - this.suitabilityExplanation = suitabilityExplanation; - return this; - } - - /** - * Get the suitabilityDetail property: Gets the suitability detail. - * - * @return the suitabilityDetail value. - */ - public AzureDiskSuitabilityDetail suitabilityDetail() { - return this.suitabilityDetail; - } - - /** - * Set the suitabilityDetail property: Gets the suitability detail. - * - * @param suitabilityDetail the suitabilityDetail value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withSuitabilityDetail(AzureDiskSuitabilityDetail suitabilityDetail) { - this.suitabilityDetail = suitabilityDetail; - return this; - } - - /** - * Get the recommendedDiskSize property: Gets the recommended disk size. - * - * @return the recommendedDiskSize value. - */ - public AzureDiskSize recommendedDiskSize() { - return this.recommendedDiskSize; - } - - /** - * Set the recommendedDiskSize property: Gets the recommended disk size. - * - * @param recommendedDiskSize the recommendedDiskSize value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withRecommendedDiskSize(AzureDiskSize recommendedDiskSize) { - this.recommendedDiskSize = recommendedDiskSize; - return this; - } - - /** - * Get the recommendedDiskType property: Gets the recommended disk type. - * - * @return the recommendedDiskType value. - */ - public AzureDiskType recommendedDiskType() { - return this.recommendedDiskType; - } - - /** - * Set the recommendedDiskType property: Gets the recommended disk type. - * - * @param recommendedDiskType the recommendedDiskType value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withRecommendedDiskType(AzureDiskType recommendedDiskType) { - this.recommendedDiskType = recommendedDiskType; - return this; - } - - /** - * Get the recommendedDiskSizeGigabytes property: Gets the recommended disk size. - * - * @return the recommendedDiskSizeGigabytes value. - */ - public Integer recommendedDiskSizeGigabytes() { - return this.recommendedDiskSizeGigabytes; - } - - /** - * Set the recommendedDiskSizeGigabytes property: Gets the recommended disk size. - * - * @param recommendedDiskSizeGigabytes the recommendedDiskSizeGigabytes value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withRecommendedDiskSizeGigabytes(Integer recommendedDiskSizeGigabytes) { - this.recommendedDiskSizeGigabytes = recommendedDiskSizeGigabytes; - return this; - } - - /** - * Get the recommendDiskThroughputInMbps property: Gets the recommended disk throughput. - * - * @return the recommendDiskThroughputInMbps value. - */ - public Float recommendDiskThroughputInMbps() { - return this.recommendDiskThroughputInMbps; - } - - /** - * Set the recommendDiskThroughputInMbps property: Gets the recommended disk throughput. - * - * @param recommendDiskThroughputInMbps the recommendDiskThroughputInMbps value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withRecommendDiskThroughputInMbps(Float recommendDiskThroughputInMbps) { - this.recommendDiskThroughputInMbps = recommendDiskThroughputInMbps; - return this; - } - - /** - * Get the recommendedDiskIops property: Gets the recommended disk iops. - * - * @return the recommendedDiskIops value. - */ - public Float recommendedDiskIops() { - return this.recommendedDiskIops; - } - - /** - * Set the recommendedDiskIops property: Gets the recommended disk iops. - * - * @param recommendedDiskIops the recommendedDiskIops value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withRecommendedDiskIops(Float recommendedDiskIops) { - this.recommendedDiskIops = recommendedDiskIops; - return this; - } - - /** - * Get the monthlyStorageCost property: Gets the monthly storage cost. - * - * @return the monthlyStorageCost value. - */ - public Float monthlyStorageCost() { - return this.monthlyStorageCost; - } - - /** - * Set the monthlyStorageCost property: Gets the monthly storage cost. - * - * @param monthlyStorageCost the monthlyStorageCost value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withMonthlyStorageCost(Float monthlyStorageCost) { - this.monthlyStorageCost = monthlyStorageCost; - return this; - } - - /** - * Get the name property: Gets the name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets the name. - * - * @param name the name value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: Gets the machine display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Gets the machine display name. - * - * @param displayName the displayName value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the gigabytesProvisioned property: Gets the gigabytes provisioned. - * - * @return the gigabytesProvisioned value. - */ - public Float gigabytesProvisioned() { - return this.gigabytesProvisioned; - } - - /** - * Set the gigabytesProvisioned property: Gets the gigabytes provisioned. - * - * @param gigabytesProvisioned the gigabytesProvisioned value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withGigabytesProvisioned(Float gigabytesProvisioned) { - this.gigabytesProvisioned = gigabytesProvisioned; - return this; - } - - /** - * Get the megabytesPerSecondOfRead property: Gets the megabytes per second of read. - * - * @return the megabytesPerSecondOfRead value. - */ - public Float megabytesPerSecondOfRead() { - return this.megabytesPerSecondOfRead; - } - - /** - * Set the megabytesPerSecondOfRead property: Gets the megabytes per second of read. - * - * @param megabytesPerSecondOfRead the megabytesPerSecondOfRead value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withMegabytesPerSecondOfRead(Float megabytesPerSecondOfRead) { - this.megabytesPerSecondOfRead = megabytesPerSecondOfRead; - return this; - } - - /** - * Get the megabytesPerSecondOfWrite property: Gets the megabytes per second of write. - * - * @return the megabytesPerSecondOfWrite value. - */ - public Float megabytesPerSecondOfWrite() { - return this.megabytesPerSecondOfWrite; - } - - /** - * Set the megabytesPerSecondOfWrite property: Gets the megabytes per second of write. - * - * @param megabytesPerSecondOfWrite the megabytesPerSecondOfWrite value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withMegabytesPerSecondOfWrite(Float megabytesPerSecondOfWrite) { - this.megabytesPerSecondOfWrite = megabytesPerSecondOfWrite; - return this; - } - - /** - * Get the numberOfReadOperationsPerSecond property: Gets the number of read operations per second. - * - * @return the numberOfReadOperationsPerSecond value. - */ - public Float numberOfReadOperationsPerSecond() { - return this.numberOfReadOperationsPerSecond; - } - - /** - * Set the numberOfReadOperationsPerSecond property: Gets the number of read operations per second. - * - * @param numberOfReadOperationsPerSecond the numberOfReadOperationsPerSecond value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withNumberOfReadOperationsPerSecond(Float numberOfReadOperationsPerSecond) { - this.numberOfReadOperationsPerSecond = numberOfReadOperationsPerSecond; - return this; - } - - /** - * Get the numberOfWriteOperationsPerSecond property: Gets the number of write operations per second. - * - * @return the numberOfWriteOperationsPerSecond value. - */ - public Float numberOfWriteOperationsPerSecond() { - return this.numberOfWriteOperationsPerSecond; - } - - /** - * Set the numberOfWriteOperationsPerSecond property: Gets the number of write operations per second. - * - * @param numberOfWriteOperationsPerSecond the numberOfWriteOperationsPerSecond value to set. - * @return the AssessedDiskData object itself. - */ - public AssessedDiskData withNumberOfWriteOperationsPerSecond(Float numberOfWriteOperationsPerSecond) { - this.numberOfWriteOperationsPerSecond = numberOfWriteOperationsPerSecond; - 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("suitability", this.suitability == null ? null : this.suitability.toString()); - jsonWriter.writeStringField("suitabilityExplanation", - this.suitabilityExplanation == null ? null : this.suitabilityExplanation.toString()); - jsonWriter.writeStringField("suitabilityDetail", - this.suitabilityDetail == null ? null : this.suitabilityDetail.toString()); - jsonWriter.writeStringField("recommendedDiskSize", - this.recommendedDiskSize == null ? null : this.recommendedDiskSize.toString()); - jsonWriter.writeStringField("recommendedDiskType", - this.recommendedDiskType == null ? null : this.recommendedDiskType.toString()); - jsonWriter.writeNumberField("recommendedDiskSizeGigabytes", this.recommendedDiskSizeGigabytes); - jsonWriter.writeNumberField("recommendDiskThroughputInMbps", this.recommendDiskThroughputInMbps); - jsonWriter.writeNumberField("recommendedDiskIops", this.recommendedDiskIops); - jsonWriter.writeNumberField("monthlyStorageCost", this.monthlyStorageCost); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("displayName", this.displayName); - 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 AssessedDiskData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedDiskData 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 AssessedDiskData. - */ - public static AssessedDiskData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedDiskData deserializedAssessedDiskData = new AssessedDiskData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("suitability".equals(fieldName)) { - deserializedAssessedDiskData.suitability = CloudSuitability.fromString(reader.getString()); - } else if ("suitabilityExplanation".equals(fieldName)) { - deserializedAssessedDiskData.suitabilityExplanation - = AzureDiskSuitabilityExplanation.fromString(reader.getString()); - } else if ("suitabilityDetail".equals(fieldName)) { - deserializedAssessedDiskData.suitabilityDetail - = AzureDiskSuitabilityDetail.fromString(reader.getString()); - } else if ("recommendedDiskSize".equals(fieldName)) { - deserializedAssessedDiskData.recommendedDiskSize = AzureDiskSize.fromString(reader.getString()); - } else if ("recommendedDiskType".equals(fieldName)) { - deserializedAssessedDiskData.recommendedDiskType = AzureDiskType.fromString(reader.getString()); - } else if ("recommendedDiskSizeGigabytes".equals(fieldName)) { - deserializedAssessedDiskData.recommendedDiskSizeGigabytes = reader.getNullable(JsonReader::getInt); - } else if ("recommendDiskThroughputInMbps".equals(fieldName)) { - deserializedAssessedDiskData.recommendDiskThroughputInMbps - = reader.getNullable(JsonReader::getFloat); - } else if ("recommendedDiskIops".equals(fieldName)) { - deserializedAssessedDiskData.recommendedDiskIops = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyStorageCost".equals(fieldName)) { - deserializedAssessedDiskData.monthlyStorageCost = reader.getNullable(JsonReader::getFloat); - } else if ("name".equals(fieldName)) { - deserializedAssessedDiskData.name = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedAssessedDiskData.displayName = reader.getString(); - } else if ("gigabytesProvisioned".equals(fieldName)) { - deserializedAssessedDiskData.gigabytesProvisioned = reader.getNullable(JsonReader::getFloat); - } else if ("megabytesPerSecondOfRead".equals(fieldName)) { - deserializedAssessedDiskData.megabytesPerSecondOfRead = reader.getNullable(JsonReader::getFloat); - } else if ("megabytesPerSecondOfWrite".equals(fieldName)) { - deserializedAssessedDiskData.megabytesPerSecondOfWrite = reader.getNullable(JsonReader::getFloat); - } else if ("numberOfReadOperationsPerSecond".equals(fieldName)) { - deserializedAssessedDiskData.numberOfReadOperationsPerSecond - = reader.getNullable(JsonReader::getFloat); - } else if ("numberOfWriteOperationsPerSecond".equals(fieldName)) { - deserializedAssessedDiskData.numberOfWriteOperationsPerSecond - = reader.getNullable(JsonReader::getFloat); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedDiskData; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedDiskDataV3.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedDiskDataV3.java new file mode 100644 index 000000000000..9d9578ac70bb --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedDiskDataV3.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Assessed disk data for normalized contract. + */ +@Fluent +public final class AssessedDiskDataV3 implements JsonSerializable { + /* + * The disk name. + */ + private String name; + + /* + * The disk display name. + */ + private String displayName; + + /* + * Gets the gigabytes provisioned. + */ + private Float gigabytesProvisioned; + + /* + * Gets the megabytes per second of read. + */ + private Float megabytesPerSecondOfRead; + + /* + * Gets the megabytes per second of write. + */ + private Float megabytesPerSecondOfWrite; + + /* + * Gets the number of read operations per second. + */ + private Float numberOfReadOperationsPerSecond; + + /* + * Gets the number of write operations per second. + */ + private Float numberOfWriteOperationsPerSecond; + + /** + * Creates an instance of AssessedDiskDataV3 class. + */ + public 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 Float gigabytesProvisioned() { + return this.gigabytesProvisioned; + } + + /** + * Set the gigabytesProvisioned property: Gets the gigabytes provisioned. + * + * @param gigabytesProvisioned the gigabytesProvisioned value to set. + * @return the AssessedDiskDataV3 object itself. + */ + public AssessedDiskDataV3 withGigabytesProvisioned(Float gigabytesProvisioned) { + this.gigabytesProvisioned = gigabytesProvisioned; + return this; + } + + /** + * Get the megabytesPerSecondOfRead property: Gets the megabytes per second of read. + * + * @return the megabytesPerSecondOfRead value. + */ + public Float megabytesPerSecondOfRead() { + return this.megabytesPerSecondOfRead; + } + + /** + * Set the megabytesPerSecondOfRead property: Gets the megabytes per second of read. + * + * @param megabytesPerSecondOfRead the megabytesPerSecondOfRead value to set. + * @return the AssessedDiskDataV3 object itself. + */ + public AssessedDiskDataV3 withMegabytesPerSecondOfRead(Float megabytesPerSecondOfRead) { + this.megabytesPerSecondOfRead = megabytesPerSecondOfRead; + return this; + } + + /** + * Get the megabytesPerSecondOfWrite property: Gets the megabytes per second of write. + * + * @return the megabytesPerSecondOfWrite value. + */ + public Float megabytesPerSecondOfWrite() { + return this.megabytesPerSecondOfWrite; + } + + /** + * Set the megabytesPerSecondOfWrite property: Gets the megabytes per second of write. + * + * @param megabytesPerSecondOfWrite the megabytesPerSecondOfWrite value to set. + * @return the AssessedDiskDataV3 object itself. + */ + public AssessedDiskDataV3 withMegabytesPerSecondOfWrite(Float megabytesPerSecondOfWrite) { + this.megabytesPerSecondOfWrite = megabytesPerSecondOfWrite; + return this; + } + + /** + * Get the numberOfReadOperationsPerSecond property: Gets the number of read operations per second. + * + * @return the numberOfReadOperationsPerSecond value. + */ + public Float numberOfReadOperationsPerSecond() { + return this.numberOfReadOperationsPerSecond; + } + + /** + * Set the numberOfReadOperationsPerSecond property: Gets the number of read operations per second. + * + * @param numberOfReadOperationsPerSecond the numberOfReadOperationsPerSecond value to set. + * @return the AssessedDiskDataV3 object itself. + */ + public AssessedDiskDataV3 withNumberOfReadOperationsPerSecond(Float numberOfReadOperationsPerSecond) { + this.numberOfReadOperationsPerSecond = numberOfReadOperationsPerSecond; + return this; + } + + /** + * Get the numberOfWriteOperationsPerSecond property: Gets the number of write operations per second. + * + * @return the numberOfWriteOperationsPerSecond value. + */ + public Float numberOfWriteOperationsPerSecond() { + return this.numberOfWriteOperationsPerSecond; + } + + /** + * Set the numberOfWriteOperationsPerSecond property: Gets the number of write operations per second. + * + * @param numberOfWriteOperationsPerSecond the numberOfWriteOperationsPerSecond value to set. + * @return the AssessedDiskDataV3 object itself. + */ + public AssessedDiskDataV3 withNumberOfWriteOperationsPerSecond(Float numberOfWriteOperationsPerSecond) { + this.numberOfWriteOperationsPerSecond = numberOfWriteOperationsPerSecond; + 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("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::getFloat); + } else if ("megabytesPerSecondOfRead".equals(fieldName)) { + deserializedAssessedDiskDataV3.megabytesPerSecondOfRead = reader.getNullable(JsonReader::getFloat); + } else if ("megabytesPerSecondOfWrite".equals(fieldName)) { + deserializedAssessedDiskDataV3.megabytesPerSecondOfWrite = reader.getNullable(JsonReader::getFloat); + } else if ("numberOfReadOperationsPerSecond".equals(fieldName)) { + deserializedAssessedDiskDataV3.numberOfReadOperationsPerSecond + = reader.getNullable(JsonReader::getFloat); + } else if ("numberOfWriteOperationsPerSecond".equals(fieldName)) { + deserializedAssessedDiskDataV3.numberOfWriteOperationsPerSecond + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedDiskDataV3; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachine.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachine.java deleted file mode 100644 index a42331165aba..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachine.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedMachineInner; - -/** - * An immutable client-side representation of AssessedMachine. - */ -public interface AssessedMachine { - /** - * 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. - */ - AssessedMachineProperties 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.migration.assessment.fluent.models.AssessedMachineInner object. - * - * @return the inner object. - */ - AssessedMachineInner innerModel(); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineExtendedDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineExtendedDetails.java new file mode 100644 index 000000000000..5d4600cf301d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineExtendedDetails.java @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * The assessed machine extended details. + */ +@Fluent +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 Float 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 Float percentageCoresUtilization; + + /* + * Percentile of Percentage of Memory Utilized noted during time period T. + * Here N and T are settings on Assessment. + */ + private Float percentageMemoryUtilization; + + /* + * List of errors for this machine. + */ + private List errors; + + /** + * Creates an instance of AssessedMachineExtendedDetails class. + */ + public 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; + } + + /** + * Set the hostProcessor property: Gets or sets the processor details of the host. + * + * @param hostProcessor the hostProcessor value to set. + * @return the AssessedMachineExtendedDetails object itself. + */ + public AssessedMachineExtendedDetails withHostProcessor(ProcessorInfo hostProcessor) { + this.hostProcessor = hostProcessor; + return this; + } + + /** + * 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 Float 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 Float 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 Float 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::getFloat); + } else if ("numberOfCores".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.numberOfCores = reader.getNullable(JsonReader::getInt); + } else if ("percentageCoresUtilization".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.percentageCoresUtilization + = reader.getNullable(JsonReader::getFloat); + } else if ("percentageMemoryUtilization".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.percentageMemoryUtilization + = reader.getNullable(JsonReader::getFloat); + } 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineListResult.java deleted file mode 100644 index ccc0c8153038..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineListResult.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -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.migration.assessment.fluent.models.AssessedMachineInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a AssessedMachine list operation. - */ -@Fluent -public final class AssessedMachineListResult implements JsonSerializable { - /* - * The AssessedMachine items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of AssessedMachineListResult class. - */ - public AssessedMachineListResult() { - } - - /** - * Get the value property: The AssessedMachine items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The AssessedMachine items on this page. - * - * @param value the value value to set. - * @return the AssessedMachineListResult object itself. - */ - public AssessedMachineListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the AssessedMachineListResult object itself. - */ - public AssessedMachineListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * 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 AssessedMachineListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AssessedMachineListResult.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 AssessedMachineListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedMachineListResult 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 AssessedMachineListResult. - */ - public static AssessedMachineListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedMachineListResult deserializedAssessedMachineListResult = new AssessedMachineListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AssessedMachineInner.fromJson(reader1)); - deserializedAssessedMachineListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAssessedMachineListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedMachineListResult; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineNetworkAdaptersV3.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineNetworkAdaptersV3.java new file mode 100644 index 000000000000..d86fc3822a05 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineNetworkAdaptersV3.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Assessed network adapter data for normalized contract for sql machines. + */ +@Fluent +public final class AssessedMachineNetworkAdaptersV3 implements JsonSerializable { + /* + * The disk name. + */ + private String name; + + /* + * Gets the net gigabytes transmitted per month. + */ + private Float netGigabytesTransmittedPerMonth; + + /* + * Gets the mac address. + */ + private String macAddress; + + /* + * Gets the ip addresses. + */ + private List ipAddresses; + + /* + * Gets the megabytes per second received. + */ + private Float megabytesPerSecondRecieved; + + /* + * Gets the megabytes per second transmitted. + */ + private Float megabytesPerSecondTransmitted; + + /* + * Display Name of the Machine. + */ + private String displayName; + + /** + * Creates an instance of AssessedMachineNetworkAdaptersV3 class. + */ + public 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 Float netGigabytesTransmittedPerMonth() { + return this.netGigabytesTransmittedPerMonth; + } + + /** + * Set the netGigabytesTransmittedPerMonth property: Gets the net gigabytes transmitted per month. + * + * @param netGigabytesTransmittedPerMonth the netGigabytesTransmittedPerMonth value to set. + * @return the AssessedMachineNetworkAdaptersV3 object itself. + */ + public AssessedMachineNetworkAdaptersV3 withNetGigabytesTransmittedPerMonth(Float netGigabytesTransmittedPerMonth) { + this.netGigabytesTransmittedPerMonth = netGigabytesTransmittedPerMonth; + return this; + } + + /** + * Get the macAddress property: Gets the mac address. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the macAddress property: Gets the mac address. + * + * @param macAddress the macAddress value to set. + * @return the AssessedMachineNetworkAdaptersV3 object itself. + */ + public AssessedMachineNetworkAdaptersV3 withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * 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 Float megabytesPerSecondRecieved() { + return this.megabytesPerSecondRecieved; + } + + /** + * Set the megabytesPerSecondRecieved property: Gets the megabytes per second received. + * + * @param megabytesPerSecondRecieved the megabytesPerSecondRecieved value to set. + * @return the AssessedMachineNetworkAdaptersV3 object itself. + */ + public AssessedMachineNetworkAdaptersV3 withMegabytesPerSecondRecieved(Float megabytesPerSecondRecieved) { + this.megabytesPerSecondRecieved = megabytesPerSecondRecieved; + return this; + } + + /** + * Get the megabytesPerSecondTransmitted property: Gets the megabytes per second transmitted. + * + * @return the megabytesPerSecondTransmitted value. + */ + public Float megabytesPerSecondTransmitted() { + return this.megabytesPerSecondTransmitted; + } + + /** + * Set the megabytesPerSecondTransmitted property: Gets the megabytes per second transmitted. + * + * @param megabytesPerSecondTransmitted the megabytesPerSecondTransmitted value to set. + * @return the AssessedMachineNetworkAdaptersV3 object itself. + */ + public AssessedMachineNetworkAdaptersV3 withMegabytesPerSecondTransmitted(Float megabytesPerSecondTransmitted) { + this.megabytesPerSecondTransmitted = megabytesPerSecondTransmitted; + return this; + } + + /** + * 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::getFloat); + } 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::getFloat); + } else if ("megabytesPerSecondTransmitted".equals(fieldName)) { + deserializedAssessedMachineNetworkAdaptersV3.megabytesPerSecondTransmitted + = reader.getNullable(JsonReader::getFloat); + } else if ("displayName".equals(fieldName)) { + deserializedAssessedMachineNetworkAdaptersV3.displayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedMachineNetworkAdaptersV3; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineProperties.java deleted file mode 100644 index f3b4284d471a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineProperties.java +++ /dev/null @@ -1,732 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.util.List; -import java.util.Map; - -/** - * Assessed machine properties class. - */ -@Fluent -public final class AssessedMachineProperties implements JsonSerializable { - /* - * List of errors for this machine. - */ - private List errors; - - /* - * Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk object. - */ - private Map disks; - - /* - * Monthly ultra storage cost. - */ - private Float monthlyUltraStorageCost; - - /* - * Gets or sets the processor details of the host. - */ - private ProcessorInfo hostProcessor; - - /* - * Gets or sets the collection of cost components. - */ - private List costComponents; - - /* - * Gets the product support status related details. - */ - private ProductSupportStatus productSupportStatus; - - /* - * Monthly networking cost. - */ - private Float monthlyBandwidthCost; - - /* - * Monthly storage cost. - */ - private Float monthlyStorageCost; - - /* - * Monthly premium storage cost. - */ - private Float monthlyPremiumStorageCost; - - /* - * Monthly standard SSD storage cost. - */ - private Float monthlyStandardSsdStorageCost; - - /* - * List of Network Adapters that were assessed as part of this machine's - * assessment. - */ - private Map networkAdapters; - - /* - * Recommended Azure Size for the machine. - */ - private AzureVmSize recommendedSize; - - /* - * Number of cores for recommended size. Read Only. - */ - private Integer numberOfCoresForRecommendedSize; - - /* - * Megabytes of memory for recommended size. Read Only. - */ - private Float megabytesOfMemoryForRecommendedSize; - - /* - * Monthly Compute cost calculated for Recommended size, for a 31-day month. - */ - private Float monthlyComputeCostForRecommendedSize; - - /* - * Gets the explanation if machine is not suitable for cloud. - */ - private AzureVmSuitabilityExplanation suitabilityExplanation; - - /* - * Gets the details if machine is not suitable for cloud. - */ - private AzureVmSuitabilityDetail suitabilityDetail; - - /* - * Assessed machine type. - */ - private AssessedMachineType type; - - /* - * 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; - - /* - * When was machine first created. - */ - private OffsetDateTime createdTimestamp; - - /* - * When was machine last updated. - */ - private OffsetDateTime updatedTimestamp; - - /* - * Display Name of the Machine. - */ - private String displayName; - - /* - * Description for the machine. - */ - private String description; - - /* - * Data center machine ARM id. - */ - private String datacenterMachineArmId; - - /* - * Data center management server ARM id. - */ - private String datacenterManagementServerArmId; - - /* - * Data center management server name. - */ - private String datacenterManagementServerName; - - /* - * Megabytes of memory found allocated for the machine in private data center. - */ - private Float megabytesOfMemory; - - /* - * Number of CPU cores found on the machine. - */ - private Integer numberOfCores; - - /* - * Confidence Rating in Percentage. - */ - private Float confidenceRatingInPercentage; - - /* - * Percentile of Percentage of Cores Utilized noted during time period T. - * - * Here N and T are settings on Assessment. - */ - private Float percentageCoresUtilization; - - /* - * Percentile of Percentage of Memory Utilized noted during time period T. - * - * Here N and T are settings on Assessment. - */ - private Float percentageMemoryUtilization; - - /* - * Gets a value indicating whether machine is suitable for the cloud platform - * selected. - */ - private CloudSuitability suitability; - - /** - * Creates an instance of AssessedMachineProperties class. - */ - public AssessedMachineProperties() { - } - - /** - * Get the errors property: List of errors for this machine. - * - * @return the errors value. - */ - public List errors() { - return this.errors; - } - - /** - * 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 Map disks() { - return this.disks; - } - - /** - * Get the monthlyUltraStorageCost property: Monthly ultra storage cost. - * - * @return the monthlyUltraStorageCost value. - */ - public Float monthlyUltraStorageCost() { - return this.monthlyUltraStorageCost; - } - - /** - * Get the hostProcessor property: Gets or sets the processor details of the host. - * - * @return the hostProcessor value. - */ - public ProcessorInfo hostProcessor() { - return this.hostProcessor; - } - - /** - * Set the hostProcessor property: Gets or sets the processor details of the host. - * - * @param hostProcessor the hostProcessor value to set. - * @return the AssessedMachineProperties object itself. - */ - public AssessedMachineProperties withHostProcessor(ProcessorInfo hostProcessor) { - this.hostProcessor = hostProcessor; - return this; - } - - /** - * Get the costComponents property: Gets or sets the collection of cost components. - * - * @return the costComponents value. - */ - public List costComponents() { - return this.costComponents; - } - - /** - * Set the costComponents property: Gets or sets the collection of cost components. - * - * @param costComponents the costComponents value to set. - * @return the AssessedMachineProperties object itself. - */ - public AssessedMachineProperties withCostComponents(List costComponents) { - this.costComponents = costComponents; - return this; - } - - /** - * Get the productSupportStatus property: Gets the product support status related details. - * - * @return the productSupportStatus value. - */ - public ProductSupportStatus productSupportStatus() { - return this.productSupportStatus; - } - - /** - * Get the monthlyBandwidthCost property: Monthly networking cost. - * - * @return the monthlyBandwidthCost value. - */ - public Float monthlyBandwidthCost() { - return this.monthlyBandwidthCost; - } - - /** - * Get the monthlyStorageCost property: Monthly storage cost. - * - * @return the monthlyStorageCost value. - */ - public Float monthlyStorageCost() { - return this.monthlyStorageCost; - } - - /** - * Get the monthlyPremiumStorageCost property: Monthly premium storage cost. - * - * @return the monthlyPremiumStorageCost value. - */ - public Float monthlyPremiumStorageCost() { - return this.monthlyPremiumStorageCost; - } - - /** - * Get the monthlyStandardSsdStorageCost property: Monthly standard SSD storage cost. - * - * @return the monthlyStandardSsdStorageCost value. - */ - public Float monthlyStandardSsdStorageCost() { - return this.monthlyStandardSsdStorageCost; - } - - /** - * Get the networkAdapters property: List of Network Adapters that were assessed as part of this machine's - * assessment. - * - * @return the networkAdapters value. - */ - public Map networkAdapters() { - return this.networkAdapters; - } - - /** - * Get the recommendedSize property: Recommended Azure Size for the machine. - * - * @return the recommendedSize value. - */ - public AzureVmSize recommendedSize() { - return this.recommendedSize; - } - - /** - * Get the numberOfCoresForRecommendedSize property: Number of cores for recommended size. Read Only. - * - * @return the numberOfCoresForRecommendedSize value. - */ - public Integer numberOfCoresForRecommendedSize() { - return this.numberOfCoresForRecommendedSize; - } - - /** - * Get the megabytesOfMemoryForRecommendedSize property: Megabytes of memory for recommended size. Read Only. - * - * @return the megabytesOfMemoryForRecommendedSize value. - */ - public Float megabytesOfMemoryForRecommendedSize() { - return this.megabytesOfMemoryForRecommendedSize; - } - - /** - * Get the monthlyComputeCostForRecommendedSize property: Monthly Compute cost calculated for Recommended size, for - * a 31-day month. - * - * @return the monthlyComputeCostForRecommendedSize value. - */ - public Float monthlyComputeCostForRecommendedSize() { - return this.monthlyComputeCostForRecommendedSize; - } - - /** - * Get the suitabilityExplanation property: Gets the explanation if machine is not suitable for cloud. - * - * @return the suitabilityExplanation value. - */ - public AzureVmSuitabilityExplanation suitabilityExplanation() { - return this.suitabilityExplanation; - } - - /** - * Get the suitabilityDetail property: Gets the details if machine is not suitable for cloud. - * - * @return the suitabilityDetail value. - */ - public AzureVmSuitabilityDetail suitabilityDetail() { - return this.suitabilityDetail; - } - - /** - * Get the type property: Assessed machine type. - * - * @return the type value. - */ - public AssessedMachineType type() { - return this.type; - } - - /** - * 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 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; - } - - /** - * Get the displayName property: Display Name of the Machine. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the description property: Description for the machine. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the datacenterMachineArmId property: Data center machine ARM id. - * - * @return the datacenterMachineArmId value. - */ - public String datacenterMachineArmId() { - return this.datacenterMachineArmId; - } - - /** - * Get the datacenterManagementServerArmId property: Data center management server ARM id. - * - * @return the datacenterManagementServerArmId value. - */ - public String datacenterManagementServerArmId() { - return this.datacenterManagementServerArmId; - } - - /** - * Get the datacenterManagementServerName property: Data center management server name. - * - * @return the datacenterManagementServerName value. - */ - public String datacenterManagementServerName() { - return this.datacenterManagementServerName; - } - - /** - * Get the megabytesOfMemory property: Megabytes of memory found allocated for the machine in private data center. - * - * @return the megabytesOfMemory value. - */ - public Float 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 confidenceRatingInPercentage property: Confidence Rating in Percentage. - * - * @return the confidenceRatingInPercentage value. - */ - public Float confidenceRatingInPercentage() { - return this.confidenceRatingInPercentage; - } - - /** - * 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 Float 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 Float percentageMemoryUtilization() { - return this.percentageMemoryUtilization; - } - - /** - * Get the suitability property: Gets a value indicating whether machine is suitable for the cloud platform - * selected. - * - * @return the suitability value. - */ - public CloudSuitability suitability() { - return this.suitability; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (errors() != null) { - errors().forEach(e -> e.validate()); - } - if (disks() != null) { - disks().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - if (hostProcessor() != null) { - hostProcessor().validate(); - } - if (costComponents() != null) { - costComponents().forEach(e -> e.validate()); - } - if (productSupportStatus() != null) { - productSupportStatus().validate(); - } - if (networkAdapters() != null) { - networkAdapters().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("hostProcessor", this.hostProcessor); - jsonWriter.writeArrayField("costComponents", this.costComponents, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssessedMachineProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedMachineProperties 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 AssessedMachineProperties. - */ - public static AssessedMachineProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedMachineProperties deserializedAssessedMachineProperties = new AssessedMachineProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("errors".equals(fieldName)) { - List errors = reader.readArray(reader1 -> Error.fromJson(reader1)); - deserializedAssessedMachineProperties.errors = errors; - } else if ("disks".equals(fieldName)) { - Map disks = reader.readMap(reader1 -> AssessedDisk.fromJson(reader1)); - deserializedAssessedMachineProperties.disks = disks; - } else if ("monthlyUltraStorageCost".equals(fieldName)) { - deserializedAssessedMachineProperties.monthlyUltraStorageCost - = reader.getNullable(JsonReader::getFloat); - } else if ("hostProcessor".equals(fieldName)) { - deserializedAssessedMachineProperties.hostProcessor = ProcessorInfo.fromJson(reader); - } else if ("costComponents".equals(fieldName)) { - List costComponents = reader.readArray(reader1 -> CostComponent.fromJson(reader1)); - deserializedAssessedMachineProperties.costComponents = costComponents; - } else if ("productSupportStatus".equals(fieldName)) { - deserializedAssessedMachineProperties.productSupportStatus = ProductSupportStatus.fromJson(reader); - } else if ("monthlyBandwidthCost".equals(fieldName)) { - deserializedAssessedMachineProperties.monthlyBandwidthCost - = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyStorageCost".equals(fieldName)) { - deserializedAssessedMachineProperties.monthlyStorageCost = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyPremiumStorageCost".equals(fieldName)) { - deserializedAssessedMachineProperties.monthlyPremiumStorageCost - = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyStandardSsdStorageCost".equals(fieldName)) { - deserializedAssessedMachineProperties.monthlyStandardSsdStorageCost - = reader.getNullable(JsonReader::getFloat); - } else if ("networkAdapters".equals(fieldName)) { - Map networkAdapters - = reader.readMap(reader1 -> AssessedNetworkAdapter.fromJson(reader1)); - deserializedAssessedMachineProperties.networkAdapters = networkAdapters; - } else if ("recommendedSize".equals(fieldName)) { - deserializedAssessedMachineProperties.recommendedSize = AzureVmSize.fromString(reader.getString()); - } else if ("numberOfCoresForRecommendedSize".equals(fieldName)) { - deserializedAssessedMachineProperties.numberOfCoresForRecommendedSize - = reader.getNullable(JsonReader::getInt); - } else if ("megabytesOfMemoryForRecommendedSize".equals(fieldName)) { - deserializedAssessedMachineProperties.megabytesOfMemoryForRecommendedSize - = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyComputeCostForRecommendedSize".equals(fieldName)) { - deserializedAssessedMachineProperties.monthlyComputeCostForRecommendedSize - = reader.getNullable(JsonReader::getFloat); - } else if ("suitabilityExplanation".equals(fieldName)) { - deserializedAssessedMachineProperties.suitabilityExplanation - = AzureVmSuitabilityExplanation.fromString(reader.getString()); - } else if ("suitabilityDetail".equals(fieldName)) { - deserializedAssessedMachineProperties.suitabilityDetail - = AzureVmSuitabilityDetail.fromString(reader.getString()); - } else if ("type".equals(fieldName)) { - deserializedAssessedMachineProperties.type = AssessedMachineType.fromString(reader.getString()); - } else if ("bootType".equals(fieldName)) { - deserializedAssessedMachineProperties.bootType = MachineBootType.fromString(reader.getString()); - } else if ("operatingSystemType".equals(fieldName)) { - deserializedAssessedMachineProperties.operatingSystemType = reader.getString(); - } else if ("operatingSystemName".equals(fieldName)) { - deserializedAssessedMachineProperties.operatingSystemName = reader.getString(); - } else if ("operatingSystemVersion".equals(fieldName)) { - deserializedAssessedMachineProperties.operatingSystemVersion = reader.getString(); - } else if ("operatingSystemArchitecture".equals(fieldName)) { - deserializedAssessedMachineProperties.operatingSystemArchitecture - = GuestOperatingSystemArchitecture.fromString(reader.getString()); - } else if ("createdTimestamp".equals(fieldName)) { - deserializedAssessedMachineProperties.createdTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("updatedTimestamp".equals(fieldName)) { - deserializedAssessedMachineProperties.updatedTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("displayName".equals(fieldName)) { - deserializedAssessedMachineProperties.displayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedAssessedMachineProperties.description = reader.getString(); - } else if ("datacenterMachineArmId".equals(fieldName)) { - deserializedAssessedMachineProperties.datacenterMachineArmId = reader.getString(); - } else if ("datacenterManagementServerArmId".equals(fieldName)) { - deserializedAssessedMachineProperties.datacenterManagementServerArmId = reader.getString(); - } else if ("datacenterManagementServerName".equals(fieldName)) { - deserializedAssessedMachineProperties.datacenterManagementServerName = reader.getString(); - } else if ("megabytesOfMemory".equals(fieldName)) { - deserializedAssessedMachineProperties.megabytesOfMemory = reader.getNullable(JsonReader::getFloat); - } else if ("numberOfCores".equals(fieldName)) { - deserializedAssessedMachineProperties.numberOfCores = reader.getNullable(JsonReader::getInt); - } else if ("confidenceRatingInPercentage".equals(fieldName)) { - deserializedAssessedMachineProperties.confidenceRatingInPercentage - = reader.getNullable(JsonReader::getFloat); - } else if ("percentageCoresUtilization".equals(fieldName)) { - deserializedAssessedMachineProperties.percentageCoresUtilization - = reader.getNullable(JsonReader::getFloat); - } else if ("percentageMemoryUtilization".equals(fieldName)) { - deserializedAssessedMachineProperties.percentageMemoryUtilization - = reader.getNullable(JsonReader::getFloat); - } else if ("suitability".equals(fieldName)) { - deserializedAssessedMachineProperties.suitability = CloudSuitability.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedMachineProperties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineType.java index 82dcda84675d..afaf7348a409 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineType.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineType.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for AssessedMachineType. + * Assessed machine type. */ public final class AssessedMachineType extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2.java new file mode 100644 index 000000000000..1ace4ac47f1b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.AssessedMachineV2Inner object. + * + * @return the inner object. + */ + AssessedMachineV2Inner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2ListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2ListResult.java new file mode 100644 index 000000000000..327e91e54f42 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2ListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AssessedMachineV2Inner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AssessedMachineV2 list operation. + */ +@Fluent +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. + */ + public AssessedMachineV2ListResult() { + } + + /** + * Get the value property: The AssessedMachineV2 items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AssessedMachineV2 items on this page. + * + * @param value the value value to set. + * @return the AssessedMachineV2ListResult object itself. + */ + public AssessedMachineV2ListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AssessedMachineV2ListResult object itself. + */ + public AssessedMachineV2ListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2Properties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2Properties.java new file mode 100644 index 000000000000..220369ff9217 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2Properties.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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 -> AssessedMachineV2PropertiesRecommendationsItem.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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2PropertiesRecommendationsItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2PropertiesRecommendationsItem.java new file mode 100644 index 000000000000..a1a35e0a92f9 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2PropertiesRecommendationsItem.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Recommendation details. + */ +@Immutable +public final class AssessedMachineV2PropertiesRecommendationsItem + implements JsonSerializable { + /* + * The configuration data. + */ + private Configuration configuration; + + /* + * The recommended details. + */ + private RecommendedFor recommendedFor; + + /* + * The migration Platform. + */ + private MigrationPlatform migrationPlatform; + + /* + * The confidence score. + */ + private Float 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; + + /** + * Creates an instance of AssessedMachineV2PropertiesRecommendationsItem class. + */ + public AssessedMachineV2PropertiesRecommendationsItem() { + } + + /** + * 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 Float 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; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssessedMachineV2PropertiesRecommendationsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedMachineV2PropertiesRecommendationsItem 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 AssessedMachineV2PropertiesRecommendationsItem. + */ + public static AssessedMachineV2PropertiesRecommendationsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedMachineV2PropertiesRecommendationsItem deserializedAssessedMachineV2PropertiesRecommendationsItem + = new AssessedMachineV2PropertiesRecommendationsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configuration".equals(fieldName)) { + deserializedAssessedMachineV2PropertiesRecommendationsItem.configuration + = Configuration.fromJson(reader); + } else if ("recommendedFor".equals(fieldName)) { + deserializedAssessedMachineV2PropertiesRecommendationsItem.recommendedFor + = RecommendedFor.fromJson(reader); + } else if ("migrationPlatform".equals(fieldName)) { + deserializedAssessedMachineV2PropertiesRecommendationsItem.migrationPlatform + = MigrationPlatform.fromString(reader.getString()); + } else if ("confidenceScore".equals(fieldName)) { + deserializedAssessedMachineV2PropertiesRecommendationsItem.confidenceScore + = reader.getNullable(JsonReader::getFloat); + } else if ("migrationSuitability".equals(fieldName)) { + deserializedAssessedMachineV2PropertiesRecommendationsItem.migrationSuitability + = MigrationSuitability.fromJson(reader); + } else if ("securitySuitability".equals(fieldName)) { + deserializedAssessedMachineV2PropertiesRecommendationsItem.securitySuitability + = SecuritySuitability.fromJson(reader); + } else if ("totalCost".equals(fieldName)) { + List totalCost + = reader.readArray(reader1 -> CostDetailsCommon.fromJson(reader1)); + deserializedAssessedMachineV2PropertiesRecommendationsItem.totalCost = totalCost; + } else if ("totalSavings".equals(fieldName)) { + List totalSavings + = reader.readArray(reader1 -> SavingsDetailsCommon.fromJson(reader1)); + deserializedAssessedMachineV2PropertiesRecommendationsItem.totalSavings = totalSavings; + } else if ("migrationIssues".equals(fieldName)) { + List migrationIssues + = reader.readArray(reader1 -> MigrationIssues.fromJson(reader1)); + deserializedAssessedMachineV2PropertiesRecommendationsItem.migrationIssues = migrationIssues; + } else if ("skus".equals(fieldName)) { + List skus = reader.readArray( + reader1 -> AssessedMachineV2PropertiesRecommendationsPropertiesItemsItem.fromJson(reader1)); + deserializedAssessedMachineV2PropertiesRecommendationsItem.skus = skus; + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedMachineV2PropertiesRecommendationsItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2PropertiesRecommendationsPropertiesItemsItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2PropertiesRecommendationsPropertiesItemsItem.java new file mode 100644 index 000000000000..101ee9ba01a2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2PropertiesRecommendationsPropertiesItemsItem.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AssessedMachineV2PropertiesRecommendationsPropertiesItemsItem + 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 AssessedMachineV2PropertiesRecommendationsPropertiesItemsItem class. + */ + public AssessedMachineV2PropertiesRecommendationsPropertiesItemsItem() { + } + + /** + * 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 AssessedMachineV2PropertiesRecommendationsPropertiesItemsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedMachineV2PropertiesRecommendationsPropertiesItemsItem 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 + * AssessedMachineV2PropertiesRecommendationsPropertiesItemsItem. + */ + public static AssessedMachineV2PropertiesRecommendationsPropertiesItemsItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AssessedMachineV2PropertiesRecommendationsPropertiesItemsItem deserializedAssessedMachineV2PropertiesRecommendationsPropertiesItemsItem + = new AssessedMachineV2PropertiesRecommendationsPropertiesItemsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAssessedMachineV2PropertiesRecommendationsPropertiesItemsItem.kind + = SkuKind.fromString(reader.getString()); + } else if ("resourceUri".equals(fieldName)) { + deserializedAssessedMachineV2PropertiesRecommendationsPropertiesItemsItem.resourceUri + = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAssessedMachineV2PropertiesRecommendationsPropertiesItemsItem.displayName + = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedAssessedMachineV2PropertiesRecommendationsPropertiesItemsItem.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAssessedMachineV2PropertiesRecommendationsPropertiesItemsItem.type + = SkuType.fromString(reader.getString()); + } else if ("sources".equals(fieldName)) { + List sources = reader + .readArray(reader1 -> AssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem + .fromJson(reader1)); + deserializedAssessedMachineV2PropertiesRecommendationsPropertiesItemsItem.sources = sources; + } else if ("details".equals(fieldName)) { + deserializedAssessedMachineV2PropertiesRecommendationsPropertiesItemsItem.details + = SkuDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedMachineV2PropertiesRecommendationsPropertiesItemsItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem.java new file mode 100644 index 000000000000..9304cbc1beda --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem + implements JsonSerializable { + /* + * The sku name. + */ + private String name; + + /* + * The sku type. + */ + private MigrationSuitability migrationSuitability; + + /** + * Creates an instance of AssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem class. + */ + public AssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem() { + } + + /** + * 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 AssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem 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 + * AssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem. + */ + public static AssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem deserializedAssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem + = new AssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem.name + = reader.getString(); + } else if ("migrationSuitability".equals(fieldName)) { + deserializedAssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem.migrationSuitability + = MigrationSuitability.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedMachineV2PropertiesRecommendationsPropertiesItemsSourcesItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachinesOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachinesOperations.java deleted file mode 100644 index a2b2a4cf6e6d..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachinesOperations.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 AssessedMachinesOperations. - */ -public interface AssessedMachinesOperations { - /** - * List AssessedMachine resources by Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 AssessedMachine list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByAssessment(String resourceGroupName, String projectName, String groupName, - String assessmentName); - - /** - * List AssessedMachine resources by Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 AssessedMachine list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByAssessment(String resourceGroupName, String projectName, String groupName, - String assessmentName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, - Context context); - - /** - * Get a AssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment ARM name. - * @param assessedMachineName Machine assessment 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 AssessedMachine along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedMachineName, Context context); - - /** - * Get a AssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment ARM name. - * @param assessedMachineName Machine assessment 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 AssessedMachine. - */ - AssessedMachine get(String resourceGroupName, String projectName, String groupName, String assessmentName, - String assessedMachineName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachinesV2Operations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachinesV2Operations.java new file mode 100644 index 000000000000..a6a35493bd15 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedMachinesV2Operations.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 { + /** + * 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); + + /** + * 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); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedNetworkAdapter.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedNetworkAdapter.java deleted file mode 100644 index c0a2718b6fa1..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedNetworkAdapter.java +++ /dev/null @@ -1,343 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Assessed Network Adapter. - */ -@Fluent -public final class AssessedNetworkAdapter implements JsonSerializable { - /* - * Gets the suitability. - */ - private CloudSuitability suitability; - - /* - * Gets the suitability detail. - */ - private AzureNetworkAdapterSuitabilityDetail suitabilityDetail; - - /* - * Gets the suitability explanation. - */ - private AzureNetworkAdapterSuitabilityExplanation suitabilityExplanation; - - /* - * Gets the monthly bandwidth costs. - */ - private Float monthlyBandwidthCosts; - - /* - * Gets the net gigabytes transmitted per month. - */ - private Float netGigabytesTransmittedPerMonth; - - /* - * Gets the display name. - */ - private String displayName; - - /* - * Gets the mac address. - */ - private String macAddress; - - /* - * Gets the ip addresses. - */ - private List ipAddresses; - - /* - * Gets the megabytes per second received. - */ - private Float megabytesPerSecondReceived; - - /* - * Gets the megabytes per second transmitted. - */ - private Float megabytesPerSecondTransmitted; - - /** - * Creates an instance of AssessedNetworkAdapter class. - */ - public AssessedNetworkAdapter() { - } - - /** - * Get the suitability property: Gets the suitability. - * - * @return the suitability value. - */ - public CloudSuitability suitability() { - return this.suitability; - } - - /** - * Set the suitability property: Gets the suitability. - * - * @param suitability the suitability value to set. - * @return the AssessedNetworkAdapter object itself. - */ - public AssessedNetworkAdapter withSuitability(CloudSuitability suitability) { - this.suitability = suitability; - return this; - } - - /** - * Get the suitabilityDetail property: Gets the suitability detail. - * - * @return the suitabilityDetail value. - */ - public AzureNetworkAdapterSuitabilityDetail suitabilityDetail() { - return this.suitabilityDetail; - } - - /** - * Set the suitabilityDetail property: Gets the suitability detail. - * - * @param suitabilityDetail the suitabilityDetail value to set. - * @return the AssessedNetworkAdapter object itself. - */ - public AssessedNetworkAdapter withSuitabilityDetail(AzureNetworkAdapterSuitabilityDetail suitabilityDetail) { - this.suitabilityDetail = suitabilityDetail; - return this; - } - - /** - * Get the suitabilityExplanation property: Gets the suitability explanation. - * - * @return the suitabilityExplanation value. - */ - public AzureNetworkAdapterSuitabilityExplanation suitabilityExplanation() { - return this.suitabilityExplanation; - } - - /** - * Set the suitabilityExplanation property: Gets the suitability explanation. - * - * @param suitabilityExplanation the suitabilityExplanation value to set. - * @return the AssessedNetworkAdapter object itself. - */ - public AssessedNetworkAdapter - withSuitabilityExplanation(AzureNetworkAdapterSuitabilityExplanation suitabilityExplanation) { - this.suitabilityExplanation = suitabilityExplanation; - return this; - } - - /** - * Get the monthlyBandwidthCosts property: Gets the monthly bandwidth costs. - * - * @return the monthlyBandwidthCosts value. - */ - public Float monthlyBandwidthCosts() { - return this.monthlyBandwidthCosts; - } - - /** - * Set the monthlyBandwidthCosts property: Gets the monthly bandwidth costs. - * - * @param monthlyBandwidthCosts the monthlyBandwidthCosts value to set. - * @return the AssessedNetworkAdapter object itself. - */ - public AssessedNetworkAdapter withMonthlyBandwidthCosts(Float monthlyBandwidthCosts) { - this.monthlyBandwidthCosts = monthlyBandwidthCosts; - return this; - } - - /** - * Get the netGigabytesTransmittedPerMonth property: Gets the net gigabytes transmitted per month. - * - * @return the netGigabytesTransmittedPerMonth value. - */ - public Float netGigabytesTransmittedPerMonth() { - return this.netGigabytesTransmittedPerMonth; - } - - /** - * Set the netGigabytesTransmittedPerMonth property: Gets the net gigabytes transmitted per month. - * - * @param netGigabytesTransmittedPerMonth the netGigabytesTransmittedPerMonth value to set. - * @return the AssessedNetworkAdapter object itself. - */ - public AssessedNetworkAdapter withNetGigabytesTransmittedPerMonth(Float netGigabytesTransmittedPerMonth) { - this.netGigabytesTransmittedPerMonth = netGigabytesTransmittedPerMonth; - return this; - } - - /** - * Get the displayName property: Gets the display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Gets the display name. - * - * @param displayName the displayName value to set. - * @return the AssessedNetworkAdapter object itself. - */ - public AssessedNetworkAdapter withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the macAddress property: Gets the mac address. - * - * @return the macAddress value. - */ - public String macAddress() { - return this.macAddress; - } - - /** - * Set the macAddress property: Gets the mac address. - * - * @param macAddress the macAddress value to set. - * @return the AssessedNetworkAdapter object itself. - */ - public AssessedNetworkAdapter withMacAddress(String macAddress) { - this.macAddress = macAddress; - return this; - } - - /** - * Get the ipAddresses property: Gets the ip addresses. - * - * @return the ipAddresses value. - */ - public List ipAddresses() { - return this.ipAddresses; - } - - /** - * Get the megabytesPerSecondReceived property: Gets the megabytes per second received. - * - * @return the megabytesPerSecondReceived value. - */ - public Float megabytesPerSecondReceived() { - return this.megabytesPerSecondReceived; - } - - /** - * Set the megabytesPerSecondReceived property: Gets the megabytes per second received. - * - * @param megabytesPerSecondReceived the megabytesPerSecondReceived value to set. - * @return the AssessedNetworkAdapter object itself. - */ - public AssessedNetworkAdapter withMegabytesPerSecondReceived(Float megabytesPerSecondReceived) { - this.megabytesPerSecondReceived = megabytesPerSecondReceived; - return this; - } - - /** - * Get the megabytesPerSecondTransmitted property: Gets the megabytes per second transmitted. - * - * @return the megabytesPerSecondTransmitted value. - */ - public Float megabytesPerSecondTransmitted() { - return this.megabytesPerSecondTransmitted; - } - - /** - * Set the megabytesPerSecondTransmitted property: Gets the megabytes per second transmitted. - * - * @param megabytesPerSecondTransmitted the megabytesPerSecondTransmitted value to set. - * @return the AssessedNetworkAdapter object itself. - */ - public AssessedNetworkAdapter withMegabytesPerSecondTransmitted(Float megabytesPerSecondTransmitted) { - this.megabytesPerSecondTransmitted = megabytesPerSecondTransmitted; - 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("suitability", this.suitability == null ? null : this.suitability.toString()); - jsonWriter.writeStringField("suitabilityDetail", - this.suitabilityDetail == null ? null : this.suitabilityDetail.toString()); - jsonWriter.writeStringField("suitabilityExplanation", - this.suitabilityExplanation == null ? null : this.suitabilityExplanation.toString()); - jsonWriter.writeNumberField("monthlyBandwidthCosts", this.monthlyBandwidthCosts); - jsonWriter.writeNumberField("netGigabytesTransmittedPerMonth", this.netGigabytesTransmittedPerMonth); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("macAddress", this.macAddress); - jsonWriter.writeNumberField("megabytesPerSecondReceived", this.megabytesPerSecondReceived); - jsonWriter.writeNumberField("megabytesPerSecondTransmitted", this.megabytesPerSecondTransmitted); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssessedNetworkAdapter from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedNetworkAdapter 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 AssessedNetworkAdapter. - */ - public static AssessedNetworkAdapter fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedNetworkAdapter deserializedAssessedNetworkAdapter = new AssessedNetworkAdapter(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("suitability".equals(fieldName)) { - deserializedAssessedNetworkAdapter.suitability = CloudSuitability.fromString(reader.getString()); - } else if ("suitabilityDetail".equals(fieldName)) { - deserializedAssessedNetworkAdapter.suitabilityDetail - = AzureNetworkAdapterSuitabilityDetail.fromString(reader.getString()); - } else if ("suitabilityExplanation".equals(fieldName)) { - deserializedAssessedNetworkAdapter.suitabilityExplanation - = AzureNetworkAdapterSuitabilityExplanation.fromString(reader.getString()); - } else if ("monthlyBandwidthCosts".equals(fieldName)) { - deserializedAssessedNetworkAdapter.monthlyBandwidthCosts = reader.getNullable(JsonReader::getFloat); - } else if ("netGigabytesTransmittedPerMonth".equals(fieldName)) { - deserializedAssessedNetworkAdapter.netGigabytesTransmittedPerMonth - = reader.getNullable(JsonReader::getFloat); - } else if ("displayName".equals(fieldName)) { - deserializedAssessedNetworkAdapter.displayName = reader.getString(); - } else if ("macAddress".equals(fieldName)) { - deserializedAssessedNetworkAdapter.macAddress = reader.getString(); - } else if ("ipAddresses".equals(fieldName)) { - List ipAddresses = reader.readArray(reader1 -> reader1.getString()); - deserializedAssessedNetworkAdapter.ipAddresses = ipAddresses; - } else if ("megabytesPerSecondReceived".equals(fieldName)) { - deserializedAssessedNetworkAdapter.megabytesPerSecondReceived - = reader.getNullable(JsonReader::getFloat); - } else if ("megabytesPerSecondTransmitted".equals(fieldName)) { - deserializedAssessedNetworkAdapter.megabytesPerSecondTransmitted - = reader.getNullable(JsonReader::getFloat); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedNetworkAdapter; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV2.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV2.java deleted file mode 100644 index ec3b7682f491..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV2.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlDatabaseV2Inner; - -/** - * An immutable client-side representation of AssessedSqlDatabaseV2. - */ -public interface AssessedSqlDatabaseV2 { - /** - * 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. - */ - AssessedSqlDatabaseV2Properties 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.migration.assessment.fluent.models.AssessedSqlDatabaseV2Inner object. - * - * @return the inner object. - */ - AssessedSqlDatabaseV2Inner innerModel(); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV2ListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV2ListResult.java deleted file mode 100644 index 23db29c30e22..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV2ListResult.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -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.migration.assessment.fluent.models.AssessedSqlDatabaseV2Inner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a AssessedSqlDatabaseV2 list operation. - */ -@Fluent -public final class AssessedSqlDatabaseV2ListResult implements JsonSerializable { - /* - * The AssessedSqlDatabaseV2 items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of AssessedSqlDatabaseV2ListResult class. - */ - public AssessedSqlDatabaseV2ListResult() { - } - - /** - * Get the value property: The AssessedSqlDatabaseV2 items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The AssessedSqlDatabaseV2 items on this page. - * - * @param value the value value to set. - * @return the AssessedSqlDatabaseV2ListResult object itself. - */ - public AssessedSqlDatabaseV2ListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the AssessedSqlDatabaseV2ListResult object itself. - */ - public AssessedSqlDatabaseV2ListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * 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 AssessedSqlDatabaseV2ListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AssessedSqlDatabaseV2ListResult.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 AssessedSqlDatabaseV2ListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedSqlDatabaseV2ListResult 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 AssessedSqlDatabaseV2ListResult. - */ - public static AssessedSqlDatabaseV2ListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedSqlDatabaseV2ListResult deserializedAssessedSqlDatabaseV2ListResult - = new AssessedSqlDatabaseV2ListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AssessedSqlDatabaseV2Inner.fromJson(reader1)); - deserializedAssessedSqlDatabaseV2ListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2ListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedSqlDatabaseV2ListResult; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV2Operations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV2Operations.java deleted file mode 100644 index 534519b8401c..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV2Operations.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 AssessedSqlDatabaseV2Operations. - */ -public interface AssessedSqlDatabaseV2Operations { - /** - * List AssessedSqlDatabaseV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV2 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName); - - /** - * List AssessedSqlDatabaseV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV2 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context); - - /** - * Get a AssessedSqlDatabaseV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV2 along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlDatabaseName, Context context); - - /** - * Get a AssessedSqlDatabaseV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV2. - */ - AssessedSqlDatabaseV2 get(String resourceGroupName, String projectName, String groupName, String assessmentName, - String assessedSqlDatabaseName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV2Properties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV2Properties.java deleted file mode 100644 index ad935a45c06e..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV2Properties.java +++ /dev/null @@ -1,509 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Assessed SQL database properties web model. - */ -@Immutable -public final class AssessedSqlDatabaseV2Properties implements JsonSerializable { - /* - * Gets or sets the recommended azure SQL target type. - */ - private TargetType recommendedAzureSqlTargetType; - - /* - * Gets or sets the recommended azure SQL suitability. - */ - private RecommendedSuitability recommendedSuitability; - - /* - * Gets or sets the aggregated cache size of this database. This is a performance - * data metric for this DB. - */ - private Float bufferCacheSizeInMB; - - /* - * Gets the product support status related details. - */ - private ProductSupportStatus productSupportStatus; - - /* - * Gets or sets the azure SQL MI suitability details. - */ - private SqlAssessmentV2PaasSuitabilityData azureSqlMISuitabilityDetails; - - /* - * Gets or sets the azure SQL DB suitability details. - */ - private SqlAssessmentV2PaasSuitabilityData azureSqlDBSuitabilityDetails; - - /* - * Gets a value indicating whether the assessed SQL database is highly available - * or not. - */ - private Boolean isDatabaseHighlyAvailable; - - /* - * Gets the linked availability group overview if the database being assessed is - * highly available. - */ - private SqlAvailabilityGroupDataOverview linkedAvailabilityGroupOverview; - - /* - * Machine arm id. - */ - private String machineArmId; - - /* - * Assessed SQL instance arm id. - */ - private String assessedSqlInstanceArmId; - - /* - * Machine display name. - */ - private String machineName; - - /* - * SQL instance name. - */ - private String instanceName; - - /* - * SQL database name. - */ - private String databaseName; - - /* - * SQL database size in megabytes. - */ - private Float databaseSizeInMB; - - /* - * Database compatibility level. - */ - private CompatibilityLevel compatibilityLevel; - - /* - * SQL database SDS arm id. - */ - private String sqlDatabaseSdsArmId; - - /* - * The percentage of the total number of cores being utilized by the SQL database. - */ - private Float percentageCoresUtilization; - - /* - * The read throughput of the SQL database. - */ - private Float megabytesPerSecondOfRead; - - /* - * The write throughput of the SQL database. - */ - private Float megabytesPerSecondOfWrite; - - /* - * The read operations per second of the SQL database. - */ - private Float numberOfReadOperationsPerSecond; - - /* - * The write operations per second of the SQL database. - */ - private Float numberOfWriteOperationsPerSecond; - - /* - * Confidence Rating in Percentage. - */ - private Float confidenceRatingInPercentage; - - /* - * Assessment sizing criterion. - */ - private AssessmentSizingCriterion sizingCriterion; - - /* - * When was assessed SQL database first created. - */ - private OffsetDateTime createdTimestamp; - - /* - * When was assessed SQL database last updated. - */ - private OffsetDateTime updatedTimestamp; - - /** - * Creates an instance of AssessedSqlDatabaseV2Properties class. - */ - public AssessedSqlDatabaseV2Properties() { - } - - /** - * Get the recommendedAzureSqlTargetType property: Gets or sets the recommended azure SQL target type. - * - * @return the recommendedAzureSqlTargetType value. - */ - public TargetType recommendedAzureSqlTargetType() { - return this.recommendedAzureSqlTargetType; - } - - /** - * Get the recommendedSuitability property: Gets or sets the recommended azure SQL suitability. - * - * @return the recommendedSuitability value. - */ - public RecommendedSuitability recommendedSuitability() { - return this.recommendedSuitability; - } - - /** - * Get the bufferCacheSizeInMB property: Gets or sets the aggregated cache size of this database. This is a - * performance - * data metric for this DB. - * - * @return the bufferCacheSizeInMB value. - */ - public Float bufferCacheSizeInMB() { - return this.bufferCacheSizeInMB; - } - - /** - * Get the productSupportStatus property: Gets the product support status related details. - * - * @return the productSupportStatus value. - */ - public ProductSupportStatus productSupportStatus() { - return this.productSupportStatus; - } - - /** - * Get the azureSqlMISuitabilityDetails property: Gets or sets the azure SQL MI suitability details. - * - * @return the azureSqlMISuitabilityDetails value. - */ - public SqlAssessmentV2PaasSuitabilityData azureSqlMISuitabilityDetails() { - return this.azureSqlMISuitabilityDetails; - } - - /** - * Get the azureSqlDBSuitabilityDetails property: Gets or sets the azure SQL DB suitability details. - * - * @return the azureSqlDBSuitabilityDetails value. - */ - public SqlAssessmentV2PaasSuitabilityData azureSqlDBSuitabilityDetails() { - return this.azureSqlDBSuitabilityDetails; - } - - /** - * Get the isDatabaseHighlyAvailable property: Gets a value indicating whether the assessed SQL database is highly - * available - * or not. - * - * @return the isDatabaseHighlyAvailable value. - */ - public Boolean isDatabaseHighlyAvailable() { - return this.isDatabaseHighlyAvailable; - } - - /** - * Get the linkedAvailabilityGroupOverview property: Gets the linked availability group overview if the database - * being assessed is - * highly available. - * - * @return the linkedAvailabilityGroupOverview value. - */ - public SqlAvailabilityGroupDataOverview linkedAvailabilityGroupOverview() { - return this.linkedAvailabilityGroupOverview; - } - - /** - * Get the machineArmId property: Machine arm id. - * - * @return the machineArmId value. - */ - public String machineArmId() { - return this.machineArmId; - } - - /** - * Get the assessedSqlInstanceArmId property: Assessed SQL instance arm id. - * - * @return the assessedSqlInstanceArmId value. - */ - public String assessedSqlInstanceArmId() { - return this.assessedSqlInstanceArmId; - } - - /** - * Get the machineName property: Machine display name. - * - * @return the machineName value. - */ - public String machineName() { - return this.machineName; - } - - /** - * Get the instanceName property: SQL instance name. - * - * @return the instanceName value. - */ - public String instanceName() { - return this.instanceName; - } - - /** - * Get the databaseName property: SQL database name. - * - * @return the databaseName value. - */ - public String databaseName() { - return this.databaseName; - } - - /** - * Get the databaseSizeInMB property: SQL database size in megabytes. - * - * @return the databaseSizeInMB value. - */ - public Float databaseSizeInMB() { - return this.databaseSizeInMB; - } - - /** - * Get the compatibilityLevel property: Database compatibility level. - * - * @return the compatibilityLevel value. - */ - public CompatibilityLevel compatibilityLevel() { - return this.compatibilityLevel; - } - - /** - * Get the sqlDatabaseSdsArmId property: SQL database SDS arm id. - * - * @return the sqlDatabaseSdsArmId value. - */ - public String sqlDatabaseSdsArmId() { - return this.sqlDatabaseSdsArmId; - } - - /** - * Get the percentageCoresUtilization property: The percentage of the total number of cores being utilized by the - * SQL database. - * - * @return the percentageCoresUtilization value. - */ - public Float percentageCoresUtilization() { - return this.percentageCoresUtilization; - } - - /** - * Get the megabytesPerSecondOfRead property: The read throughput of the SQL database. - * - * @return the megabytesPerSecondOfRead value. - */ - public Float megabytesPerSecondOfRead() { - return this.megabytesPerSecondOfRead; - } - - /** - * Get the megabytesPerSecondOfWrite property: The write throughput of the SQL database. - * - * @return the megabytesPerSecondOfWrite value. - */ - public Float megabytesPerSecondOfWrite() { - return this.megabytesPerSecondOfWrite; - } - - /** - * Get the numberOfReadOperationsPerSecond property: The read operations per second of the SQL database. - * - * @return the numberOfReadOperationsPerSecond value. - */ - public Float numberOfReadOperationsPerSecond() { - return this.numberOfReadOperationsPerSecond; - } - - /** - * Get the numberOfWriteOperationsPerSecond property: The write operations per second of the SQL database. - * - * @return the numberOfWriteOperationsPerSecond value. - */ - public Float numberOfWriteOperationsPerSecond() { - return this.numberOfWriteOperationsPerSecond; - } - - /** - * Get the confidenceRatingInPercentage property: Confidence Rating in Percentage. - * - * @return the confidenceRatingInPercentage value. - */ - public Float confidenceRatingInPercentage() { - return this.confidenceRatingInPercentage; - } - - /** - * Get the sizingCriterion property: Assessment sizing criterion. - * - * @return the sizingCriterion value. - */ - public AssessmentSizingCriterion sizingCriterion() { - return this.sizingCriterion; - } - - /** - * Get the createdTimestamp property: When was assessed SQL database first created. - * - * @return the createdTimestamp value. - */ - public OffsetDateTime createdTimestamp() { - return this.createdTimestamp; - } - - /** - * Get the updatedTimestamp property: When was assessed SQL database 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 (productSupportStatus() != null) { - productSupportStatus().validate(); - } - if (azureSqlMISuitabilityDetails() != null) { - azureSqlMISuitabilityDetails().validate(); - } - if (azureSqlDBSuitabilityDetails() != null) { - azureSqlDBSuitabilityDetails().validate(); - } - if (linkedAvailabilityGroupOverview() != null) { - linkedAvailabilityGroupOverview().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssessedSqlDatabaseV2Properties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedSqlDatabaseV2Properties 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 AssessedSqlDatabaseV2Properties. - */ - public static AssessedSqlDatabaseV2Properties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedSqlDatabaseV2Properties deserializedAssessedSqlDatabaseV2Properties - = new AssessedSqlDatabaseV2Properties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("recommendedAzureSqlTargetType".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.recommendedAzureSqlTargetType - = TargetType.fromString(reader.getString()); - } else if ("recommendedSuitability".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.recommendedSuitability - = RecommendedSuitability.fromString(reader.getString()); - } else if ("bufferCacheSizeInMB".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.bufferCacheSizeInMB - = reader.getNullable(JsonReader::getFloat); - } else if ("productSupportStatus".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.productSupportStatus - = ProductSupportStatus.fromJson(reader); - } else if ("azureSqlMISuitabilityDetails".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.azureSqlMISuitabilityDetails - = SqlAssessmentV2PaasSuitabilityData.fromJson(reader); - } else if ("azureSqlDBSuitabilityDetails".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.azureSqlDBSuitabilityDetails - = SqlAssessmentV2PaasSuitabilityData.fromJson(reader); - } else if ("isDatabaseHighlyAvailable".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.isDatabaseHighlyAvailable - = reader.getNullable(JsonReader::getBoolean); - } else if ("linkedAvailabilityGroupOverview".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.linkedAvailabilityGroupOverview - = SqlAvailabilityGroupDataOverview.fromJson(reader); - } else if ("machineArmId".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.machineArmId = reader.getString(); - } else if ("assessedSqlInstanceArmId".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.assessedSqlInstanceArmId = reader.getString(); - } else if ("machineName".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.machineName = reader.getString(); - } else if ("instanceName".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.instanceName = reader.getString(); - } else if ("databaseName".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.databaseName = reader.getString(); - } else if ("databaseSizeInMB".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.databaseSizeInMB - = reader.getNullable(JsonReader::getFloat); - } else if ("compatibilityLevel".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.compatibilityLevel - = CompatibilityLevel.fromString(reader.getString()); - } else if ("sqlDatabaseSdsArmId".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.sqlDatabaseSdsArmId = reader.getString(); - } else if ("percentageCoresUtilization".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.percentageCoresUtilization - = reader.getNullable(JsonReader::getFloat); - } else if ("megabytesPerSecondOfRead".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.megabytesPerSecondOfRead - = reader.getNullable(JsonReader::getFloat); - } else if ("megabytesPerSecondOfWrite".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.megabytesPerSecondOfWrite - = reader.getNullable(JsonReader::getFloat); - } else if ("numberOfReadOperationsPerSecond".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.numberOfReadOperationsPerSecond - = reader.getNullable(JsonReader::getFloat); - } else if ("numberOfWriteOperationsPerSecond".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.numberOfWriteOperationsPerSecond - = reader.getNullable(JsonReader::getFloat); - } else if ("confidenceRatingInPercentage".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.confidenceRatingInPercentage - = reader.getNullable(JsonReader::getFloat); - } else if ("sizingCriterion".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.sizingCriterion - = AssessmentSizingCriterion.fromString(reader.getString()); - } else if ("createdTimestamp".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.createdTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("updatedTimestamp".equals(fieldName)) { - deserializedAssessedSqlDatabaseV2Properties.updatedTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedSqlDatabaseV2Properties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV3.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV3.java new file mode 100644 index 000000000000..b0337f261bd4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV3.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlDatabaseV3Inner; + +/** + * An immutable client-side representation of AssessedSqlDatabaseV3. + */ +public interface AssessedSqlDatabaseV3 { + /** + * 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. + */ + AssessedSqlDatabaseV3Properties 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.migration.assessment.fluent.models.AssessedSqlDatabaseV3Inner object. + * + * @return the inner object. + */ + AssessedSqlDatabaseV3Inner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV3ListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV3ListResult.java new file mode 100644 index 000000000000..15774aa9f0b6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV3ListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AssessedSqlDatabaseV3Inner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AssessedSqlDatabaseV3 list operation. + */ +@Fluent +public final class AssessedSqlDatabaseV3ListResult implements JsonSerializable { + /* + * The AssessedSqlDatabaseV3 items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AssessedSqlDatabaseV3ListResult class. + */ + public AssessedSqlDatabaseV3ListResult() { + } + + /** + * Get the value property: The AssessedSqlDatabaseV3 items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AssessedSqlDatabaseV3 items on this page. + * + * @param value the value value to set. + * @return the AssessedSqlDatabaseV3ListResult object itself. + */ + public AssessedSqlDatabaseV3ListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AssessedSqlDatabaseV3ListResult object itself. + */ + public AssessedSqlDatabaseV3ListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 AssessedSqlDatabaseV3ListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AssessedSqlDatabaseV3ListResult.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 AssessedSqlDatabaseV3ListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedSqlDatabaseV3ListResult 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 AssessedSqlDatabaseV3ListResult. + */ + public static AssessedSqlDatabaseV3ListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedSqlDatabaseV3ListResult deserializedAssessedSqlDatabaseV3ListResult + = new AssessedSqlDatabaseV3ListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AssessedSqlDatabaseV3Inner.fromJson(reader1)); + deserializedAssessedSqlDatabaseV3ListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAssessedSqlDatabaseV3ListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedSqlDatabaseV3ListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV3Operations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV3Operations.java new file mode 100644 index 000000000000..74973aef762f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV3Operations.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AssessedSqlDatabaseV3Operations. + */ +public interface AssessedSqlDatabaseV3Operations { + /** + * List AssessedSqlDatabaseV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV3 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List AssessedSqlDatabaseV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlDatabaseV3 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); + + /** + * Get a AssessedSqlDatabaseV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV3 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + String assessedSqlDatabaseName, Context context); + + /** + * Get a AssessedSqlDatabaseV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlDatabaseName Sql assessment Assessed Databases 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 AssessedSqlDatabaseV3. + */ + AssessedSqlDatabaseV3 get(String resourceGroupName, String projectName, String assessmentName, + String assessedSqlDatabaseName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV3Properties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV3Properties.java new file mode 100644 index 000000000000..2ff0397a1453 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDatabaseV3Properties.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SQL database properties web model. + */ +@Immutable +public final class AssessedSqlDatabaseV3Properties implements JsonSerializable { + /* + * The workload type + */ + private MigrateWorkloadType workloadType; + + /* + * The linkages list. + */ + private List linkages; + + /* + * The recommendation list. + */ + private List recommendations; + + /* + * The sql db extended details. + */ + private SqlDbExtendedDetails extendedDetails; + + /* + * When was assessed SQL database first created. + */ + private OffsetDateTime createdTimestamp; + + /* + * When was assessed SQL database last updated. + */ + private OffsetDateTime updatedTimestamp; + + /** + * Creates an instance of AssessedSqlDatabaseV3Properties class. + */ + public AssessedSqlDatabaseV3Properties() { + } + + /** + * 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 sql db extended details. + * + * @return the extendedDetails value. + */ + public SqlDbExtendedDetails extendedDetails() { + return this.extendedDetails; + } + + /** + * Get the createdTimestamp property: When was assessed SQL database first created. + * + * @return the createdTimestamp value. + */ + public OffsetDateTime createdTimestamp() { + return this.createdTimestamp; + } + + /** + * Get the updatedTimestamp property: When was assessed SQL database 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 AssessedSqlDatabaseV3Properties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedSqlDatabaseV3Properties 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 AssessedSqlDatabaseV3Properties. + */ + public static AssessedSqlDatabaseV3Properties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedSqlDatabaseV3Properties deserializedAssessedSqlDatabaseV3Properties + = new AssessedSqlDatabaseV3Properties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("workloadType".equals(fieldName)) { + deserializedAssessedSqlDatabaseV3Properties.workloadType + = MigrateWorkloadType.fromString(reader.getString()); + } else if ("linkages".equals(fieldName)) { + List linkages = reader.readArray(reader1 -> Linkages.fromJson(reader1)); + deserializedAssessedSqlDatabaseV3Properties.linkages = linkages; + } else if ("recommendations".equals(fieldName)) { + List recommendations + = reader.readArray(reader1 -> SqlEntityRecommendations.fromJson(reader1)); + deserializedAssessedSqlDatabaseV3Properties.recommendations = recommendations; + } else if ("extendedDetails".equals(fieldName)) { + deserializedAssessedSqlDatabaseV3Properties.extendedDetails = SqlDbExtendedDetails.fromJson(reader); + } else if ("createdTimestamp".equals(fieldName)) { + deserializedAssessedSqlDatabaseV3Properties.createdTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedTimestamp".equals(fieldName)) { + deserializedAssessedSqlDatabaseV3Properties.updatedTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedSqlDatabaseV3Properties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDiskDataV3.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDiskDataV3.java new file mode 100644 index 000000000000..b64ad7b9ad1e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlDiskDataV3.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Assessed disk data for normalized contract for sql machines. + */ +@Fluent +public final class AssessedSqlDiskDataV3 implements JsonSerializable { + /* + * The disk name. + */ + private String name; + + /* + * The disk display name. + */ + private String displayName; + + /* + * Gets the gigabytes provisioned. + */ + private Float gigabytesProvisioned; + + /* + * Gets the megabytes per second of read. + */ + private Float megabytesPerSecondOfRead; + + /* + * Gets the megabytes per second of write. + */ + private Float megabytesPerSecondOfWrite; + + /* + * Gets the number of read operations per second. + */ + private Float numberOfReadOperationsPerSecond; + + /* + * Gets the number of write operations per second. + */ + private Float numberOfWriteOperationsPerSecond; + + /** + * Creates an instance of AssessedSqlDiskDataV3 class. + */ + public AssessedSqlDiskDataV3() { + } + + /** + * 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 Float gigabytesProvisioned() { + return this.gigabytesProvisioned; + } + + /** + * Set the gigabytesProvisioned property: Gets the gigabytes provisioned. + * + * @param gigabytesProvisioned the gigabytesProvisioned value to set. + * @return the AssessedSqlDiskDataV3 object itself. + */ + public AssessedSqlDiskDataV3 withGigabytesProvisioned(Float gigabytesProvisioned) { + this.gigabytesProvisioned = gigabytesProvisioned; + return this; + } + + /** + * Get the megabytesPerSecondOfRead property: Gets the megabytes per second of read. + * + * @return the megabytesPerSecondOfRead value. + */ + public Float megabytesPerSecondOfRead() { + return this.megabytesPerSecondOfRead; + } + + /** + * Set the megabytesPerSecondOfRead property: Gets the megabytes per second of read. + * + * @param megabytesPerSecondOfRead the megabytesPerSecondOfRead value to set. + * @return the AssessedSqlDiskDataV3 object itself. + */ + public AssessedSqlDiskDataV3 withMegabytesPerSecondOfRead(Float megabytesPerSecondOfRead) { + this.megabytesPerSecondOfRead = megabytesPerSecondOfRead; + return this; + } + + /** + * Get the megabytesPerSecondOfWrite property: Gets the megabytes per second of write. + * + * @return the megabytesPerSecondOfWrite value. + */ + public Float megabytesPerSecondOfWrite() { + return this.megabytesPerSecondOfWrite; + } + + /** + * Set the megabytesPerSecondOfWrite property: Gets the megabytes per second of write. + * + * @param megabytesPerSecondOfWrite the megabytesPerSecondOfWrite value to set. + * @return the AssessedSqlDiskDataV3 object itself. + */ + public AssessedSqlDiskDataV3 withMegabytesPerSecondOfWrite(Float megabytesPerSecondOfWrite) { + this.megabytesPerSecondOfWrite = megabytesPerSecondOfWrite; + return this; + } + + /** + * Get the numberOfReadOperationsPerSecond property: Gets the number of read operations per second. + * + * @return the numberOfReadOperationsPerSecond value. + */ + public Float numberOfReadOperationsPerSecond() { + return this.numberOfReadOperationsPerSecond; + } + + /** + * Set the numberOfReadOperationsPerSecond property: Gets the number of read operations per second. + * + * @param numberOfReadOperationsPerSecond the numberOfReadOperationsPerSecond value to set. + * @return the AssessedSqlDiskDataV3 object itself. + */ + public AssessedSqlDiskDataV3 withNumberOfReadOperationsPerSecond(Float numberOfReadOperationsPerSecond) { + this.numberOfReadOperationsPerSecond = numberOfReadOperationsPerSecond; + return this; + } + + /** + * Get the numberOfWriteOperationsPerSecond property: Gets the number of write operations per second. + * + * @return the numberOfWriteOperationsPerSecond value. + */ + public Float numberOfWriteOperationsPerSecond() { + return this.numberOfWriteOperationsPerSecond; + } + + /** + * Set the numberOfWriteOperationsPerSecond property: Gets the number of write operations per second. + * + * @param numberOfWriteOperationsPerSecond the numberOfWriteOperationsPerSecond value to set. + * @return the AssessedSqlDiskDataV3 object itself. + */ + public AssessedSqlDiskDataV3 withNumberOfWriteOperationsPerSecond(Float numberOfWriteOperationsPerSecond) { + this.numberOfWriteOperationsPerSecond = numberOfWriteOperationsPerSecond; + 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("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 AssessedSqlDiskDataV3 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedSqlDiskDataV3 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 AssessedSqlDiskDataV3. + */ + public static AssessedSqlDiskDataV3 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedSqlDiskDataV3 deserializedAssessedSqlDiskDataV3 = new AssessedSqlDiskDataV3(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAssessedSqlDiskDataV3.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAssessedSqlDiskDataV3.displayName = reader.getString(); + } else if ("gigabytesProvisioned".equals(fieldName)) { + deserializedAssessedSqlDiskDataV3.gigabytesProvisioned = reader.getNullable(JsonReader::getFloat); + } else if ("megabytesPerSecondOfRead".equals(fieldName)) { + deserializedAssessedSqlDiskDataV3.megabytesPerSecondOfRead + = reader.getNullable(JsonReader::getFloat); + } else if ("megabytesPerSecondOfWrite".equals(fieldName)) { + deserializedAssessedSqlDiskDataV3.megabytesPerSecondOfWrite + = reader.getNullable(JsonReader::getFloat); + } else if ("numberOfReadOperationsPerSecond".equals(fieldName)) { + deserializedAssessedSqlDiskDataV3.numberOfReadOperationsPerSecond + = reader.getNullable(JsonReader::getFloat); + } else if ("numberOfWriteOperationsPerSecond".equals(fieldName)) { + deserializedAssessedSqlDiskDataV3.numberOfWriteOperationsPerSecond + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedSqlDiskDataV3; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceSummary.java deleted file mode 100644 index a636bfd526c9..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceSummary.java +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Assessed Sql Instance Summary. - */ -@Fluent -public final class AssessedSqlInstanceSummary implements JsonSerializable { - /* - * Gets the instance id. - */ - private String instanceId; - - /* - * Gets the instance name. - */ - private String instanceName; - - /* - * Gets the instance arm id. - */ - private String sqlInstanceSdsArmId; - - /* - * Gets the instance entity id. - */ - private String sqlInstanceEntityId; - - /* - * Gets the Sql edition. - */ - private String sqlEdition; - - /* - * Gets the Sql version. - */ - private String sqlVersion; - - /* - * Gets whether Sql is clustered. - */ - private Boolean isClustered; - - /* - * Gets whether Sql is highly available. - */ - private Boolean isHighAvailabilityEnabled; - - /* - * Gets the Sql Fci state. - */ - private SqlFciState sqlFciState; - - /** - * Creates an instance of AssessedSqlInstanceSummary class. - */ - public AssessedSqlInstanceSummary() { - } - - /** - * Get the instanceId property: Gets the instance id. - * - * @return the instanceId value. - */ - public String instanceId() { - return this.instanceId; - } - - /** - * Set the instanceId property: Gets the instance id. - * - * @param instanceId the instanceId value to set. - * @return the AssessedSqlInstanceSummary object itself. - */ - public AssessedSqlInstanceSummary withInstanceId(String instanceId) { - this.instanceId = instanceId; - return this; - } - - /** - * Get the instanceName property: Gets the instance name. - * - * @return the instanceName value. - */ - public String instanceName() { - return this.instanceName; - } - - /** - * Set the instanceName property: Gets the instance name. - * - * @param instanceName the instanceName value to set. - * @return the AssessedSqlInstanceSummary object itself. - */ - public AssessedSqlInstanceSummary withInstanceName(String instanceName) { - this.instanceName = instanceName; - return this; - } - - /** - * Get the sqlInstanceSdsArmId property: Gets the instance arm id. - * - * @return the sqlInstanceSdsArmId value. - */ - public String sqlInstanceSdsArmId() { - return this.sqlInstanceSdsArmId; - } - - /** - * Set the sqlInstanceSdsArmId property: Gets the instance arm id. - * - * @param sqlInstanceSdsArmId the sqlInstanceSdsArmId value to set. - * @return the AssessedSqlInstanceSummary object itself. - */ - public AssessedSqlInstanceSummary withSqlInstanceSdsArmId(String sqlInstanceSdsArmId) { - this.sqlInstanceSdsArmId = sqlInstanceSdsArmId; - return this; - } - - /** - * Get the sqlInstanceEntityId property: Gets the instance entity id. - * - * @return the sqlInstanceEntityId value. - */ - public String sqlInstanceEntityId() { - return this.sqlInstanceEntityId; - } - - /** - * Set the sqlInstanceEntityId property: Gets the instance entity id. - * - * @param sqlInstanceEntityId the sqlInstanceEntityId value to set. - * @return the AssessedSqlInstanceSummary object itself. - */ - public AssessedSqlInstanceSummary withSqlInstanceEntityId(String sqlInstanceEntityId) { - this.sqlInstanceEntityId = sqlInstanceEntityId; - return this; - } - - /** - * Get the sqlEdition property: Gets the Sql edition. - * - * @return the sqlEdition value. - */ - public String sqlEdition() { - return this.sqlEdition; - } - - /** - * Set the sqlEdition property: Gets the Sql edition. - * - * @param sqlEdition the sqlEdition value to set. - * @return the AssessedSqlInstanceSummary object itself. - */ - public AssessedSqlInstanceSummary withSqlEdition(String sqlEdition) { - this.sqlEdition = sqlEdition; - return this; - } - - /** - * Get the sqlVersion property: Gets the Sql version. - * - * @return the sqlVersion value. - */ - public String sqlVersion() { - return this.sqlVersion; - } - - /** - * Set the sqlVersion property: Gets the Sql version. - * - * @param sqlVersion the sqlVersion value to set. - * @return the AssessedSqlInstanceSummary object itself. - */ - public AssessedSqlInstanceSummary withSqlVersion(String sqlVersion) { - this.sqlVersion = sqlVersion; - return this; - } - - /** - * Get the isClustered property: Gets whether Sql is clustered. - * - * @return the isClustered value. - */ - public Boolean isClustered() { - return this.isClustered; - } - - /** - * Set the isClustered property: Gets whether Sql is clustered. - * - * @param isClustered the isClustered value to set. - * @return the AssessedSqlInstanceSummary object itself. - */ - public AssessedSqlInstanceSummary withIsClustered(Boolean isClustered) { - this.isClustered = isClustered; - return this; - } - - /** - * Get the isHighAvailabilityEnabled property: Gets whether Sql is highly available. - * - * @return the isHighAvailabilityEnabled value. - */ - public Boolean isHighAvailabilityEnabled() { - return this.isHighAvailabilityEnabled; - } - - /** - * Set the isHighAvailabilityEnabled property: Gets whether Sql is highly available. - * - * @param isHighAvailabilityEnabled the isHighAvailabilityEnabled value to set. - * @return the AssessedSqlInstanceSummary object itself. - */ - public AssessedSqlInstanceSummary withIsHighAvailabilityEnabled(Boolean isHighAvailabilityEnabled) { - this.isHighAvailabilityEnabled = isHighAvailabilityEnabled; - return this; - } - - /** - * Get the sqlFciState property: Gets the Sql Fci state. - * - * @return the sqlFciState value. - */ - public SqlFciState sqlFciState() { - return this.sqlFciState; - } - - /** - * Set the sqlFciState property: Gets the Sql Fci state. - * - * @param sqlFciState the sqlFciState value to set. - * @return the AssessedSqlInstanceSummary object itself. - */ - public AssessedSqlInstanceSummary withSqlFciState(SqlFciState sqlFciState) { - this.sqlFciState = sqlFciState; - 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("instanceId", this.instanceId); - jsonWriter.writeStringField("instanceName", this.instanceName); - jsonWriter.writeStringField("sqlInstanceSdsArmId", this.sqlInstanceSdsArmId); - jsonWriter.writeStringField("sqlInstanceEntityId", this.sqlInstanceEntityId); - jsonWriter.writeStringField("sqlEdition", this.sqlEdition); - jsonWriter.writeStringField("sqlVersion", this.sqlVersion); - jsonWriter.writeBooleanField("isClustered", this.isClustered); - jsonWriter.writeBooleanField("isHighAvailabilityEnabled", this.isHighAvailabilityEnabled); - jsonWriter.writeStringField("sqlFciState", this.sqlFciState == null ? null : this.sqlFciState.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssessedSqlInstanceSummary from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedSqlInstanceSummary 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 AssessedSqlInstanceSummary. - */ - public static AssessedSqlInstanceSummary fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedSqlInstanceSummary deserializedAssessedSqlInstanceSummary = new AssessedSqlInstanceSummary(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("instanceId".equals(fieldName)) { - deserializedAssessedSqlInstanceSummary.instanceId = reader.getString(); - } else if ("instanceName".equals(fieldName)) { - deserializedAssessedSqlInstanceSummary.instanceName = reader.getString(); - } else if ("sqlInstanceSdsArmId".equals(fieldName)) { - deserializedAssessedSqlInstanceSummary.sqlInstanceSdsArmId = reader.getString(); - } else if ("sqlInstanceEntityId".equals(fieldName)) { - deserializedAssessedSqlInstanceSummary.sqlInstanceEntityId = reader.getString(); - } else if ("sqlEdition".equals(fieldName)) { - deserializedAssessedSqlInstanceSummary.sqlEdition = reader.getString(); - } else if ("sqlVersion".equals(fieldName)) { - deserializedAssessedSqlInstanceSummary.sqlVersion = reader.getString(); - } else if ("isClustered".equals(fieldName)) { - deserializedAssessedSqlInstanceSummary.isClustered = reader.getNullable(JsonReader::getBoolean); - } else if ("isHighAvailabilityEnabled".equals(fieldName)) { - deserializedAssessedSqlInstanceSummary.isHighAvailabilityEnabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("sqlFciState".equals(fieldName)) { - deserializedAssessedSqlInstanceSummary.sqlFciState = SqlFciState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedSqlInstanceSummary; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV2.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV2.java deleted file mode 100644 index 68fea8ce41fa..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV2.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlInstanceV2Inner; - -/** - * An immutable client-side representation of AssessedSqlInstanceV2. - */ -public interface AssessedSqlInstanceV2 { - /** - * 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. - */ - AssessedSqlInstanceV2Properties 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.migration.assessment.fluent.models.AssessedSqlInstanceV2Inner object. - * - * @return the inner object. - */ - AssessedSqlInstanceV2Inner innerModel(); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV2ListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV2ListResult.java deleted file mode 100644 index 50e91ac9c776..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV2ListResult.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -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.migration.assessment.fluent.models.AssessedSqlInstanceV2Inner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a AssessedSqlInstanceV2 list operation. - */ -@Fluent -public final class AssessedSqlInstanceV2ListResult implements JsonSerializable { - /* - * The AssessedSqlInstanceV2 items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of AssessedSqlInstanceV2ListResult class. - */ - public AssessedSqlInstanceV2ListResult() { - } - - /** - * Get the value property: The AssessedSqlInstanceV2 items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The AssessedSqlInstanceV2 items on this page. - * - * @param value the value value to set. - * @return the AssessedSqlInstanceV2ListResult object itself. - */ - public AssessedSqlInstanceV2ListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the AssessedSqlInstanceV2ListResult object itself. - */ - public AssessedSqlInstanceV2ListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * 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 AssessedSqlInstanceV2ListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AssessedSqlInstanceV2ListResult.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 AssessedSqlInstanceV2ListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedSqlInstanceV2ListResult 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 AssessedSqlInstanceV2ListResult. - */ - public static AssessedSqlInstanceV2ListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedSqlInstanceV2ListResult deserializedAssessedSqlInstanceV2ListResult - = new AssessedSqlInstanceV2ListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AssessedSqlInstanceV2Inner.fromJson(reader1)); - deserializedAssessedSqlInstanceV2ListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAssessedSqlInstanceV2ListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedSqlInstanceV2ListResult; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV2Operations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV2Operations.java deleted file mode 100644 index 5709c7d05bc8..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV2Operations.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 AssessedSqlInstanceV2Operations. - */ -public interface AssessedSqlInstanceV2Operations { - /** - * List AssessedSqlInstanceV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV2 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName); - - /** - * List AssessedSqlInstanceV2 resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV2 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context); - - /** - * Get a AssessedSqlInstanceV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV2 along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlInstanceName, Context context); - - /** - * Get a AssessedSqlInstanceV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV2. - */ - AssessedSqlInstanceV2 get(String resourceGroupName, String projectName, String groupName, String assessmentName, - String assessedSqlInstanceName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV2Properties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV2Properties.java deleted file mode 100644 index f9c08c111c2a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV2Properties.java +++ /dev/null @@ -1,577 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 SQL instance properties web model. - */ -@Immutable -public final class AssessedSqlInstanceV2Properties implements JsonSerializable { - /* - * Gets or sets the memory used by SQL instance in megabytes. - */ - private Float memoryInUseInMB; - - /* - * Gets or sets a value indicating whether SQL instance has been deep discovered. - */ - private Boolean hasScanOccurred; - - /* - * Gets or sets the recommended azure SQL target type. - */ - private TargetType recommendedAzureSqlTargetType; - - /* - * Gets or sets the recommended azure SQL suitability. - */ - private RecommendedSuitability recommendedSuitability; - - /* - * SQL instance azure SQL MI suitability details. - */ - private SqlAssessmentV2PaasSuitabilityData azureSqlMISuitabilityDetails; - - /* - * SQL instance azure SQL DB suitability details. - */ - private SqlAssessmentV2PaasSuitabilityData azureSqlDBSuitabilityDetails; - - /* - * SQL instance azure SQL VM suitability details. - */ - private SqlAssessmentV2IaasSuitabilityData azureSqlVMSuitabilityDetails; - - /* - * Gets the storage details. - */ - private List storageTypeBasedDetails; - - /* - * Gets the product support status related details. - */ - private ProductSupportStatus productSupportStatus; - - /* - * Gets the FCI metadata if this instance represents an FCI instance. - */ - private SqlFciMetadata fciMetadata; - - /* - * Gets the overview counts of availability replicas in the assessed instance, by - * commit mode and read type. - */ - private SqlAvailabilityReplicaSummary availabilityReplicaSummary; - - /* - * Gets a value indicating whether the SQL instance is clustered or not. - */ - private Boolean isClustered; - - /* - * Gets a value indicating whether the high availability is enabled or not. - */ - private Boolean isHighAvailabilityEnabled; - - /* - * Gets the list of recommended target reasoning. - */ - private List recommendedTargetReasonings; - - /* - * Machine arm id. - */ - private String machineArmId; - - /* - * Machine display name. - */ - private String machineName; - - /* - * SQL instance name. - */ - private String instanceName; - - /* - * SQL instance SDS arm id. - */ - private String sqlInstanceSdsArmId; - - /* - * SQL instance edition. - */ - private String sqlEdition; - - /* - * SQL instance version. - */ - private String sqlVersion; - - /* - * Number of CPU cores assigned to the SQL instance. - */ - private Integer numberOfCoresAllocated; - - /* - * The percentage of the total number of cores being utilized by the SQL instance. - */ - private Float percentageCoresUtilization; - - /* - * The logical disk details. - */ - private List logicalDisks; - - /* - * The databases summary. - */ - private AssessedSqlInstanceDatabaseSummary databaseSummary; - - /* - * Confidence Rating in Percentage. - */ - private Float confidenceRatingInPercentage; - - /* - * Assessment sizing criterion. - */ - private AssessmentSizingCriterion sizingCriterion; - - /* - * When was assessed SQL instance first created. - */ - private OffsetDateTime createdTimestamp; - - /* - * When was assessed SQL instance last updated. - */ - private OffsetDateTime updatedTimestamp; - - /** - * Creates an instance of AssessedSqlInstanceV2Properties class. - */ - public AssessedSqlInstanceV2Properties() { - } - - /** - * Get the memoryInUseInMB property: Gets or sets the memory used by SQL instance in megabytes. - * - * @return the memoryInUseInMB value. - */ - public Float memoryInUseInMB() { - return this.memoryInUseInMB; - } - - /** - * Get the hasScanOccurred property: Gets or sets a value indicating whether SQL instance has been deep discovered. - * - * @return the hasScanOccurred value. - */ - public Boolean hasScanOccurred() { - return this.hasScanOccurred; - } - - /** - * Get the recommendedAzureSqlTargetType property: Gets or sets the recommended azure SQL target type. - * - * @return the recommendedAzureSqlTargetType value. - */ - public TargetType recommendedAzureSqlTargetType() { - return this.recommendedAzureSqlTargetType; - } - - /** - * Get the recommendedSuitability property: Gets or sets the recommended azure SQL suitability. - * - * @return the recommendedSuitability value. - */ - public RecommendedSuitability recommendedSuitability() { - return this.recommendedSuitability; - } - - /** - * Get the azureSqlMISuitabilityDetails property: SQL instance azure SQL MI suitability details. - * - * @return the azureSqlMISuitabilityDetails value. - */ - public SqlAssessmentV2PaasSuitabilityData azureSqlMISuitabilityDetails() { - return this.azureSqlMISuitabilityDetails; - } - - /** - * Get the azureSqlDBSuitabilityDetails property: SQL instance azure SQL DB suitability details. - * - * @return the azureSqlDBSuitabilityDetails value. - */ - public SqlAssessmentV2PaasSuitabilityData azureSqlDBSuitabilityDetails() { - return this.azureSqlDBSuitabilityDetails; - } - - /** - * Get the azureSqlVMSuitabilityDetails property: SQL instance azure SQL VM suitability details. - * - * @return the azureSqlVMSuitabilityDetails value. - */ - public SqlAssessmentV2IaasSuitabilityData azureSqlVMSuitabilityDetails() { - return this.azureSqlVMSuitabilityDetails; - } - - /** - * Get the storageTypeBasedDetails property: Gets the storage details. - * - * @return the storageTypeBasedDetails value. - */ - public List storageTypeBasedDetails() { - return this.storageTypeBasedDetails; - } - - /** - * Get the productSupportStatus property: Gets the product support status related details. - * - * @return the productSupportStatus value. - */ - public ProductSupportStatus productSupportStatus() { - return this.productSupportStatus; - } - - /** - * Get the fciMetadata property: Gets the FCI metadata if this instance represents an FCI instance. - * - * @return the fciMetadata value. - */ - public SqlFciMetadata fciMetadata() { - return this.fciMetadata; - } - - /** - * Get the availabilityReplicaSummary property: Gets the overview counts of availability replicas in the assessed - * instance, by - * commit mode and read type. - * - * @return the availabilityReplicaSummary value. - */ - public SqlAvailabilityReplicaSummary availabilityReplicaSummary() { - return this.availabilityReplicaSummary; - } - - /** - * Get the isClustered property: Gets a value indicating whether the SQL instance is clustered or not. - * - * @return the isClustered value. - */ - public Boolean isClustered() { - return this.isClustered; - } - - /** - * Get the isHighAvailabilityEnabled property: Gets a value indicating whether the high availability is enabled or - * not. - * - * @return the isHighAvailabilityEnabled value. - */ - public Boolean isHighAvailabilityEnabled() { - return this.isHighAvailabilityEnabled; - } - - /** - * Get the recommendedTargetReasonings property: Gets the list of recommended target reasoning. - * - * @return the recommendedTargetReasonings value. - */ - public List recommendedTargetReasonings() { - return this.recommendedTargetReasonings; - } - - /** - * Get the machineArmId property: Machine arm id. - * - * @return the machineArmId value. - */ - public String machineArmId() { - return this.machineArmId; - } - - /** - * Get the machineName property: Machine display name. - * - * @return the machineName value. - */ - public String machineName() { - return this.machineName; - } - - /** - * Get the instanceName property: SQL instance name. - * - * @return the instanceName value. - */ - public String instanceName() { - return this.instanceName; - } - - /** - * Get the sqlInstanceSdsArmId property: SQL instance SDS arm id. - * - * @return the sqlInstanceSdsArmId value. - */ - public String sqlInstanceSdsArmId() { - return this.sqlInstanceSdsArmId; - } - - /** - * Get the sqlEdition property: SQL instance edition. - * - * @return the sqlEdition value. - */ - public String sqlEdition() { - return this.sqlEdition; - } - - /** - * Get the sqlVersion property: SQL instance version. - * - * @return the sqlVersion value. - */ - public String sqlVersion() { - return this.sqlVersion; - } - - /** - * Get the numberOfCoresAllocated property: Number of CPU cores assigned to the SQL instance. - * - * @return the numberOfCoresAllocated value. - */ - public Integer numberOfCoresAllocated() { - return this.numberOfCoresAllocated; - } - - /** - * Get the percentageCoresUtilization property: The percentage of the total number of cores being utilized by the - * SQL instance. - * - * @return the percentageCoresUtilization value. - */ - public Float percentageCoresUtilization() { - return this.percentageCoresUtilization; - } - - /** - * Get the logicalDisks property: The logical disk details. - * - * @return the logicalDisks value. - */ - public List logicalDisks() { - return this.logicalDisks; - } - - /** - * Get the databaseSummary property: The databases summary. - * - * @return the databaseSummary value. - */ - public AssessedSqlInstanceDatabaseSummary databaseSummary() { - return this.databaseSummary; - } - - /** - * Get the confidenceRatingInPercentage property: Confidence Rating in Percentage. - * - * @return the confidenceRatingInPercentage value. - */ - public Float confidenceRatingInPercentage() { - return this.confidenceRatingInPercentage; - } - - /** - * Get the sizingCriterion property: Assessment sizing criterion. - * - * @return the sizingCriterion value. - */ - public AssessmentSizingCriterion sizingCriterion() { - return this.sizingCriterion; - } - - /** - * Get the createdTimestamp property: When was assessed SQL instance first created. - * - * @return the createdTimestamp value. - */ - public OffsetDateTime createdTimestamp() { - return this.createdTimestamp; - } - - /** - * Get the updatedTimestamp property: When was assessed SQL instance 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 (azureSqlMISuitabilityDetails() != null) { - azureSqlMISuitabilityDetails().validate(); - } - if (azureSqlDBSuitabilityDetails() != null) { - azureSqlDBSuitabilityDetails().validate(); - } - if (azureSqlVMSuitabilityDetails() != null) { - azureSqlVMSuitabilityDetails().validate(); - } - if (storageTypeBasedDetails() != null) { - storageTypeBasedDetails().forEach(e -> e.validate()); - } - if (productSupportStatus() != null) { - productSupportStatus().validate(); - } - if (fciMetadata() != null) { - fciMetadata().validate(); - } - if (availabilityReplicaSummary() != null) { - availabilityReplicaSummary().validate(); - } - if (recommendedTargetReasonings() != null) { - recommendedTargetReasonings().forEach(e -> e.validate()); - } - if (logicalDisks() != null) { - logicalDisks().forEach(e -> e.validate()); - } - if (databaseSummary() != null) { - databaseSummary().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssessedSqlInstanceV2Properties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedSqlInstanceV2Properties 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 AssessedSqlInstanceV2Properties. - */ - public static AssessedSqlInstanceV2Properties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedSqlInstanceV2Properties deserializedAssessedSqlInstanceV2Properties - = new AssessedSqlInstanceV2Properties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("memoryInUseInMB".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.memoryInUseInMB - = reader.getNullable(JsonReader::getFloat); - } else if ("hasScanOccurred".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.hasScanOccurred - = reader.getNullable(JsonReader::getBoolean); - } else if ("recommendedAzureSqlTargetType".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.recommendedAzureSqlTargetType - = TargetType.fromString(reader.getString()); - } else if ("recommendedSuitability".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.recommendedSuitability - = RecommendedSuitability.fromString(reader.getString()); - } else if ("azureSqlMISuitabilityDetails".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.azureSqlMISuitabilityDetails - = SqlAssessmentV2PaasSuitabilityData.fromJson(reader); - } else if ("azureSqlDBSuitabilityDetails".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.azureSqlDBSuitabilityDetails - = SqlAssessmentV2PaasSuitabilityData.fromJson(reader); - } else if ("azureSqlVMSuitabilityDetails".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.azureSqlVMSuitabilityDetails - = SqlAssessmentV2IaasSuitabilityData.fromJson(reader); - } else if ("storageTypeBasedDetails".equals(fieldName)) { - List storageTypeBasedDetails - = reader.readArray(reader1 -> AssessedSqlInstanceStorageDetails.fromJson(reader1)); - deserializedAssessedSqlInstanceV2Properties.storageTypeBasedDetails = storageTypeBasedDetails; - } else if ("productSupportStatus".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.productSupportStatus - = ProductSupportStatus.fromJson(reader); - } else if ("fciMetadata".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.fciMetadata = SqlFciMetadata.fromJson(reader); - } else if ("availabilityReplicaSummary".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.availabilityReplicaSummary - = SqlAvailabilityReplicaSummary.fromJson(reader); - } else if ("isClustered".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.isClustered - = reader.getNullable(JsonReader::getBoolean); - } else if ("isHighAvailabilityEnabled".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.isHighAvailabilityEnabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("recommendedTargetReasonings".equals(fieldName)) { - List recommendedTargetReasonings - = reader.readArray(reader1 -> SqlRecommendationReasoning.fromJson(reader1)); - deserializedAssessedSqlInstanceV2Properties.recommendedTargetReasonings - = recommendedTargetReasonings; - } else if ("machineArmId".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.machineArmId = reader.getString(); - } else if ("machineName".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.machineName = reader.getString(); - } else if ("instanceName".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.instanceName = reader.getString(); - } else if ("sqlInstanceSdsArmId".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.sqlInstanceSdsArmId = reader.getString(); - } else if ("sqlEdition".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.sqlEdition = reader.getString(); - } else if ("sqlVersion".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.sqlVersion = reader.getString(); - } else if ("numberOfCoresAllocated".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.numberOfCoresAllocated - = reader.getNullable(JsonReader::getInt); - } else if ("percentageCoresUtilization".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.percentageCoresUtilization - = reader.getNullable(JsonReader::getFloat); - } else if ("logicalDisks".equals(fieldName)) { - List logicalDisks - = reader.readArray(reader1 -> AssessedSqlInstanceDiskDetails.fromJson(reader1)); - deserializedAssessedSqlInstanceV2Properties.logicalDisks = logicalDisks; - } else if ("databaseSummary".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.databaseSummary - = AssessedSqlInstanceDatabaseSummary.fromJson(reader); - } else if ("confidenceRatingInPercentage".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.confidenceRatingInPercentage - = reader.getNullable(JsonReader::getFloat); - } else if ("sizingCriterion".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.sizingCriterion - = AssessmentSizingCriterion.fromString(reader.getString()); - } else if ("createdTimestamp".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.createdTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("updatedTimestamp".equals(fieldName)) { - deserializedAssessedSqlInstanceV2Properties.updatedTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedSqlInstanceV2Properties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV3.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV3.java new file mode 100644 index 000000000000..21e7b9e27a31 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV3.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlInstanceV3Inner; + +/** + * An immutable client-side representation of AssessedSqlInstanceV3. + */ +public interface AssessedSqlInstanceV3 { + /** + * 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. + */ + AssessedSqlInstanceV3Properties 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.migration.assessment.fluent.models.AssessedSqlInstanceV3Inner object. + * + * @return the inner object. + */ + AssessedSqlInstanceV3Inner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV3ListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV3ListResult.java new file mode 100644 index 000000000000..3a1ba46f2102 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV3ListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AssessedSqlInstanceV3Inner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AssessedSqlInstanceV3 list operation. + */ +@Fluent +public final class AssessedSqlInstanceV3ListResult implements JsonSerializable { + /* + * The AssessedSqlInstanceV3 items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AssessedSqlInstanceV3ListResult class. + */ + public AssessedSqlInstanceV3ListResult() { + } + + /** + * Get the value property: The AssessedSqlInstanceV3 items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AssessedSqlInstanceV3 items on this page. + * + * @param value the value value to set. + * @return the AssessedSqlInstanceV3ListResult object itself. + */ + public AssessedSqlInstanceV3ListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AssessedSqlInstanceV3ListResult object itself. + */ + public AssessedSqlInstanceV3ListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 AssessedSqlInstanceV3ListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AssessedSqlInstanceV3ListResult.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 AssessedSqlInstanceV3ListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedSqlInstanceV3ListResult 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 AssessedSqlInstanceV3ListResult. + */ + public static AssessedSqlInstanceV3ListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedSqlInstanceV3ListResult deserializedAssessedSqlInstanceV3ListResult + = new AssessedSqlInstanceV3ListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AssessedSqlInstanceV3Inner.fromJson(reader1)); + deserializedAssessedSqlInstanceV3ListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAssessedSqlInstanceV3ListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedSqlInstanceV3ListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV3Operations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV3Operations.java new file mode 100644 index 000000000000..585c7b421ac7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV3Operations.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AssessedSqlInstanceV3Operations. + */ +public interface AssessedSqlInstanceV3Operations { + /** + * List AssessedSqlInstanceV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV3 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List AssessedSqlInstanceV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlInstanceV3 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); + + /** + * Get a AssessedSqlInstanceV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV3 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + String assessedSqlInstanceName, Context context); + + /** + * Get a AssessedSqlInstanceV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlInstanceName Sql assessment Assessed Instance 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 AssessedSqlInstanceV3. + */ + AssessedSqlInstanceV3 get(String resourceGroupName, String projectName, String assessmentName, + String assessedSqlInstanceName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV3Properties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV3Properties.java new file mode 100644 index 000000000000..2fb0a9947fad --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlInstanceV3Properties.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SQL instance properties web model. + */ +@Immutable +public final class AssessedSqlInstanceV3Properties implements JsonSerializable { + /* + * The workload type + */ + private MigrateWorkloadType workloadType; + + /* + * The linkages list. + */ + private List linkages; + + /* + * The recommendation list. + */ + private List recommendations; + + /* + * The sql instance extended details. + */ + private SqlInstanceExtendedDetails extendedDetails; + + /* + * When was assessed SQL instance first created. + */ + private OffsetDateTime createdTimestamp; + + /* + * When was assessed SQL instance last updated. + */ + private OffsetDateTime updatedTimestamp; + + /** + * Creates an instance of AssessedSqlInstanceV3Properties class. + */ + public AssessedSqlInstanceV3Properties() { + } + + /** + * 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 sql instance extended details. + * + * @return the extendedDetails value. + */ + public SqlInstanceExtendedDetails extendedDetails() { + return this.extendedDetails; + } + + /** + * Get the createdTimestamp property: When was assessed SQL instance first created. + * + * @return the createdTimestamp value. + */ + public OffsetDateTime createdTimestamp() { + return this.createdTimestamp; + } + + /** + * Get the updatedTimestamp property: When was assessed SQL instance 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 AssessedSqlInstanceV3Properties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedSqlInstanceV3Properties 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 AssessedSqlInstanceV3Properties. + */ + public static AssessedSqlInstanceV3Properties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedSqlInstanceV3Properties deserializedAssessedSqlInstanceV3Properties + = new AssessedSqlInstanceV3Properties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("workloadType".equals(fieldName)) { + deserializedAssessedSqlInstanceV3Properties.workloadType + = MigrateWorkloadType.fromString(reader.getString()); + } else if ("linkages".equals(fieldName)) { + List linkages = reader.readArray(reader1 -> Linkages.fromJson(reader1)); + deserializedAssessedSqlInstanceV3Properties.linkages = linkages; + } else if ("recommendations".equals(fieldName)) { + List recommendations + = reader.readArray(reader1 -> SqlEntityRecommendations.fromJson(reader1)); + deserializedAssessedSqlInstanceV3Properties.recommendations = recommendations; + } else if ("extendedDetails".equals(fieldName)) { + deserializedAssessedSqlInstanceV3Properties.extendedDetails + = SqlInstanceExtendedDetails.fromJson(reader); + } else if ("createdTimestamp".equals(fieldName)) { + deserializedAssessedSqlInstanceV3Properties.createdTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedTimestamp".equals(fieldName)) { + deserializedAssessedSqlInstanceV3Properties.updatedTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedSqlInstanceV3Properties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachine.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachine.java deleted file mode 100644 index d51e0cced912..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachine.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlMachineInner; - -/** - * An immutable client-side representation of AssessedSqlMachine. - */ -public interface AssessedSqlMachine { - /** - * 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. - */ - AssessedSqlMachineProperties 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.migration.assessment.fluent.models.AssessedSqlMachineInner object. - * - * @return the inner object. - */ - AssessedSqlMachineInner innerModel(); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachineListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachineListResult.java deleted file mode 100644 index fa6d5734dbf6..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachineListResult.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -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.migration.assessment.fluent.models.AssessedSqlMachineInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a AssessedSqlMachine list operation. - */ -@Fluent -public final class AssessedSqlMachineListResult implements JsonSerializable { - /* - * The AssessedSqlMachine items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of AssessedSqlMachineListResult class. - */ - public AssessedSqlMachineListResult() { - } - - /** - * Get the value property: The AssessedSqlMachine items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The AssessedSqlMachine items on this page. - * - * @param value the value value to set. - * @return the AssessedSqlMachineListResult object itself. - */ - public AssessedSqlMachineListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the AssessedSqlMachineListResult object itself. - */ - public AssessedSqlMachineListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * 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 AssessedSqlMachineListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AssessedSqlMachineListResult.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 AssessedSqlMachineListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedSqlMachineListResult 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 AssessedSqlMachineListResult. - */ - public static AssessedSqlMachineListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedSqlMachineListResult deserializedAssessedSqlMachineListResult = new AssessedSqlMachineListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AssessedSqlMachineInner.fromJson(reader1)); - deserializedAssessedSqlMachineListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAssessedSqlMachineListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedSqlMachineListResult; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachineProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachineProperties.java deleted file mode 100644 index 2861eb6fb9d0..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachineProperties.java +++ /dev/null @@ -1,760 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.util.List; -import java.util.Map; - -/** - * Assessed SQL machine properties. - */ -@Fluent -public final class AssessedSqlMachineProperties implements JsonSerializable { - /* - * Gets or sets the BIOS GUID for the machine. - */ - private String biosGuid; - - /* - * Gets or sets the FQDN for the machine. - */ - private String fqdn; - - /* - * Gets the list of SQL instances discovered on the machine. - */ - private List sqlInstances; - - /* - * Gets or sets the detailed messages that were set on the machine during - * evaluation. - */ - private AzureVmSuitabilityDetail suitabilityDetail; - - /* - * Gets or sets the explanation if machine is not suitable for cloud. - */ - private AzureVmSuitabilityExplanation suitabilityExplanation; - - /* - * Gets or sets the Recommended Azure Size for the machine. - */ - private AzureVmSize recommendedVmSize; - - /* - * Gets or sets the Recommended Azure VM Family for the machine. - */ - private AzureVmFamily recommendedVmFamily; - - /* - * Gets the product support status related details. - */ - private ProductSupportStatus productSupportStatus; - - /* - * Gets or sets the Number of cores for recommended size. - */ - private Integer recommendedVmSizeNumberOfCores; - - /* - * Gets or sets the Megabytes of memory for recommended size. - */ - private Float recommendedVmSizeMegabytesOfMemory; - - /* - * Gets or sets the monthly compute cost calculated for recommended size. - */ - private Float monthlyComputeCost; - - /* - * Gets the list of data disks that were assessed as part of this assessment. - */ - private Map disks; - - /* - * Gets the list of network adapters that were assessed as part of this assessment. - */ - private Map networkAdapters; - - /* - * Gets or sets the monthly networking cost. - */ - private Float monthlyBandwidthCost; - - /* - * Gets or sets the monthly total storage cost. - */ - private Float monthlyStorageCost; - - /* - * Gets the collection of cost components. - */ - private List costComponents; - - /* - * Gets the suitability for Microsoft cloud defender. - */ - private CloudSuitability securitySuitability; - - /* - * Gets the list of migration guidelines applicable. - */ - private List migrationGuidelines; - - /* - * 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; - - /* - * When was machine first created. - */ - private OffsetDateTime createdTimestamp; - - /* - * When was machine last updated. - */ - private OffsetDateTime updatedTimestamp; - - /* - * Display Name of the Machine. - */ - private String displayName; - - /* - * Assessed machine type. - */ - private AssessedMachineType type; - - /* - * Description for the machine. - */ - private String description; - - /* - * Data center machine ARM id. - */ - private String datacenterMachineArmId; - - /* - * Data center management server ARM id. - */ - private String datacenterManagementServerArmId; - - /* - * Data center management server name. - */ - private String datacenterManagementServerName; - - /* - * Megabytes of memory found allocated for the machine in private data center. - */ - private Float megabytesOfMemory; - - /* - * Number of CPU cores found on the machine. - */ - private Integer numberOfCores; - - /* - * Confidence Rating in Percentage. - */ - private Float confidenceRatingInPercentage; - - /* - * Percentile of Percentage of Cores Utilized noted during time period T. - * - * Here N and T are settings on Assessment. - */ - private Float percentageCoresUtilization; - - /* - * Percentile of Percentage of Memory Utilized noted during time period T. - * - * Here N and T are settings on Assessment. - */ - private Float percentageMemoryUtilization; - - /* - * Gets a value indicating whether machine is suitable for the cloud platform - * selected. - */ - private CloudSuitability suitability; - - /* - * Assessment sizing criterion. - */ - private AssessmentSizingCriterion sizingCriterion; - - /** - * Creates an instance of AssessedSqlMachineProperties class. - */ - public AssessedSqlMachineProperties() { - } - - /** - * Get the biosGuid property: Gets or sets the BIOS GUID for the machine. - * - * @return the biosGuid value. - */ - public String biosGuid() { - return this.biosGuid; - } - - /** - * Get the fqdn property: Gets or sets the FQDN for the machine. - * - * @return the fqdn value. - */ - public String fqdn() { - return this.fqdn; - } - - /** - * Get the sqlInstances property: Gets the list of SQL instances discovered on the machine. - * - * @return the sqlInstances value. - */ - public List sqlInstances() { - return this.sqlInstances; - } - - /** - * Get the suitabilityDetail property: Gets or sets the detailed messages that were set on the machine during - * evaluation. - * - * @return the suitabilityDetail value. - */ - public AzureVmSuitabilityDetail suitabilityDetail() { - return this.suitabilityDetail; - } - - /** - * Get the suitabilityExplanation property: Gets or sets the explanation if machine is not suitable for cloud. - * - * @return the suitabilityExplanation value. - */ - public AzureVmSuitabilityExplanation suitabilityExplanation() { - return this.suitabilityExplanation; - } - - /** - * Get the recommendedVmSize property: Gets or sets the Recommended Azure Size for the machine. - * - * @return the recommendedVmSize value. - */ - public AzureVmSize recommendedVmSize() { - return this.recommendedVmSize; - } - - /** - * Get the recommendedVmFamily property: Gets or sets the Recommended Azure VM Family for the machine. - * - * @return the recommendedVmFamily value. - */ - public AzureVmFamily recommendedVmFamily() { - return this.recommendedVmFamily; - } - - /** - * Get the productSupportStatus property: Gets the product support status related details. - * - * @return the productSupportStatus value. - */ - public ProductSupportStatus productSupportStatus() { - return this.productSupportStatus; - } - - /** - * Get the recommendedVmSizeNumberOfCores property: Gets or sets the Number of cores for recommended size. - * - * @return the recommendedVmSizeNumberOfCores value. - */ - public Integer recommendedVmSizeNumberOfCores() { - return this.recommendedVmSizeNumberOfCores; - } - - /** - * Get the recommendedVmSizeMegabytesOfMemory property: Gets or sets the Megabytes of memory for recommended size. - * - * @return the recommendedVmSizeMegabytesOfMemory value. - */ - public Float recommendedVmSizeMegabytesOfMemory() { - return this.recommendedVmSizeMegabytesOfMemory; - } - - /** - * Get the monthlyComputeCost property: Gets or sets the monthly compute cost calculated for recommended size. - * - * @return the monthlyComputeCost value. - */ - public Float monthlyComputeCost() { - return this.monthlyComputeCost; - } - - /** - * Get the disks property: Gets the list of data disks that were assessed as part of this assessment. - * - * @return the disks value. - */ - public Map disks() { - return this.disks; - } - - /** - * Get the networkAdapters property: Gets the list of network adapters that were assessed as part of this - * assessment. - * - * @return the networkAdapters value. - */ - public Map networkAdapters() { - return this.networkAdapters; - } - - /** - * Get the monthlyBandwidthCost property: Gets or sets the monthly networking cost. - * - * @return the monthlyBandwidthCost value. - */ - public Float monthlyBandwidthCost() { - return this.monthlyBandwidthCost; - } - - /** - * Get the monthlyStorageCost property: Gets or sets the monthly total storage cost. - * - * @return the monthlyStorageCost value. - */ - public Float monthlyStorageCost() { - return this.monthlyStorageCost; - } - - /** - * Get the costComponents property: Gets the collection of cost components. - * - * @return the costComponents value. - */ - public List costComponents() { - return this.costComponents; - } - - /** - * Set the costComponents property: Gets the collection of cost components. - * - * @param costComponents the costComponents value to set. - * @return the AssessedSqlMachineProperties object itself. - */ - public AssessedSqlMachineProperties withCostComponents(List costComponents) { - this.costComponents = costComponents; - return this; - } - - /** - * Get the securitySuitability property: Gets the suitability for Microsoft cloud defender. - * - * @return the securitySuitability value. - */ - public CloudSuitability securitySuitability() { - return this.securitySuitability; - } - - /** - * Get the migrationGuidelines property: Gets the list of migration guidelines applicable. - * - * @return the migrationGuidelines value. - */ - public List migrationGuidelines() { - return this.migrationGuidelines; - } - - /** - * 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 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; - } - - /** - * Get the displayName property: Display Name of the Machine. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the type property: Assessed machine type. - * - * @return the type value. - */ - public AssessedMachineType type() { - return this.type; - } - - /** - * Get the description property: Description for the machine. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the datacenterMachineArmId property: Data center machine ARM id. - * - * @return the datacenterMachineArmId value. - */ - public String datacenterMachineArmId() { - return this.datacenterMachineArmId; - } - - /** - * Get the datacenterManagementServerArmId property: Data center management server ARM id. - * - * @return the datacenterManagementServerArmId value. - */ - public String datacenterManagementServerArmId() { - return this.datacenterManagementServerArmId; - } - - /** - * Get the datacenterManagementServerName property: Data center management server name. - * - * @return the datacenterManagementServerName value. - */ - public String datacenterManagementServerName() { - return this.datacenterManagementServerName; - } - - /** - * Get the megabytesOfMemory property: Megabytes of memory found allocated for the machine in private data center. - * - * @return the megabytesOfMemory value. - */ - public Float 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 confidenceRatingInPercentage property: Confidence Rating in Percentage. - * - * @return the confidenceRatingInPercentage value. - */ - public Float confidenceRatingInPercentage() { - return this.confidenceRatingInPercentage; - } - - /** - * 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 Float 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 Float percentageMemoryUtilization() { - return this.percentageMemoryUtilization; - } - - /** - * Get the suitability property: Gets a value indicating whether machine is suitable for the cloud platform - * selected. - * - * @return the suitability value. - */ - public CloudSuitability suitability() { - return this.suitability; - } - - /** - * Get the sizingCriterion property: Assessment sizing criterion. - * - * @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() { - if (sqlInstances() != null) { - sqlInstances().forEach(e -> e.validate()); - } - if (productSupportStatus() != null) { - productSupportStatus().validate(); - } - if (disks() != null) { - disks().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - if (networkAdapters() != null) { - networkAdapters().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - if (costComponents() != null) { - costComponents().forEach(e -> e.validate()); - } - if (migrationGuidelines() != null) { - migrationGuidelines().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("costComponents", this.costComponents, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssessedSqlMachineProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedSqlMachineProperties 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 AssessedSqlMachineProperties. - */ - public static AssessedSqlMachineProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedSqlMachineProperties deserializedAssessedSqlMachineProperties = new AssessedSqlMachineProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("biosGuid".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.biosGuid = reader.getString(); - } else if ("fqdn".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.fqdn = reader.getString(); - } else if ("sqlInstances".equals(fieldName)) { - List sqlInstances - = reader.readArray(reader1 -> AssessedSqlInstanceSummary.fromJson(reader1)); - deserializedAssessedSqlMachineProperties.sqlInstances = sqlInstances; - } else if ("suitabilityDetail".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.suitabilityDetail - = AzureVmSuitabilityDetail.fromString(reader.getString()); - } else if ("suitabilityExplanation".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.suitabilityExplanation - = AzureVmSuitabilityExplanation.fromString(reader.getString()); - } else if ("recommendedVmSize".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.recommendedVmSize - = AzureVmSize.fromString(reader.getString()); - } else if ("recommendedVmFamily".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.recommendedVmFamily - = AzureVmFamily.fromString(reader.getString()); - } else if ("productSupportStatus".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.productSupportStatus - = ProductSupportStatus.fromJson(reader); - } else if ("recommendedVmSizeNumberOfCores".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.recommendedVmSizeNumberOfCores - = reader.getNullable(JsonReader::getInt); - } else if ("recommendedVmSizeMegabytesOfMemory".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.recommendedVmSizeMegabytesOfMemory - = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyComputeCost".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.monthlyComputeCost - = reader.getNullable(JsonReader::getFloat); - } else if ("disks".equals(fieldName)) { - Map disks = reader.readMap(reader1 -> AssessedDiskData.fromJson(reader1)); - deserializedAssessedSqlMachineProperties.disks = disks; - } else if ("networkAdapters".equals(fieldName)) { - Map networkAdapters - = reader.readMap(reader1 -> SqlAssessedNetworkAdapter.fromJson(reader1)); - deserializedAssessedSqlMachineProperties.networkAdapters = networkAdapters; - } else if ("monthlyBandwidthCost".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.monthlyBandwidthCost - = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyStorageCost".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.monthlyStorageCost - = reader.getNullable(JsonReader::getFloat); - } else if ("costComponents".equals(fieldName)) { - List costComponents = reader.readArray(reader1 -> CostComponent.fromJson(reader1)); - deserializedAssessedSqlMachineProperties.costComponents = costComponents; - } else if ("securitySuitability".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.securitySuitability - = CloudSuitability.fromString(reader.getString()); - } else if ("migrationGuidelines".equals(fieldName)) { - List migrationGuidelines - = reader.readArray(reader1 -> SqlMigrationGuideline.fromJson(reader1)); - deserializedAssessedSqlMachineProperties.migrationGuidelines = migrationGuidelines; - } else if ("bootType".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.bootType = MachineBootType.fromString(reader.getString()); - } else if ("operatingSystemType".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.operatingSystemType = reader.getString(); - } else if ("operatingSystemName".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.operatingSystemName = reader.getString(); - } else if ("operatingSystemVersion".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.operatingSystemVersion = reader.getString(); - } else if ("operatingSystemArchitecture".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.operatingSystemArchitecture - = GuestOperatingSystemArchitecture.fromString(reader.getString()); - } else if ("createdTimestamp".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.createdTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("updatedTimestamp".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.updatedTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("displayName".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.displayName = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.type = AssessedMachineType.fromString(reader.getString()); - } else if ("description".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.description = reader.getString(); - } else if ("datacenterMachineArmId".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.datacenterMachineArmId = reader.getString(); - } else if ("datacenterManagementServerArmId".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.datacenterManagementServerArmId = reader.getString(); - } else if ("datacenterManagementServerName".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.datacenterManagementServerName = reader.getString(); - } else if ("megabytesOfMemory".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.megabytesOfMemory - = reader.getNullable(JsonReader::getFloat); - } else if ("numberOfCores".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.numberOfCores = reader.getNullable(JsonReader::getInt); - } else if ("confidenceRatingInPercentage".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.confidenceRatingInPercentage - = reader.getNullable(JsonReader::getFloat); - } else if ("percentageCoresUtilization".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.percentageCoresUtilization - = reader.getNullable(JsonReader::getFloat); - } else if ("percentageMemoryUtilization".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.percentageMemoryUtilization - = reader.getNullable(JsonReader::getFloat); - } else if ("suitability".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.suitability - = CloudSuitability.fromString(reader.getString()); - } else if ("sizingCriterion".equals(fieldName)) { - deserializedAssessedSqlMachineProperties.sizingCriterion - = AssessmentSizingCriterion.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedSqlMachineProperties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachineV3.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachineV3.java new file mode 100644 index 000000000000..419c5fe1c89e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachineV3.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlMachineV3Inner; + +/** + * An immutable client-side representation of AssessedSqlMachineV3. + */ +public interface AssessedSqlMachineV3 { + /** + * 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. + */ + AssessedSqlMachineV3Properties 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.migration.assessment.fluent.models.AssessedSqlMachineV3Inner object. + * + * @return the inner object. + */ + AssessedSqlMachineV3Inner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachineV3ListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachineV3ListResult.java new file mode 100644 index 000000000000..5a4b7b161d57 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachineV3ListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AssessedSqlMachineV3Inner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AssessedSqlMachineV3 list operation. + */ +@Fluent +public final class AssessedSqlMachineV3ListResult implements JsonSerializable { + /* + * The AssessedSqlMachineV3 items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AssessedSqlMachineV3ListResult class. + */ + public AssessedSqlMachineV3ListResult() { + } + + /** + * Get the value property: The AssessedSqlMachineV3 items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AssessedSqlMachineV3 items on this page. + * + * @param value the value value to set. + * @return the AssessedSqlMachineV3ListResult object itself. + */ + public AssessedSqlMachineV3ListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AssessedSqlMachineV3ListResult object itself. + */ + public AssessedSqlMachineV3ListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 AssessedSqlMachineV3ListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AssessedSqlMachineV3ListResult.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 AssessedSqlMachineV3ListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedSqlMachineV3ListResult 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 AssessedSqlMachineV3ListResult. + */ + public static AssessedSqlMachineV3ListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedSqlMachineV3ListResult deserializedAssessedSqlMachineV3ListResult + = new AssessedSqlMachineV3ListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AssessedSqlMachineV3Inner.fromJson(reader1)); + deserializedAssessedSqlMachineV3ListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAssessedSqlMachineV3ListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedSqlMachineV3ListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachineV3Properties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachineV3Properties.java new file mode 100644 index 000000000000..df779e1af26e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachineV3Properties.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SQL machine properties. + */ +@Immutable +public final class AssessedSqlMachineV3Properties implements JsonSerializable { + /* + * The workload type + */ + private MigrateWorkloadType workloadType; + + /* + * The linkages list. + */ + private List linkages; + + /* + * The recommendation list. + */ + private List recommendations; + + /* + * The sql instance extended details. + */ + private SqlMachineExtendedDetails extendedDetails; + + /* + * Assessed machine type. + */ + private AssessedMachineType assessedMachineType; + + /* + * When was machine first created. + */ + private OffsetDateTime createdTimestamp; + + /* + * When was machine last updated. + */ + private OffsetDateTime updatedTimestamp; + + /** + * Creates an instance of AssessedSqlMachineV3Properties class. + */ + public AssessedSqlMachineV3Properties() { + } + + /** + * 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 sql instance extended details. + * + * @return the extendedDetails value. + */ + public SqlMachineExtendedDetails extendedDetails() { + return this.extendedDetails; + } + + /** + * Get the assessedMachineType property: Assessed machine type. + * + * @return the assessedMachineType value. + */ + public AssessedMachineType assessedMachineType() { + return this.assessedMachineType; + } + + /** + * 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 AssessedSqlMachineV3Properties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedSqlMachineV3Properties 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 AssessedSqlMachineV3Properties. + */ + public static AssessedSqlMachineV3Properties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedSqlMachineV3Properties deserializedAssessedSqlMachineV3Properties + = new AssessedSqlMachineV3Properties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("workloadType".equals(fieldName)) { + deserializedAssessedSqlMachineV3Properties.workloadType + = MigrateWorkloadType.fromString(reader.getString()); + } else if ("linkages".equals(fieldName)) { + List linkages = reader.readArray(reader1 -> Linkages.fromJson(reader1)); + deserializedAssessedSqlMachineV3Properties.linkages = linkages; + } else if ("recommendations".equals(fieldName)) { + List recommendations + = reader.readArray(reader1 -> SqlMachineRecommendations.fromJson(reader1)); + deserializedAssessedSqlMachineV3Properties.recommendations = recommendations; + } else if ("extendedDetails".equals(fieldName)) { + deserializedAssessedSqlMachineV3Properties.extendedDetails + = SqlMachineExtendedDetails.fromJson(reader); + } else if ("assessedMachineType".equals(fieldName)) { + deserializedAssessedSqlMachineV3Properties.assessedMachineType + = AssessedMachineType.fromString(reader.getString()); + } else if ("createdTimestamp".equals(fieldName)) { + deserializedAssessedSqlMachineV3Properties.createdTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedTimestamp".equals(fieldName)) { + deserializedAssessedSqlMachineV3Properties.updatedTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedSqlMachineV3Properties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachinesOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachinesOperations.java deleted file mode 100644 index aaaa76d270bc..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachinesOperations.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 AssessedSqlMachinesOperations. - */ -public interface AssessedSqlMachinesOperations { - /** - * List AssessedSqlMachine resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlMachine list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName); - - /** - * List AssessedSqlMachine resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlMachine list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context); - - /** - * Get a AssessedSqlMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachine along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, String assessedSqlMachineName, Context context); - - /** - * Get a AssessedSqlMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachine. - */ - AssessedSqlMachine get(String resourceGroupName, String projectName, String groupName, String assessmentName, - String assessedSqlMachineName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachinesV3Operations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachinesV3Operations.java new file mode 100644 index 000000000000..ebabc118b8dd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlMachinesV3Operations.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AssessedSqlMachinesV3Operations. + */ +public interface AssessedSqlMachinesV3Operations { + /** + * List AssessedSqlMachineV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlMachineV3 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List AssessedSqlMachineV3 resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 AssessedSqlMachineV3 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); + + /** + * Get a AssessedSqlMachineV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachineV3 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + String assessedSqlMachineName, Context context); + + /** + * Get a AssessedSqlMachineV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param assessedSqlMachineName Sql assessment 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 AssessedSqlMachineV3. + */ + AssessedSqlMachineV3 get(String resourceGroupName, String projectName, String assessmentName, + String assessedSqlMachineName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlNetworkAdaptersV3.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlNetworkAdaptersV3.java new file mode 100644 index 000000000000..56010b63afc0 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlNetworkAdaptersV3.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Assessed network adapter data for normalized contract for sql machines. + */ +@Fluent +public final class AssessedSqlNetworkAdaptersV3 implements JsonSerializable { + /* + * The disk name. + */ + private String name; + + /* + * Gets the net gigabytes transmitted per month. + */ + private Float netGigabytesTransmittedPerMonth; + + /* + * Gets the mac address. + */ + private String macAddress; + + /* + * Gets the ip addresses. + */ + private List ipAddresses; + + /* + * Gets the megabytes per second received. + */ + private Float megabytesPerSecondRecieved; + + /* + * Gets the megabytes per second transmitted. + */ + private Float megabytesPerSecondTransmitted; + + /* + * Display Name of the Machine. + */ + private String displayName; + + /** + * Creates an instance of AssessedSqlNetworkAdaptersV3 class. + */ + public AssessedSqlNetworkAdaptersV3() { + } + + /** + * 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 Float netGigabytesTransmittedPerMonth() { + return this.netGigabytesTransmittedPerMonth; + } + + /** + * Set the netGigabytesTransmittedPerMonth property: Gets the net gigabytes transmitted per month. + * + * @param netGigabytesTransmittedPerMonth the netGigabytesTransmittedPerMonth value to set. + * @return the AssessedSqlNetworkAdaptersV3 object itself. + */ + public AssessedSqlNetworkAdaptersV3 withNetGigabytesTransmittedPerMonth(Float netGigabytesTransmittedPerMonth) { + this.netGigabytesTransmittedPerMonth = netGigabytesTransmittedPerMonth; + return this; + } + + /** + * Get the macAddress property: Gets the mac address. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the macAddress property: Gets the mac address. + * + * @param macAddress the macAddress value to set. + * @return the AssessedSqlNetworkAdaptersV3 object itself. + */ + public AssessedSqlNetworkAdaptersV3 withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * 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 Float megabytesPerSecondRecieved() { + return this.megabytesPerSecondRecieved; + } + + /** + * Set the megabytesPerSecondRecieved property: Gets the megabytes per second received. + * + * @param megabytesPerSecondRecieved the megabytesPerSecondRecieved value to set. + * @return the AssessedSqlNetworkAdaptersV3 object itself. + */ + public AssessedSqlNetworkAdaptersV3 withMegabytesPerSecondRecieved(Float megabytesPerSecondRecieved) { + this.megabytesPerSecondRecieved = megabytesPerSecondRecieved; + return this; + } + + /** + * Get the megabytesPerSecondTransmitted property: Gets the megabytes per second transmitted. + * + * @return the megabytesPerSecondTransmitted value. + */ + public Float megabytesPerSecondTransmitted() { + return this.megabytesPerSecondTransmitted; + } + + /** + * Set the megabytesPerSecondTransmitted property: Gets the megabytes per second transmitted. + * + * @param megabytesPerSecondTransmitted the megabytesPerSecondTransmitted value to set. + * @return the AssessedSqlNetworkAdaptersV3 object itself. + */ + public AssessedSqlNetworkAdaptersV3 withMegabytesPerSecondTransmitted(Float megabytesPerSecondTransmitted) { + this.megabytesPerSecondTransmitted = megabytesPerSecondTransmitted; + return this; + } + + /** + * 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 AssessedSqlNetworkAdaptersV3 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedSqlNetworkAdaptersV3 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 AssessedSqlNetworkAdaptersV3. + */ + public static AssessedSqlNetworkAdaptersV3 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedSqlNetworkAdaptersV3 deserializedAssessedSqlNetworkAdaptersV3 = new AssessedSqlNetworkAdaptersV3(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAssessedSqlNetworkAdaptersV3.name = reader.getString(); + } else if ("netGigabytesTransmittedPerMonth".equals(fieldName)) { + deserializedAssessedSqlNetworkAdaptersV3.netGigabytesTransmittedPerMonth + = reader.getNullable(JsonReader::getFloat); + } else if ("macAddress".equals(fieldName)) { + deserializedAssessedSqlNetworkAdaptersV3.macAddress = reader.getString(); + } else if ("ipAddresses".equals(fieldName)) { + List ipAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedAssessedSqlNetworkAdaptersV3.ipAddresses = ipAddresses; + } else if ("megabytesPerSecondRecieved".equals(fieldName)) { + deserializedAssessedSqlNetworkAdaptersV3.megabytesPerSecondRecieved + = reader.getNullable(JsonReader::getFloat); + } else if ("megabytesPerSecondTransmitted".equals(fieldName)) { + deserializedAssessedSqlNetworkAdaptersV3.megabytesPerSecondTransmitted + = reader.getNullable(JsonReader::getFloat); + } else if ("displayName".equals(fieldName)) { + deserializedAssessedSqlNetworkAdaptersV3.displayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedSqlNetworkAdaptersV3; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlRecommendedEntity.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlRecommendedEntity.java deleted file mode 100644 index bf61fbe4a318..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlRecommendedEntity.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlRecommendedEntityInner; - -/** - * An immutable client-side representation of AssessedSqlRecommendedEntity. - */ -public interface AssessedSqlRecommendedEntity { - /** - * 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. - */ - AssessedSqlRecommendedEntityProperties 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.migration.assessment.fluent.models.AssessedSqlRecommendedEntityInner - * object. - * - * @return the inner object. - */ - AssessedSqlRecommendedEntityInner innerModel(); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlRecommendedEntityListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlRecommendedEntityListResult.java deleted file mode 100644 index 878fcd3a1a29..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlRecommendedEntityListResult.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -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.migration.assessment.fluent.models.AssessedSqlRecommendedEntityInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a AssessedSqlRecommendedEntity list operation. - */ -@Fluent -public final class AssessedSqlRecommendedEntityListResult - implements JsonSerializable { - /* - * The AssessedSqlRecommendedEntity items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of AssessedSqlRecommendedEntityListResult class. - */ - public AssessedSqlRecommendedEntityListResult() { - } - - /** - * Get the value property: The AssessedSqlRecommendedEntity items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The AssessedSqlRecommendedEntity items on this page. - * - * @param value the value value to set. - * @return the AssessedSqlRecommendedEntityListResult object itself. - */ - public AssessedSqlRecommendedEntityListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the AssessedSqlRecommendedEntityListResult object itself. - */ - public AssessedSqlRecommendedEntityListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * 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 AssessedSqlRecommendedEntityListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AssessedSqlRecommendedEntityListResult.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 AssessedSqlRecommendedEntityListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedSqlRecommendedEntityListResult 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 AssessedSqlRecommendedEntityListResult. - */ - public static AssessedSqlRecommendedEntityListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedSqlRecommendedEntityListResult deserializedAssessedSqlRecommendedEntityListResult - = new AssessedSqlRecommendedEntityListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AssessedSqlRecommendedEntityInner.fromJson(reader1)); - deserializedAssessedSqlRecommendedEntityListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedSqlRecommendedEntityListResult; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlRecommendedEntityOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlRecommendedEntityOperations.java deleted file mode 100644 index 48ae81944f08..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlRecommendedEntityOperations.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 AssessedSqlRecommendedEntityOperations. - */ -public interface AssessedSqlRecommendedEntityOperations { - /** - * List AssessedSqlRecommendedEntity resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlRecommendedEntity list operation as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName); - - /** - * List AssessedSqlRecommendedEntity resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 AssessedSqlRecommendedEntity list operation as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context); - - /** - * Get a AssessedSqlRecommendedEntity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param recommendedAssessedEntityName Sql assessment Assessed Recommended Entity 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 AssessedSqlRecommendedEntity along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String projectName, - String groupName, String assessmentName, String recommendedAssessedEntityName, Context context); - - /** - * Get a AssessedSqlRecommendedEntity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param recommendedAssessedEntityName Sql assessment Assessed Recommended Entity 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 AssessedSqlRecommendedEntity. - */ - AssessedSqlRecommendedEntity get(String resourceGroupName, String projectName, String groupName, - String assessmentName, String recommendedAssessedEntityName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlRecommendedEntityProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlRecommendedEntityProperties.java deleted file mode 100644 index c669f7ba2233..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedSqlRecommendedEntityProperties.java +++ /dev/null @@ -1,377 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Assessed SQL recommended entity properties. - */ -@Fluent -public final class AssessedSqlRecommendedEntityProperties - implements JsonSerializable { - /* - * Gets or sets machine name. - */ - private String machineName; - - /* - * Gets or sets SQL instance name. - */ - private String instanceName; - - /* - * Gets the product support status related details. - */ - private ProductSupportStatus productSupportStatus; - - /* - * Gets or sets assessed database count. - */ - private Integer dbCount; - - /* - * Gets or sets the total discovered database count. - */ - private Integer discoveredDBCount; - - /* - * Gets or sets a value indicating whether instance deep discovery has occurred or - * not. - */ - private Boolean hasScanOccurred; - - /* - * Gets or sets the recommended azure SQL target type. - */ - private TargetType recommendedAzureSqlTargetType; - - /* - * Gets or sets the recommended azure SQL suitability. - */ - private RecommendedSuitability recommendedSuitability; - - /* - * SQL instance azure SQL MI suitability details. - */ - private SqlAssessmentV2PaasSuitabilityData azureSqlMISuitabilityDetails; - - /* - * SQL instance azure SQL DB suitability details. - */ - private SqlAssessmentV2PaasSuitabilityData azureSqlDBSuitabilityDetails; - - /* - * SQL instance azure SQL VM suitability details. - */ - private SqlAssessmentV2IaasSuitabilityData azureSqlVMSuitabilityDetails; - - /* - * Gets or sets Arm id of assessed entity. - */ - private String assessedSqlEntityArmId; - - /* - * Gets or sets a value indicating whether the SQL instance is clustered or not. - */ - private Boolean isClustered; - - /* - * Gets or sets a value indicating whether the high availability is enabled or not. - */ - private Boolean isHighAvailabilityEnabled; - - /* - * Gets the SQL edition from the recommended entity if applicable. - */ - private String sqlEdition; - - /* - * Gets the SQL version from the recommended entity if applicable. - */ - private String sqlVersion; - - /* - * Assessment sizing criterion. - */ - private AssessmentSizingCriterion sizingCriterion; - - /** - * Creates an instance of AssessedSqlRecommendedEntityProperties class. - */ - public AssessedSqlRecommendedEntityProperties() { - } - - /** - * Get the machineName property: Gets or sets machine name. - * - * @return the machineName value. - */ - public String machineName() { - return this.machineName; - } - - /** - * Get the instanceName property: Gets or sets SQL instance name. - * - * @return the instanceName value. - */ - public String instanceName() { - return this.instanceName; - } - - /** - * Get the productSupportStatus property: Gets the product support status related details. - * - * @return the productSupportStatus value. - */ - public ProductSupportStatus productSupportStatus() { - return this.productSupportStatus; - } - - /** - * Get the dbCount property: Gets or sets assessed database count. - * - * @return the dbCount value. - */ - public Integer dbCount() { - return this.dbCount; - } - - /** - * Get the discoveredDBCount property: Gets or sets the total discovered database count. - * - * @return the discoveredDBCount value. - */ - public Integer discoveredDBCount() { - return this.discoveredDBCount; - } - - /** - * Get the hasScanOccurred property: Gets or sets a value indicating whether instance deep discovery has occurred or - * not. - * - * @return the hasScanOccurred value. - */ - public Boolean hasScanOccurred() { - return this.hasScanOccurred; - } - - /** - * Get the recommendedAzureSqlTargetType property: Gets or sets the recommended azure SQL target type. - * - * @return the recommendedAzureSqlTargetType value. - */ - public TargetType recommendedAzureSqlTargetType() { - return this.recommendedAzureSqlTargetType; - } - - /** - * Get the recommendedSuitability property: Gets or sets the recommended azure SQL suitability. - * - * @return the recommendedSuitability value. - */ - public RecommendedSuitability recommendedSuitability() { - return this.recommendedSuitability; - } - - /** - * Get the azureSqlMISuitabilityDetails property: SQL instance azure SQL MI suitability details. - * - * @return the azureSqlMISuitabilityDetails value. - */ - public SqlAssessmentV2PaasSuitabilityData azureSqlMISuitabilityDetails() { - return this.azureSqlMISuitabilityDetails; - } - - /** - * Get the azureSqlDBSuitabilityDetails property: SQL instance azure SQL DB suitability details. - * - * @return the azureSqlDBSuitabilityDetails value. - */ - public SqlAssessmentV2PaasSuitabilityData azureSqlDBSuitabilityDetails() { - return this.azureSqlDBSuitabilityDetails; - } - - /** - * Get the azureSqlVMSuitabilityDetails property: SQL instance azure SQL VM suitability details. - * - * @return the azureSqlVMSuitabilityDetails value. - */ - public SqlAssessmentV2IaasSuitabilityData azureSqlVMSuitabilityDetails() { - return this.azureSqlVMSuitabilityDetails; - } - - /** - * Get the assessedSqlEntityArmId property: Gets or sets Arm id of assessed entity. - * - * @return the assessedSqlEntityArmId value. - */ - public String assessedSqlEntityArmId() { - return this.assessedSqlEntityArmId; - } - - /** - * Set the assessedSqlEntityArmId property: Gets or sets Arm id of assessed entity. - * - * @param assessedSqlEntityArmId the assessedSqlEntityArmId value to set. - * @return the AssessedSqlRecommendedEntityProperties object itself. - */ - public AssessedSqlRecommendedEntityProperties withAssessedSqlEntityArmId(String assessedSqlEntityArmId) { - this.assessedSqlEntityArmId = assessedSqlEntityArmId; - return this; - } - - /** - * Get the isClustered property: Gets or sets a value indicating whether the SQL instance is clustered or not. - * - * @return the isClustered value. - */ - public Boolean isClustered() { - return this.isClustered; - } - - /** - * Get the isHighAvailabilityEnabled property: Gets or sets a value indicating whether the high availability is - * enabled or not. - * - * @return the isHighAvailabilityEnabled value. - */ - public Boolean isHighAvailabilityEnabled() { - return this.isHighAvailabilityEnabled; - } - - /** - * Get the sqlEdition property: Gets the SQL edition from the recommended entity if applicable. - * - * @return the sqlEdition value. - */ - public String sqlEdition() { - return this.sqlEdition; - } - - /** - * Get the sqlVersion property: Gets the SQL version from the recommended entity if applicable. - * - * @return the sqlVersion value. - */ - public String sqlVersion() { - return this.sqlVersion; - } - - /** - * Get the sizingCriterion property: Assessment sizing criterion. - * - * @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() { - if (productSupportStatus() != null) { - productSupportStatus().validate(); - } - if (azureSqlMISuitabilityDetails() != null) { - azureSqlMISuitabilityDetails().validate(); - } - if (azureSqlDBSuitabilityDetails() != null) { - azureSqlDBSuitabilityDetails().validate(); - } - if (azureSqlVMSuitabilityDetails() != null) { - azureSqlVMSuitabilityDetails().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("assessedSqlEntityArmId", this.assessedSqlEntityArmId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssessedSqlRecommendedEntityProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessedSqlRecommendedEntityProperties 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 AssessedSqlRecommendedEntityProperties. - */ - public static AssessedSqlRecommendedEntityProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessedSqlRecommendedEntityProperties deserializedAssessedSqlRecommendedEntityProperties - = new AssessedSqlRecommendedEntityProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("machineName".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.machineName = reader.getString(); - } else if ("instanceName".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.instanceName = reader.getString(); - } else if ("productSupportStatus".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.productSupportStatus - = ProductSupportStatus.fromJson(reader); - } else if ("dbCount".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.dbCount = reader.getNullable(JsonReader::getInt); - } else if ("discoveredDBCount".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.discoveredDBCount - = reader.getNullable(JsonReader::getInt); - } else if ("hasScanOccurred".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.hasScanOccurred - = reader.getNullable(JsonReader::getBoolean); - } else if ("recommendedAzureSqlTargetType".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.recommendedAzureSqlTargetType - = TargetType.fromString(reader.getString()); - } else if ("recommendedSuitability".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.recommendedSuitability - = RecommendedSuitability.fromString(reader.getString()); - } else if ("azureSqlMISuitabilityDetails".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.azureSqlMISuitabilityDetails - = SqlAssessmentV2PaasSuitabilityData.fromJson(reader); - } else if ("azureSqlDBSuitabilityDetails".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.azureSqlDBSuitabilityDetails - = SqlAssessmentV2PaasSuitabilityData.fromJson(reader); - } else if ("azureSqlVMSuitabilityDetails".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.azureSqlVMSuitabilityDetails - = SqlAssessmentV2IaasSuitabilityData.fromJson(reader); - } else if ("assessedSqlEntityArmId".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.assessedSqlEntityArmId = reader.getString(); - } else if ("isClustered".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.isClustered - = reader.getNullable(JsonReader::getBoolean); - } else if ("isHighAvailabilityEnabled".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.isHighAvailabilityEnabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("sqlEdition".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.sqlEdition = reader.getString(); - } else if ("sqlVersion".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.sqlVersion = reader.getString(); - } else if ("sizingCriterion".equals(fieldName)) { - deserializedAssessedSqlRecommendedEntityProperties.sizingCriterion - = AssessmentSizingCriterion.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessedSqlRecommendedEntityProperties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3.java new file mode 100644 index 000000000000..1c7e9e9e89fa --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedWebAppV3Inner; + +/** + * An immutable client-side representation of AssessedWebAppV3. + */ +public interface AssessedWebAppV3 { + /** + * 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. + */ + AssessedWebAppV3Properties 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.migration.assessment.fluent.models.AssessedWebAppV3Inner object. + * + * @return the inner object. + */ + AssessedWebAppV3Inner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3ListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3ListResult.java new file mode 100644 index 000000000000..2f66014a3a05 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3ListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AssessedWebAppV3Inner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AssessedWebAppV3 list operation. + */ +@Fluent +public final class AssessedWebAppV3ListResult implements JsonSerializable { + /* + * The AssessedWebAppV3 items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AssessedWebAppV3ListResult class. + */ + public AssessedWebAppV3ListResult() { + } + + /** + * Get the value property: The AssessedWebAppV3 items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AssessedWebAppV3 items on this page. + * + * @param value the value value to set. + * @return the AssessedWebAppV3ListResult object itself. + */ + public AssessedWebAppV3ListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AssessedWebAppV3ListResult object itself. + */ + public AssessedWebAppV3ListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 AssessedWebAppV3ListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AssessedWebAppV3ListResult.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 AssessedWebAppV3ListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedWebAppV3ListResult 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 AssessedWebAppV3ListResult. + */ + public static AssessedWebAppV3ListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedWebAppV3ListResult deserializedAssessedWebAppV3ListResult = new AssessedWebAppV3ListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AssessedWebAppV3Inner.fromJson(reader1)); + deserializedAssessedWebAppV3ListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAssessedWebAppV3ListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedWebAppV3ListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3Properties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3Properties.java new file mode 100644 index 000000000000..0d5dbdbdde57 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3Properties.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Properties of an assessed web app. + */ +@Fluent +public final class AssessedWebAppV3Properties implements JsonSerializable { + /* + * The workload type + */ + private MigrateWorkloadType workloadType; + + /* + * The linkages list. + */ + private List linkages; + + /* + * The recommendation list. + */ + private List recommendations; + + /* + * Timestamp of the assessment creation. + */ + private String createdTimestamp; + + /* + * Timestamp of the assessment last updated. + */ + private String updatedTimestamp; + + /* + * Type of assessed webapp. + */ + private WebServerType webAppType; + + /** + * Creates an instance of AssessedWebAppV3Properties class. + */ + public AssessedWebAppV3Properties() { + } + + /** + * 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 createdTimestamp property: Timestamp of the assessment creation. + * + * @return the createdTimestamp value. + */ + public String createdTimestamp() { + return this.createdTimestamp; + } + + /** + * Set the createdTimestamp property: Timestamp of the assessment creation. + * + * @param createdTimestamp the createdTimestamp value to set. + * @return the AssessedWebAppV3Properties object itself. + */ + public AssessedWebAppV3Properties withCreatedTimestamp(String createdTimestamp) { + this.createdTimestamp = createdTimestamp; + return this; + } + + /** + * Get the updatedTimestamp property: Timestamp of the assessment last updated. + * + * @return the updatedTimestamp value. + */ + public String updatedTimestamp() { + return this.updatedTimestamp; + } + + /** + * Set the updatedTimestamp property: Timestamp of the assessment last updated. + * + * @param updatedTimestamp the updatedTimestamp value to set. + * @return the AssessedWebAppV3Properties object itself. + */ + public AssessedWebAppV3Properties withUpdatedTimestamp(String updatedTimestamp) { + this.updatedTimestamp = updatedTimestamp; + return this; + } + + /** + * Get the webAppType property: Type of assessed webapp. + * + * @return the webAppType value. + */ + public WebServerType webAppType() { + return this.webAppType; + } + + /** + * Set the webAppType property: Type of assessed webapp. + * + * @param webAppType the webAppType value to set. + * @return the AssessedWebAppV3Properties object itself. + */ + public AssessedWebAppV3Properties withWebAppType(WebServerType webAppType) { + this.webAppType = webAppType; + return this; + } + + /** + * 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 (createdTimestamp() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property createdTimestamp in model AssessedWebAppV3Properties")); + } + if (updatedTimestamp() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property updatedTimestamp in model AssessedWebAppV3Properties")); + } + if (webAppType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property webAppType in model AssessedWebAppV3Properties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AssessedWebAppV3Properties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdTimestamp", this.createdTimestamp); + jsonWriter.writeStringField("updatedTimestamp", this.updatedTimestamp); + jsonWriter.writeStringField("webAppType", this.webAppType == null ? null : this.webAppType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssessedWebAppV3Properties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedWebAppV3Properties 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 AssessedWebAppV3Properties. + */ + public static AssessedWebAppV3Properties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedWebAppV3Properties deserializedAssessedWebAppV3Properties = new AssessedWebAppV3Properties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("createdTimestamp".equals(fieldName)) { + deserializedAssessedWebAppV3Properties.createdTimestamp = reader.getString(); + } else if ("updatedTimestamp".equals(fieldName)) { + deserializedAssessedWebAppV3Properties.updatedTimestamp = reader.getString(); + } else if ("webAppType".equals(fieldName)) { + deserializedAssessedWebAppV3Properties.webAppType = WebServerType.fromString(reader.getString()); + } else if ("workloadType".equals(fieldName)) { + deserializedAssessedWebAppV3Properties.workloadType + = MigrateWorkloadType.fromString(reader.getString()); + } else if ("linkages".equals(fieldName)) { + List linkages = reader.readArray(reader1 -> Linkages.fromJson(reader1)); + deserializedAssessedWebAppV3Properties.linkages = linkages; + } else if ("recommendations".equals(fieldName)) { + List recommendations + = reader.readArray(reader1 -> AssessedWebAppV3PropertiesRecommendationsItem.fromJson(reader1)); + deserializedAssessedWebAppV3Properties.recommendations = recommendations; + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedWebAppV3Properties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3PropertiesRecommendationsItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3PropertiesRecommendationsItem.java new file mode 100644 index 000000000000..766e93f664f2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3PropertiesRecommendationsItem.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Recommendation details. + */ +@Immutable +public final class AssessedWebAppV3PropertiesRecommendationsItem + implements JsonSerializable { + /* + * The configuration data. + */ + private Configuration configuration; + + /* + * The recommended details. + */ + private RecommendedFor recommendedFor; + + /* + * The migration Platform. + */ + private MigrationPlatform migrationPlatform; + + /* + * The confidence score. + */ + private Float 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; + + /** + * Creates an instance of AssessedWebAppV3PropertiesRecommendationsItem class. + */ + public AssessedWebAppV3PropertiesRecommendationsItem() { + } + + /** + * 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 Float 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; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssessedWebAppV3PropertiesRecommendationsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedWebAppV3PropertiesRecommendationsItem 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 AssessedWebAppV3PropertiesRecommendationsItem. + */ + public static AssessedWebAppV3PropertiesRecommendationsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedWebAppV3PropertiesRecommendationsItem deserializedAssessedWebAppV3PropertiesRecommendationsItem + = new AssessedWebAppV3PropertiesRecommendationsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configuration".equals(fieldName)) { + deserializedAssessedWebAppV3PropertiesRecommendationsItem.configuration + = Configuration.fromJson(reader); + } else if ("recommendedFor".equals(fieldName)) { + deserializedAssessedWebAppV3PropertiesRecommendationsItem.recommendedFor + = RecommendedFor.fromJson(reader); + } else if ("migrationPlatform".equals(fieldName)) { + deserializedAssessedWebAppV3PropertiesRecommendationsItem.migrationPlatform + = MigrationPlatform.fromString(reader.getString()); + } else if ("confidenceScore".equals(fieldName)) { + deserializedAssessedWebAppV3PropertiesRecommendationsItem.confidenceScore + = reader.getNullable(JsonReader::getFloat); + } else if ("migrationSuitability".equals(fieldName)) { + deserializedAssessedWebAppV3PropertiesRecommendationsItem.migrationSuitability + = MigrationSuitability.fromJson(reader); + } else if ("securitySuitability".equals(fieldName)) { + deserializedAssessedWebAppV3PropertiesRecommendationsItem.securitySuitability + = SecuritySuitability.fromJson(reader); + } else if ("totalCost".equals(fieldName)) { + List totalCost + = reader.readArray(reader1 -> CostDetailsCommon.fromJson(reader1)); + deserializedAssessedWebAppV3PropertiesRecommendationsItem.totalCost = totalCost; + } else if ("totalSavings".equals(fieldName)) { + List totalSavings + = reader.readArray(reader1 -> SavingsDetailsCommon.fromJson(reader1)); + deserializedAssessedWebAppV3PropertiesRecommendationsItem.totalSavings = totalSavings; + } else if ("migrationIssues".equals(fieldName)) { + List migrationIssues + = reader.readArray(reader1 -> MigrationIssues.fromJson(reader1)); + deserializedAssessedWebAppV3PropertiesRecommendationsItem.migrationIssues = migrationIssues; + } else if ("skus".equals(fieldName)) { + List skus = reader.readArray( + reader1 -> AssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem.fromJson(reader1)); + deserializedAssessedWebAppV3PropertiesRecommendationsItem.skus = skus; + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedWebAppV3PropertiesRecommendationsItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem.java new file mode 100644 index 000000000000..9aa5e1879d1d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem + 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 AssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem class. + */ + public AssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem() { + } + + /** + * 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 AssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem 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 + * AssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem. + */ + public static AssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem deserializedAssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem + = new AssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem.kind + = SkuKind.fromString(reader.getString()); + } else if ("resourceUri".equals(fieldName)) { + deserializedAssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem.resourceUri + = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem.displayName + = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedAssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem.type + = SkuType.fromString(reader.getString()); + } else if ("sources".equals(fieldName)) { + List sources = reader + .readArray(reader1 -> AssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem + .fromJson(reader1)); + deserializedAssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem.sources = sources; + } else if ("details".equals(fieldName)) { + deserializedAssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem.details + = SkuDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedWebAppV3PropertiesRecommendationsPropertiesItemsItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem.java new file mode 100644 index 000000000000..dbfe11df75c5 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem + implements JsonSerializable { + /* + * The sku name. + */ + private String name; + + /* + * The sku type. + */ + private MigrationSuitability migrationSuitability; + + /** + * Creates an instance of AssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem class. + */ + public AssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem() { + } + + /** + * 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 AssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem 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 + * AssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem. + */ + public static AssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem deserializedAssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem + = new AssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem.name + = reader.getString(); + } else if ("migrationSuitability".equals(fieldName)) { + deserializedAssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem.migrationSuitability + = MigrationSuitability.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedWebAppV3PropertiesRecommendationsPropertiesItemsSourcesItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplication.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplication.java new file mode 100644 index 000000000000..51784b33a82b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplication.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedWebApplicationInner; + +/** + * An immutable client-side representation of AssessedWebApplication. + */ +public interface AssessedWebApplication { + /** + * 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. + */ + AssessedWebApplicationProperties 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.migration.assessment.fluent.models.AssessedWebApplicationInner object. + * + * @return the inner object. + */ + AssessedWebApplicationInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationListResult.java new file mode 100644 index 000000000000..bbfefb563eb5 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AssessedWebApplicationInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AssessedWebApplication list operation. + */ +@Fluent +public final class AssessedWebApplicationListResult implements JsonSerializable { + /* + * The AssessedWebApplication items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AssessedWebApplicationListResult class. + */ + public AssessedWebApplicationListResult() { + } + + /** + * Get the value property: The AssessedWebApplication items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AssessedWebApplication items on this page. + * + * @param value the value value to set. + * @return the AssessedWebApplicationListResult object itself. + */ + public AssessedWebApplicationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AssessedWebApplicationListResult object itself. + */ + public AssessedWebApplicationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 AssessedWebApplicationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AssessedWebApplicationListResult.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 AssessedWebApplicationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedWebApplicationListResult 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 AssessedWebApplicationListResult. + */ + public static AssessedWebApplicationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedWebApplicationListResult deserializedAssessedWebApplicationListResult + = new AssessedWebApplicationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AssessedWebApplicationInner.fromJson(reader1)); + deserializedAssessedWebApplicationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAssessedWebApplicationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedWebApplicationListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationOperations.java new file mode 100644 index 000000000000..b6f2354fbb45 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationOperations.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AssessedWebApplicationOperations. + */ +public interface AssessedWebApplicationOperations { + /** + * List AssessedWebApplication resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AssessedWebApplication list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List AssessedWebApplication resources by AKSAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment 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 AssessedWebApplication list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a AssessedWebApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param assessedWorkload Assessed Web Application 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 AssessedWebApplication along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedWorkload, Context context); + + /** + * Get a AssessedWebApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AKS Assessment Name. + * @param assessedWorkload Assessed Web Application 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 AssessedWebApplication. + */ + AssessedWebApplication get(String resourceGroupName, String projectName, String assessmentName, + String assessedWorkload); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationProperties.java new file mode 100644 index 000000000000..6a1b73ad9816 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationProperties.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Assessed Web Application Properties. + */ +@Fluent +public final class AssessedWebApplicationProperties implements JsonSerializable { + /* + * The workload type + */ + private MigrateWorkloadType workloadType; + + /* + * The linkages list. + */ + private List linkages; + + /* + * The recommendation list. + */ + private List recommendations; + + /* + * Recommendation Result of assessed webapp. + */ + private RecommendationResult recommendationResult; + + /* + * Type of assessed webapp. + */ + private WebServerType webAppType; + + /** + * Creates an instance of AssessedWebApplicationProperties class. + */ + public AssessedWebApplicationProperties() { + } + + /** + * 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 recommendationResult property: Recommendation Result of assessed webapp. + * + * @return the recommendationResult value. + */ + public RecommendationResult recommendationResult() { + return this.recommendationResult; + } + + /** + * Set the recommendationResult property: Recommendation Result of assessed webapp. + * + * @param recommendationResult the recommendationResult value to set. + * @return the AssessedWebApplicationProperties object itself. + */ + public AssessedWebApplicationProperties withRecommendationResult(RecommendationResult recommendationResult) { + this.recommendationResult = recommendationResult; + return this; + } + + /** + * Get the webAppType property: Type of assessed webapp. + * + * @return the webAppType value. + */ + public WebServerType webAppType() { + return this.webAppType; + } + + /** + * Set the webAppType property: Type of assessed webapp. + * + * @param webAppType the webAppType value to set. + * @return the AssessedWebApplicationProperties object itself. + */ + public AssessedWebApplicationProperties withWebAppType(WebServerType webAppType) { + this.webAppType = webAppType; + return this; + } + + /** + * 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 (recommendationResult() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property recommendationResult in model AssessedWebApplicationProperties")); + } else { + recommendationResult().validate(); + } + if (webAppType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property webAppType in model AssessedWebApplicationProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AssessedWebApplicationProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("recommendationResult", this.recommendationResult); + jsonWriter.writeStringField("webAppType", this.webAppType == null ? null : this.webAppType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssessedWebApplicationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedWebApplicationProperties 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 AssessedWebApplicationProperties. + */ + public static AssessedWebApplicationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedWebApplicationProperties deserializedAssessedWebApplicationProperties + = new AssessedWebApplicationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recommendationResult".equals(fieldName)) { + deserializedAssessedWebApplicationProperties.recommendationResult + = RecommendationResult.fromJson(reader); + } else if ("webAppType".equals(fieldName)) { + deserializedAssessedWebApplicationProperties.webAppType + = WebServerType.fromString(reader.getString()); + } else if ("workloadType".equals(fieldName)) { + deserializedAssessedWebApplicationProperties.workloadType + = MigrateWorkloadType.fromString(reader.getString()); + } else if ("linkages".equals(fieldName)) { + List linkages = reader.readArray(reader1 -> Linkages.fromJson(reader1)); + deserializedAssessedWebApplicationProperties.linkages = linkages; + } else if ("recommendations".equals(fieldName)) { + List recommendations = reader + .readArray(reader1 -> AssessedWebApplicationPropertiesRecommendationsItem.fromJson(reader1)); + deserializedAssessedWebApplicationProperties.recommendations = recommendations; + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedWebApplicationProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationPropertiesRecommendationsItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationPropertiesRecommendationsItem.java new file mode 100644 index 000000000000..85178118d4e9 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationPropertiesRecommendationsItem.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Recommendation details. + */ +@Immutable +public final class AssessedWebApplicationPropertiesRecommendationsItem + implements JsonSerializable { + /* + * The configuration data. + */ + private Configuration configuration; + + /* + * The recommended details. + */ + private RecommendedFor recommendedFor; + + /* + * The migration Platform. + */ + private MigrationPlatform migrationPlatform; + + /* + * The confidence score. + */ + private Float 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; + + /** + * Creates an instance of AssessedWebApplicationPropertiesRecommendationsItem class. + */ + public AssessedWebApplicationPropertiesRecommendationsItem() { + } + + /** + * 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 Float 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; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssessedWebApplicationPropertiesRecommendationsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedWebApplicationPropertiesRecommendationsItem 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 AssessedWebApplicationPropertiesRecommendationsItem. + */ + public static AssessedWebApplicationPropertiesRecommendationsItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AssessedWebApplicationPropertiesRecommendationsItem deserializedAssessedWebApplicationPropertiesRecommendationsItem + = new AssessedWebApplicationPropertiesRecommendationsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configuration".equals(fieldName)) { + deserializedAssessedWebApplicationPropertiesRecommendationsItem.configuration + = Configuration.fromJson(reader); + } else if ("recommendedFor".equals(fieldName)) { + deserializedAssessedWebApplicationPropertiesRecommendationsItem.recommendedFor + = RecommendedFor.fromJson(reader); + } else if ("migrationPlatform".equals(fieldName)) { + deserializedAssessedWebApplicationPropertiesRecommendationsItem.migrationPlatform + = MigrationPlatform.fromString(reader.getString()); + } else if ("confidenceScore".equals(fieldName)) { + deserializedAssessedWebApplicationPropertiesRecommendationsItem.confidenceScore + = reader.getNullable(JsonReader::getFloat); + } else if ("migrationSuitability".equals(fieldName)) { + deserializedAssessedWebApplicationPropertiesRecommendationsItem.migrationSuitability + = MigrationSuitability.fromJson(reader); + } else if ("securitySuitability".equals(fieldName)) { + deserializedAssessedWebApplicationPropertiesRecommendationsItem.securitySuitability + = SecuritySuitability.fromJson(reader); + } else if ("totalCost".equals(fieldName)) { + List totalCost + = reader.readArray(reader1 -> CostDetailsCommon.fromJson(reader1)); + deserializedAssessedWebApplicationPropertiesRecommendationsItem.totalCost = totalCost; + } else if ("totalSavings".equals(fieldName)) { + List totalSavings + = reader.readArray(reader1 -> SavingsDetailsCommon.fromJson(reader1)); + deserializedAssessedWebApplicationPropertiesRecommendationsItem.totalSavings = totalSavings; + } else if ("migrationIssues".equals(fieldName)) { + List migrationIssues + = reader.readArray(reader1 -> MigrationIssues.fromJson(reader1)); + deserializedAssessedWebApplicationPropertiesRecommendationsItem.migrationIssues = migrationIssues; + } else if ("skus".equals(fieldName)) { + List skus + = reader.readArray(reader1 -> AssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem + .fromJson(reader1)); + deserializedAssessedWebApplicationPropertiesRecommendationsItem.skus = skus; + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedWebApplicationPropertiesRecommendationsItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem.java new file mode 100644 index 000000000000..d1cc72af2302 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem + 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 AssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem class. + */ + public AssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem() { + } + + /** + * 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 AssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem 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 + * AssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem. + */ + public static AssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem deserializedAssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem + = new AssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem.kind + = SkuKind.fromString(reader.getString()); + } else if ("resourceUri".equals(fieldName)) { + deserializedAssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem.resourceUri + = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem.displayName + = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedAssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem.id + = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem.type + = SkuType.fromString(reader.getString()); + } else if ("sources".equals(fieldName)) { + List sources = reader + .readArray(reader1 -> AssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem + .fromJson(reader1)); + deserializedAssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem.sources = sources; + } else if ("details".equals(fieldName)) { + deserializedAssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem.details + = SkuDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedWebApplicationPropertiesRecommendationsPropertiesItemsItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem.java new file mode 100644 index 000000000000..11c7f37473ef --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem + implements JsonSerializable { + /* + * The sku name. + */ + private String name; + + /* + * The sku type. + */ + private MigrationSuitability migrationSuitability; + + /** + * Creates an instance of AssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem class. + */ + public AssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem() { + } + + /** + * 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 AssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem from the + * JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem 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 + * AssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem. + */ + public static AssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem + fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem deserializedAssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem + = new AssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem.name + = reader.getString(); + } else if ("migrationSuitability".equals(fieldName)) { + deserializedAssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem.migrationSuitability + = MigrationSuitability.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedWebApplicationPropertiesRecommendationsPropertiesItemsSourcesItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppsV3Operations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppsV3Operations.java new file mode 100644 index 000000000000..1ae759e05616 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessedWebAppsV3Operations.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AssessedWebAppsV3Operations. + */ +public interface AssessedWebAppsV3Operations { + /** + * List AssessedWebAppV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 AssessedWebAppV3 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName); + + /** + * List AssessedWebAppV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 AssessedWebAppV3 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName, + Context context); + + /** + * Get a AssessedWebAppV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param assessedWebAppName Assessed web app 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 AssessedWebAppV3 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + String assessedWebAppName, Context context); + + /** + * Get a AssessedWebAppV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param assessedWebAppName Assessed web app 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 AssessedWebAppV3. + */ + AssessedWebAppV3 get(String resourceGroupName, String projectName, String assessmentName, + String assessedWebAppName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Assessment.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Assessment.java deleted file mode 100644 index 502b29af8fca..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Assessment.java +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessmentInner; - -/** - * An immutable client-side representation of Assessment. - */ -public interface Assessment { - /** - * 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. - */ - MachineAssessmentProperties 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.migration.assessment.fluent.models.AssessmentInner object. - * - * @return the inner object. - */ - AssessmentInner innerModel(); - - /** - * The entirety of the Assessment definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The Assessment definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Assessment definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the Assessment definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, projectName, groupName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @return the next definition stage. - */ - WithCreate withExistingGroup(String resourceGroupName, String projectName, String groupName); - } - - /** - * The stage of the Assessment 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. - */ - Assessment create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Assessment create(Context context); - } - - /** - * The stage of the Assessment 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(MachineAssessmentProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Assessment refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Assessment 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 the URL for downloading the assessment in a report format. - */ - DownloadUrl downloadUrl(Object 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 the URL for downloading the assessment in a report format. - */ - DownloadUrl downloadUrl(Object body, Context context); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentDetails.java new file mode 100644 index 000000000000..7aeba3f46be4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentDetails.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 Float 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 Float 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::getFloat); + } 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentListResult.java deleted file mode 100644 index 83479de963f4..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentListResult.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -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.migration.assessment.fluent.models.AssessmentInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a Assessment list operation. - */ -@Fluent -public final class AssessmentListResult implements JsonSerializable { - /* - * The Assessment items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of AssessmentListResult class. - */ - public AssessmentListResult() { - } - - /** - * Get the value property: The Assessment items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The Assessment items on this page. - * - * @param value the value value to set. - * @return the AssessmentListResult object itself. - */ - public AssessmentListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the AssessmentListResult object itself. - */ - public AssessmentListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * 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 AssessmentListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AssessmentListResult.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 AssessmentListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessmentListResult 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 AssessmentListResult. - */ - public static AssessmentListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessmentListResult deserializedAssessmentListResult = new AssessmentListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> AssessmentInner.fromJson(reader1)); - deserializedAssessmentListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAssessmentListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessmentListResult; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentOptions.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentOptions.java deleted file mode 100644 index 8bc9950a698e..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentOptions.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessmentOptionsInner; - -/** - * An immutable client-side representation of AssessmentOptions. - */ -public interface AssessmentOptions { - /** - * 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. - */ - AssessmentOptionsProperties 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.migration.assessment.fluent.models.AssessmentOptionsInner object. - * - * @return the inner object. - */ - AssessmentOptionsInner innerModel(); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentOptionsListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentOptionsListResult.java deleted file mode 100644 index 8d206d8caf33..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentOptionsListResult.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -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.migration.assessment.fluent.models.AssessmentOptionsInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a AssessmentOptions list operation. - */ -@Fluent -public final class AssessmentOptionsListResult implements JsonSerializable { - /* - * The AssessmentOptions items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of AssessmentOptionsListResult class. - */ - public AssessmentOptionsListResult() { - } - - /** - * Get the value property: The AssessmentOptions items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The AssessmentOptions items on this page. - * - * @param value the value value to set. - * @return the AssessmentOptionsListResult object itself. - */ - public AssessmentOptionsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the AssessmentOptionsListResult object itself. - */ - public AssessmentOptionsListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * 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 AssessmentOptionsListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AssessmentOptionsListResult.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 AssessmentOptionsListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessmentOptionsListResult 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 AssessmentOptionsListResult. - */ - public static AssessmentOptionsListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessmentOptionsListResult deserializedAssessmentOptionsListResult = new AssessmentOptionsListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AssessmentOptionsInner.fromJson(reader1)); - deserializedAssessmentOptionsListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAssessmentOptionsListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessmentOptionsListResult; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentOptionsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentOptionsOperations.java deleted file mode 100644 index 0fc2d30010d3..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentOptionsOperations.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 AssessmentOptionsOperations. - */ -public interface AssessmentOptionsOperations { - /** - * List AssessmentOptions 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 AssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); - - /** - * List AssessmentOptions 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 AssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); - - /** - * Get a AssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName assessment options ARM name. Accepted value is 'default'. - * @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 AssessmentOptions along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String projectName, - String assessmentOptionsName, Context context); - - /** - * Get a AssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName assessment options ARM name. Accepted value is 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 AssessmentOptions. - */ - AssessmentOptions get(String resourceGroupName, String projectName, String assessmentOptionsName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentOptionsProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentOptionsProperties.java deleted file mode 100644 index 04271f5820f6..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentOptionsProperties.java +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Assessment options properties. - */ -@Immutable -public final class AssessmentOptionsProperties implements JsonSerializable { - /* - * Dictionary of VM families grouped by vm family name describing the targeted - * azure locations of VM family and the category of the family. - */ - private List vmFamilies; - - /* - * List of supported VM Families. - */ - private List reservedInstanceVmFamilies; - - /* - * List of supported Azure regions for reserved instances. - */ - private List reservedInstanceSupportedLocations; - - /* - * List of supported currencies for reserved instances. - */ - private List reservedInstanceSupportedCurrencies; - - /* - * List of supported Azure offer codes for reserved instances. - */ - private List reservedInstanceSupportedOffers; - - /* - * Ultra disk related assessment options. - */ - private List ultraDiskVmFamilies; - - /* - * List of VM Families that support premium disks for assessments. - */ - private List premiumDiskVmFamilies; - - /* - * List of VM Families that support Savings plan offer for assessments. - */ - private List savingsPlanVmFamilies; - - /* - * List of Azure locations that support Savings plan offer for assessments. - */ - private List savingsPlanSupportedLocations; - - /** - * Creates an instance of AssessmentOptionsProperties class. - */ - public AssessmentOptionsProperties() { - } - - /** - * Get the vmFamilies property: Dictionary of VM families grouped by vm family name describing the targeted - * azure locations of VM family and the category of the family. - * - * @return the vmFamilies value. - */ - public List vmFamilies() { - return this.vmFamilies; - } - - /** - * Get the reservedInstanceVmFamilies property: List of supported VM Families. - * - * @return the reservedInstanceVmFamilies value. - */ - public List reservedInstanceVmFamilies() { - return this.reservedInstanceVmFamilies; - } - - /** - * Get the reservedInstanceSupportedLocations property: List of supported Azure regions for reserved instances. - * - * @return the reservedInstanceSupportedLocations value. - */ - public List reservedInstanceSupportedLocations() { - return this.reservedInstanceSupportedLocations; - } - - /** - * Get the reservedInstanceSupportedCurrencies property: List of supported currencies for reserved instances. - * - * @return the reservedInstanceSupportedCurrencies value. - */ - public List reservedInstanceSupportedCurrencies() { - return this.reservedInstanceSupportedCurrencies; - } - - /** - * Get the reservedInstanceSupportedOffers property: List of supported Azure offer codes for reserved instances. - * - * @return the reservedInstanceSupportedOffers value. - */ - public List reservedInstanceSupportedOffers() { - return this.reservedInstanceSupportedOffers; - } - - /** - * Get the ultraDiskVmFamilies property: Ultra disk related assessment options. - * - * @return the ultraDiskVmFamilies value. - */ - public List ultraDiskVmFamilies() { - return this.ultraDiskVmFamilies; - } - - /** - * Get the premiumDiskVmFamilies property: List of VM Families that support premium disks for assessments. - * - * @return the premiumDiskVmFamilies value. - */ - public List premiumDiskVmFamilies() { - return this.premiumDiskVmFamilies; - } - - /** - * Get the savingsPlanVmFamilies property: List of VM Families that support Savings plan offer for assessments. - * - * @return the savingsPlanVmFamilies value. - */ - public List savingsPlanVmFamilies() { - return this.savingsPlanVmFamilies; - } - - /** - * Get the savingsPlanSupportedLocations property: List of Azure locations that support Savings plan offer for - * assessments. - * - * @return the savingsPlanSupportedLocations value. - */ - public List savingsPlanSupportedLocations() { - return this.savingsPlanSupportedLocations; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vmFamilies() != null) { - vmFamilies().forEach(e -> e.validate()); - } - if (ultraDiskVmFamilies() != null) { - ultraDiskVmFamilies().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssessmentOptionsProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessmentOptionsProperties 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 AssessmentOptionsProperties. - */ - public static AssessmentOptionsProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessmentOptionsProperties deserializedAssessmentOptionsProperties = new AssessmentOptionsProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("vmFamilies".equals(fieldName)) { - List vmFamilies = reader.readArray(reader1 -> VmFamilyOptions.fromJson(reader1)); - deserializedAssessmentOptionsProperties.vmFamilies = vmFamilies; - } else if ("reservedInstanceVmFamilies".equals(fieldName)) { - List reservedInstanceVmFamilies = reader.readArray(reader1 -> reader1.getString()); - deserializedAssessmentOptionsProperties.reservedInstanceVmFamilies = reservedInstanceVmFamilies; - } else if ("reservedInstanceSupportedLocations".equals(fieldName)) { - List reservedInstanceSupportedLocations = reader.readArray(reader1 -> reader1.getString()); - deserializedAssessmentOptionsProperties.reservedInstanceSupportedLocations - = reservedInstanceSupportedLocations; - } else if ("reservedInstanceSupportedCurrencies".equals(fieldName)) { - List reservedInstanceSupportedCurrencies = reader.readArray(reader1 -> reader1.getString()); - deserializedAssessmentOptionsProperties.reservedInstanceSupportedCurrencies - = reservedInstanceSupportedCurrencies; - } else if ("reservedInstanceSupportedOffers".equals(fieldName)) { - List reservedInstanceSupportedOffers = reader.readArray(reader1 -> reader1.getString()); - deserializedAssessmentOptionsProperties.reservedInstanceSupportedOffers - = reservedInstanceSupportedOffers; - } else if ("ultraDiskVmFamilies".equals(fieldName)) { - List ultraDiskVmFamilies - = reader.readArray(reader1 -> UltraDiskAssessmentOptions.fromJson(reader1)); - deserializedAssessmentOptionsProperties.ultraDiskVmFamilies = ultraDiskVmFamilies; - } else if ("premiumDiskVmFamilies".equals(fieldName)) { - List premiumDiskVmFamilies = reader.readArray(reader1 -> reader1.getString()); - deserializedAssessmentOptionsProperties.premiumDiskVmFamilies = premiumDiskVmFamilies; - } else if ("savingsPlanVmFamilies".equals(fieldName)) { - List savingsPlanVmFamilies = reader.readArray(reader1 -> reader1.getString()); - deserializedAssessmentOptionsProperties.savingsPlanVmFamilies = savingsPlanVmFamilies; - } else if ("savingsPlanSupportedLocations".equals(fieldName)) { - List savingsPlanSupportedLocations = reader.readArray(reader1 -> reader1.getString()); - deserializedAssessmentOptionsProperties.savingsPlanSupportedLocations - = savingsPlanSupportedLocations; - } else { - reader.skipChildren(); - } - } - - return deserializedAssessmentOptionsProperties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentProject.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentProject.java index e0a698589d8b..a9b3930eb750 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentProject.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentProject.java @@ -239,12 +239,12 @@ interface WithTags { */ interface WithProperties { /** - * Specifies the properties property: The updatable properties of the AssessmentProject.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param properties The updatable properties of the AssessmentProject. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - Update withProperties(AssessmentProjectUpdateProperties properties); + Update withProperties(ProjectProperties properties); } } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentProjectSummaryOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentProjectSummaryOperations.java index ec9c3338b8ec..22182a39c2c6 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentProjectSummaryOperations.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentProjectSummaryOperations.java @@ -23,7 +23,7 @@ public interface AssessmentProjectSummaryOperations { * @return the response of a AssessmentProjectSummary list operation as paginated response with * {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List AssessmentProjectSummary resources by AssessmentProject. @@ -37,15 +37,14 @@ public interface AssessmentProjectSummaryOperations { * @return the response of a AssessmentProjectSummary list operation as paginated response with * {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** * Get a AssessmentProjectSummary. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param projectName Assessment Project Name. - * @param projectSummaryName Group ARM name. + * @param projectSummaryName Assessment project summary resource. * @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. @@ -60,7 +59,7 @@ Response getWithResponse(String resourceGroupName, Str * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param projectName Assessment Project Name. - * @param projectSummaryName Group ARM name. + * @param projectSummaryName Assessment project summary resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentProjectUpdate.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentProjectUpdate.java index bec1baa28805..7460a4707d3a 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentProjectUpdate.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentProjectUpdate.java @@ -5,27 +5,42 @@ package com.azure.resourcemanager.migration.assessment.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; 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 type used for update operations of the AssessmentProject. + * An Assessment project site resource. */ @Fluent -public final class AssessmentProjectUpdate implements JsonSerializable { +public final class AssessmentProjectUpdate extends AzureResourceManagerCommonTypesTrackedResourceUpdate { /* - * Resource tags. + * The resource-specific properties for this resource. */ - private Map tags; + private ProjectProperties properties; /* - * The updatable properties of the AssessmentProject. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private AssessmentProjectUpdateProperties properties; + 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 AssessmentProjectUpdate class. @@ -34,42 +49,71 @@ public AssessmentProjectUpdate() { } /** - * Get the tags property: Resource tags. + * Get the properties property: The resource-specific properties for this resource. * - * @return the tags value. + * @return the properties value. */ - public Map tags() { - return this.tags; + public ProjectProperties properties() { + return this.properties; } /** - * Set the tags property: Resource tags. + * Set the properties property: The resource-specific properties for this resource. * - * @param tags the tags value to set. + * @param properties the properties value to set. * @return the AssessmentProjectUpdate object itself. */ - public AssessmentProjectUpdate withTags(Map tags) { - this.tags = tags; + public AssessmentProjectUpdate withProperties(ProjectProperties properties) { + this.properties = properties; return this; } /** - * Get the properties property: The updatable properties of the AssessmentProject. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the properties value. + * @return the systemData value. */ - public AssessmentProjectUpdateProperties properties() { - return this.properties; + @Override + public SystemData systemData() { + return this.systemData; } /** - * Set the properties property: The updatable properties of the AssessmentProject. + * Get the type property: The type of the resource. * - * @param properties the properties value to set. - * @return the AssessmentProjectUpdate object itself. + * @return the type value. */ - public AssessmentProjectUpdate withProperties(AssessmentProjectUpdateProperties properties) { - this.properties = properties; + @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; + } + + /** + * {@inheritDoc} + */ + @Override + public AssessmentProjectUpdate withTags(Map tags) { + super.withTags(tags); return this; } @@ -78,6 +122,7 @@ public AssessmentProjectUpdate withProperties(AssessmentProjectUpdateProperties * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { if (properties() != null) { properties().validate(); @@ -90,7 +135,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -101,6 +146,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of AssessmentProjectUpdate 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 AssessmentProjectUpdate. */ public static AssessmentProjectUpdate fromJson(JsonReader jsonReader) throws IOException { @@ -110,11 +156,19 @@ public static AssessmentProjectUpdate fromJson(JsonReader jsonReader) throws IOE String fieldName = reader.getFieldName(); reader.nextToken(); - if ("tags".equals(fieldName)) { + if ("id".equals(fieldName)) { + deserializedAssessmentProjectUpdate.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAssessmentProjectUpdate.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAssessmentProjectUpdate.type = reader.getString(); + } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedAssessmentProjectUpdate.tags = tags; + deserializedAssessmentProjectUpdate.withTags(tags); + } else if ("systemData".equals(fieldName)) { + deserializedAssessmentProjectUpdate.systemData = SystemData.fromJson(reader); } else if ("properties".equals(fieldName)) { - deserializedAssessmentProjectUpdate.properties = AssessmentProjectUpdateProperties.fromJson(reader); + deserializedAssessmentProjectUpdate.properties = ProjectProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentProjectUpdateProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentProjectUpdateProperties.java deleted file mode 100644 index 1c78f2b826f0..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentProjectUpdateProperties.java +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * The updatable properties of the AssessmentProject. - */ -@Fluent -public final class AssessmentProjectUpdateProperties implements JsonSerializable { - /* - * Assessment solution ARM id tracked by Microsoft.Migrate/migrateProjects. - */ - private String assessmentSolutionId; - - /* - * Assessment project status. - */ - private ProjectStatus projectStatus; - - /* - * The ARM id of service map workspace created by customer. - */ - private String customerWorkspaceId; - - /* - * Location of service map workspace created by customer. - */ - private String customerWorkspaceLocation; - - /* - * This value can be set to 'enabled' to avoid breaking changes on existing - * customer resources and templates. If set to 'disabled', traffic over public - * interface is not allowed, and private endpoint connections would be the - * exclusive access method. - */ - private String publicNetworkAccess; - - /* - * The ARM id of the storage account used for interactions when public access is - * disabled. - */ - private String customerStorageAccountArmId; - - /* - * The status of the last operation. - */ - private ProvisioningState provisioningState; - - /** - * Creates an instance of AssessmentProjectUpdateProperties class. - */ - public AssessmentProjectUpdateProperties() { - } - - /** - * Get the assessmentSolutionId property: Assessment solution ARM id tracked by Microsoft.Migrate/migrateProjects. - * - * @return the assessmentSolutionId value. - */ - public String assessmentSolutionId() { - return this.assessmentSolutionId; - } - - /** - * Set the assessmentSolutionId property: Assessment solution ARM id tracked by Microsoft.Migrate/migrateProjects. - * - * @param assessmentSolutionId the assessmentSolutionId value to set. - * @return the AssessmentProjectUpdateProperties object itself. - */ - public AssessmentProjectUpdateProperties withAssessmentSolutionId(String assessmentSolutionId) { - this.assessmentSolutionId = assessmentSolutionId; - return this; - } - - /** - * Get the projectStatus property: Assessment project status. - * - * @return the projectStatus value. - */ - public ProjectStatus projectStatus() { - return this.projectStatus; - } - - /** - * Set the projectStatus property: Assessment project status. - * - * @param projectStatus the projectStatus value to set. - * @return the AssessmentProjectUpdateProperties object itself. - */ - public AssessmentProjectUpdateProperties withProjectStatus(ProjectStatus projectStatus) { - this.projectStatus = projectStatus; - return this; - } - - /** - * Get the customerWorkspaceId property: The ARM id of service map workspace created by customer. - * - * @return the customerWorkspaceId value. - */ - public String customerWorkspaceId() { - return this.customerWorkspaceId; - } - - /** - * Set the customerWorkspaceId property: The ARM id of service map workspace created by customer. - * - * @param customerWorkspaceId the customerWorkspaceId value to set. - * @return the AssessmentProjectUpdateProperties object itself. - */ - public AssessmentProjectUpdateProperties withCustomerWorkspaceId(String customerWorkspaceId) { - this.customerWorkspaceId = customerWorkspaceId; - return this; - } - - /** - * Get the customerWorkspaceLocation property: Location of service map workspace created by customer. - * - * @return the customerWorkspaceLocation value. - */ - public String customerWorkspaceLocation() { - return this.customerWorkspaceLocation; - } - - /** - * Set the customerWorkspaceLocation property: Location of service map workspace created by customer. - * - * @param customerWorkspaceLocation the customerWorkspaceLocation value to set. - * @return the AssessmentProjectUpdateProperties object itself. - */ - public AssessmentProjectUpdateProperties withCustomerWorkspaceLocation(String customerWorkspaceLocation) { - this.customerWorkspaceLocation = customerWorkspaceLocation; - return this; - } - - /** - * Get the publicNetworkAccess property: This value can be set to 'enabled' to avoid breaking changes on existing - * customer resources and templates. If set to 'disabled', traffic over public - * interface is not allowed, and private endpoint connections would be the - * exclusive access method. - * - * @return the publicNetworkAccess value. - */ - public String publicNetworkAccess() { - return this.publicNetworkAccess; - } - - /** - * Set the publicNetworkAccess property: This value can be set to 'enabled' to avoid breaking changes on existing - * customer resources and templates. If set to 'disabled', traffic over public - * interface is not allowed, and private endpoint connections would be the - * exclusive access method. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the AssessmentProjectUpdateProperties object itself. - */ - public AssessmentProjectUpdateProperties withPublicNetworkAccess(String publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; - return this; - } - - /** - * Get the customerStorageAccountArmId property: The ARM id of the storage account used for interactions when public - * access is - * disabled. - * - * @return the customerStorageAccountArmId value. - */ - public String customerStorageAccountArmId() { - return this.customerStorageAccountArmId; - } - - /** - * Set the customerStorageAccountArmId property: The ARM id of the storage account used for interactions when public - * access is - * disabled. - * - * @param customerStorageAccountArmId the customerStorageAccountArmId value to set. - * @return the AssessmentProjectUpdateProperties object itself. - */ - public AssessmentProjectUpdateProperties withCustomerStorageAccountArmId(String customerStorageAccountArmId) { - this.customerStorageAccountArmId = customerStorageAccountArmId; - return this; - } - - /** - * Get the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The status of the last operation. - * - * @param provisioningState the provisioningState value to set. - * @return the AssessmentProjectUpdateProperties object itself. - */ - public AssessmentProjectUpdateProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - 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("assessmentSolutionId", this.assessmentSolutionId); - jsonWriter.writeStringField("projectStatus", this.projectStatus == null ? null : this.projectStatus.toString()); - jsonWriter.writeStringField("customerWorkspaceId", this.customerWorkspaceId); - jsonWriter.writeStringField("customerWorkspaceLocation", this.customerWorkspaceLocation); - jsonWriter.writeStringField("publicNetworkAccess", this.publicNetworkAccess); - jsonWriter.writeStringField("customerStorageAccountArmId", this.customerStorageAccountArmId); - jsonWriter.writeStringField("provisioningState", - this.provisioningState == null ? null : this.provisioningState.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssessmentProjectUpdateProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessmentProjectUpdateProperties 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 AssessmentProjectUpdateProperties. - */ - public static AssessmentProjectUpdateProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessmentProjectUpdateProperties deserializedAssessmentProjectUpdateProperties - = new AssessmentProjectUpdateProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("assessmentSolutionId".equals(fieldName)) { - deserializedAssessmentProjectUpdateProperties.assessmentSolutionId = reader.getString(); - } else if ("projectStatus".equals(fieldName)) { - deserializedAssessmentProjectUpdateProperties.projectStatus - = ProjectStatus.fromString(reader.getString()); - } else if ("customerWorkspaceId".equals(fieldName)) { - deserializedAssessmentProjectUpdateProperties.customerWorkspaceId = reader.getString(); - } else if ("customerWorkspaceLocation".equals(fieldName)) { - deserializedAssessmentProjectUpdateProperties.customerWorkspaceLocation = reader.getString(); - } else if ("publicNetworkAccess".equals(fieldName)) { - deserializedAssessmentProjectUpdateProperties.publicNetworkAccess = reader.getString(); - } else if ("customerStorageAccountArmId".equals(fieldName)) { - deserializedAssessmentProjectUpdateProperties.customerStorageAccountArmId = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedAssessmentProjectUpdateProperties.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessmentProjectUpdateProperties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentSource.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentSource.java new file mode 100644 index 000000000000..9e8d9f416b36 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentSource.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Assessment Source. + */ +public final class AssessmentSource extends ExpandableStringEnum { + /** + * Static value Unknown for AssessmentSource. + */ + public static final AssessmentSource UNKNOWN = fromString("Unknown"); + + /** + * Static value Machine for AssessmentSource. + */ + public static final AssessmentSource MACHINE = fromString("Machine"); + + /** + * Static value IIS for AssessmentSource. + */ + public static final AssessmentSource IIS = fromString("IIS"); + + /** + * Static value TomCat for AssessmentSource. + */ + public static final AssessmentSource TOM_CAT = fromString("TomCat"); + + /** + * Static value OracleServer for AssessmentSource. + */ + public static final AssessmentSource ORACLE_SERVER = fromString("OracleServer"); + + /** + * Static value OracleDatabase for AssessmentSource. + */ + public static final AssessmentSource ORACLE_DATABASE = fromString("OracleDatabase"); + + /** + * Static value SAPInstance for AssessmentSource. + */ + public static final AssessmentSource SAPINSTANCE = fromString("SAPInstance"); + + /** + * Static value SpringbootApplication for AssessmentSource. + */ + public static final AssessmentSource SPRINGBOOT_APPLICATION = fromString("SpringbootApplication"); + + /** + * Static value MySQLServer for AssessmentSource. + */ + public static final AssessmentSource MY_SQLSERVER = fromString("MySQLServer"); + + /** + * Static value SqlInstance for AssessmentSource. + */ + public static final AssessmentSource SQL_INSTANCE = fromString("SqlInstance"); + + /** + * Static value SqlDatabase for AssessmentSource. + */ + public static final AssessmentSource SQL_DATABASE = fromString("SqlDatabase"); + + /** + * Static value WebApps for AssessmentSource. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentStage.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentStage.java deleted file mode 100644 index 862757c89f72..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentStage.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AssessmentStage. - */ -public final class AssessmentStage extends ExpandableStringEnum { - /** - * Static value InProgress for AssessmentStage. - */ - public static final AssessmentStage IN_PROGRESS = fromString("InProgress"); - - /** - * Static value UnderReview for AssessmentStage. - */ - public static final AssessmentStage UNDER_REVIEW = fromString("UnderReview"); - - /** - * Static value Approved for AssessmentStage. - */ - public static final AssessmentStage APPROVED = fromString("Approved"); - - /** - * Creates a new instance of AssessmentStage value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AssessmentStage() { - } - - /** - * Creates or finds a AssessmentStage from its string representation. - * - * @param name a name to look for. - * @return the corresponding AssessmentStage. - */ - public static AssessmentStage fromString(String name) { - return fromString(name, AssessmentStage.class); - } - - /** - * Gets known AssessmentStage values. - * - * @return known AssessmentStage values. - */ - public static Collection values() { - return values(AssessmentStage.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentStatus.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentStatus.java index 090934c77182..23e19f56b10e 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentStatus.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentStatus.java @@ -51,6 +51,11 @@ public final class AssessmentStatus extends ExpandableStringEnum { - /** - * Static value Unknown for AssessmentType. - */ - public static final AssessmentType UNKNOWN = fromString("Unknown"); - - /** - * Static value MachineAssessment for AssessmentType. - */ - public static final AssessmentType MACHINE_ASSESSMENT = fromString("MachineAssessment"); - - /** - * Static value AvsAssessment for AssessmentType. - */ - public static final AssessmentType AVS_ASSESSMENT = fromString("AvsAssessment"); - - /** - * Static value SqlAssessment for AssessmentType. - */ - public static final AssessmentType SQL_ASSESSMENT = fromString("SqlAssessment"); - - /** - * Static value WebAppAssessment for AssessmentType. - */ - public static final AssessmentType WEB_APP_ASSESSMENT = fromString("WebAppAssessment"); - - /** - * Creates a new instance of AssessmentType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AssessmentType() { - } - - /** - * Creates or finds a AssessmentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AssessmentType. - */ - public static AssessmentType fromString(String name) { - return fromString(name, AssessmentType.class); - } - - /** - * Gets known AssessmentType values. - * - * @return known AssessmentType values. - */ - public static Collection values() { - return values(AssessmentType.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentsOperations.java deleted file mode 100644 index a0a13ba605c2..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AssessmentsOperations.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 AssessmentsOperations. - */ -public interface AssessmentsOperations { - /** - * List Assessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Assessment list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName); - - /** - * List Assessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Assessment list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName, - Context context); - - /** - * Get a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 Assessment along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, Context context); - - /** - * Get a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 Assessment. - */ - Assessment get(String resourceGroupName, String projectName, String groupName, String assessmentName); - - /** - * Delete a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 groupName, - String assessmentName, Context context); - - /** - * Delete a Assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName Machine Assessment 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 groupName, 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 URL for downloading the assessment in a report format. - */ - DownloadUrl downloadUrl(String resourceGroupName, String projectName, String groupName, String assessmentName, - Object 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 groupName Group ARM name. - * @param assessmentName Machine Assessment 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 URL for downloading the assessment in a report format. - */ - DownloadUrl downloadUrl(String resourceGroupName, String projectName, String groupName, String assessmentName, - Object body, Context context); - - /** - * Get a Assessment. - * - * @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 Assessment along with {@link Response}. - */ - Assessment getById(String id); - - /** - * Get a Assessment. - * - * @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 Assessment along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a Assessment. - * - * @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 Assessment. - * - * @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 Assessment resource. - * - * @param name resource name. - * @return the first stage of the new Assessment definition. - */ - Assessment.DefinitionStages.Blank define(String name); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AsyncCommitModeIntent.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AsyncCommitModeIntent.java index e85e5652e36d..4915afa08164 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AsyncCommitModeIntent.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AsyncCommitModeIntent.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for AsyncCommitModeIntent. + * Async Commit Mode Intent. */ public final class AsyncCommitModeIntent extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedDisk.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedDisk.java deleted file mode 100644 index 9ffdeb72f89c..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedDisk.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * AVS assessed disk web model class. - */ -@Immutable -public final class AvsAssessedDisk implements JsonSerializable { - /* - * Gets the ID of the disk. - */ - private String name; - - /* - * Gets the display name of the disk. - */ - private String displayName; - - /* - * Gigabytes Provisioned for a disk in private data center. - */ - private Float gigabytesProvisioned; - - /* - * Disk Read Throughput in MB/s. - */ - private Float megabytesPerSecondOfRead; - - /* - * Disk Write Throughput in MB/s. - */ - private Float megabytesPerSecondOfWrite; - - /* - * Read Operations per second. - */ - private Float numberOfReadOperationsPerSecond; - - /* - * Write Operations per second. - */ - private Float numberOfWriteOperationsPerSecond; - - /** - * Creates an instance of AvsAssessedDisk class. - */ - public AvsAssessedDisk() { - } - - /** - * Get the name property: Gets the ID of the disk. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the displayName property: Gets the display name of the disk. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the gigabytesProvisioned property: Gigabytes Provisioned for a disk in private data center. - * - * @return the gigabytesProvisioned value. - */ - public Float gigabytesProvisioned() { - return this.gigabytesProvisioned; - } - - /** - * Get the megabytesPerSecondOfRead property: Disk Read Throughput in MB/s. - * - * @return the megabytesPerSecondOfRead value. - */ - public Float megabytesPerSecondOfRead() { - return this.megabytesPerSecondOfRead; - } - - /** - * Get the megabytesPerSecondOfWrite property: Disk Write Throughput in MB/s. - * - * @return the megabytesPerSecondOfWrite value. - */ - public Float megabytesPerSecondOfWrite() { - return this.megabytesPerSecondOfWrite; - } - - /** - * Get the numberOfReadOperationsPerSecond property: Read Operations per second. - * - * @return the numberOfReadOperationsPerSecond value. - */ - public Float numberOfReadOperationsPerSecond() { - return this.numberOfReadOperationsPerSecond; - } - - /** - * Get the numberOfWriteOperationsPerSecond property: Write Operations per second. - * - * @return the numberOfWriteOperationsPerSecond value. - */ - public Float 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(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AvsAssessedDisk from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AvsAssessedDisk 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 AvsAssessedDisk. - */ - public static AvsAssessedDisk fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AvsAssessedDisk deserializedAvsAssessedDisk = new AvsAssessedDisk(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedAvsAssessedDisk.name = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedAvsAssessedDisk.displayName = reader.getString(); - } else if ("gigabytesProvisioned".equals(fieldName)) { - deserializedAvsAssessedDisk.gigabytesProvisioned = reader.getNullable(JsonReader::getFloat); - } else if ("megabytesPerSecondOfRead".equals(fieldName)) { - deserializedAvsAssessedDisk.megabytesPerSecondOfRead = reader.getNullable(JsonReader::getFloat); - } else if ("megabytesPerSecondOfWrite".equals(fieldName)) { - deserializedAvsAssessedDisk.megabytesPerSecondOfWrite = reader.getNullable(JsonReader::getFloat); - } else if ("numberOfReadOperationsPerSecond".equals(fieldName)) { - deserializedAvsAssessedDisk.numberOfReadOperationsPerSecond - = reader.getNullable(JsonReader::getFloat); - } else if ("numberOfWriteOperationsPerSecond".equals(fieldName)) { - deserializedAvsAssessedDisk.numberOfWriteOperationsPerSecond - = reader.getNullable(JsonReader::getFloat); - } else { - reader.skipChildren(); - } - } - - return deserializedAvsAssessedDisk; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedDiskV2.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedDiskV2.java new file mode 100644 index 000000000000..bf3f4aae3a86 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedDiskV2.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * AVS assessed disk web model class. + */ +@Immutable +public final class AvsAssessedDiskV2 implements JsonSerializable { + /* + * Gets the ID of the disk. + */ + private String name; + + /* + * Gets the display name of the disk. + */ + private String displayName; + + /* + * Gigabytes Provisioned for a disk in private data center. + */ + private Float gigabytesProvisioned; + + /* + * Disk Read Throughput in MB/s. + */ + private Float megabytesPerSecondOfRead; + + /* + * Disk Write Throughput in MB/s. + */ + private Float megabytesPerSecondOfWrite; + + /* + * Read Operations per second. + */ + private Float numberOfReadOperationsPerSecond; + + /* + * Write Operations per second. + */ + private Float numberOfWriteOperationsPerSecond; + + /* + * Associated storage Type recommended for Disk. + */ + private ExternalStorageType assessedExternalStorageType; + + /* + * Estimated Disk Size in GB. + */ + private Float estimatedDiskSizeInGB; + + /** + * Creates an instance of AvsAssessedDiskV2 class. + */ + public AvsAssessedDiskV2() { + } + + /** + * Get the name property: Gets the ID of the disk. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the displayName property: Gets the display name of the disk. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the gigabytesProvisioned property: Gigabytes Provisioned for a disk in private data center. + * + * @return the gigabytesProvisioned value. + */ + public Float gigabytesProvisioned() { + return this.gigabytesProvisioned; + } + + /** + * Get the megabytesPerSecondOfRead property: Disk Read Throughput in MB/s. + * + * @return the megabytesPerSecondOfRead value. + */ + public Float megabytesPerSecondOfRead() { + return this.megabytesPerSecondOfRead; + } + + /** + * Get the megabytesPerSecondOfWrite property: Disk Write Throughput in MB/s. + * + * @return the megabytesPerSecondOfWrite value. + */ + public Float megabytesPerSecondOfWrite() { + return this.megabytesPerSecondOfWrite; + } + + /** + * Get the numberOfReadOperationsPerSecond property: Read Operations per second. + * + * @return the numberOfReadOperationsPerSecond value. + */ + public Float numberOfReadOperationsPerSecond() { + return this.numberOfReadOperationsPerSecond; + } + + /** + * Get the numberOfWriteOperationsPerSecond property: Write Operations per second. + * + * @return the numberOfWriteOperationsPerSecond value. + */ + public Float numberOfWriteOperationsPerSecond() { + return this.numberOfWriteOperationsPerSecond; + } + + /** + * Get the assessedExternalStorageType property: Associated storage Type recommended for Disk. + * + * @return the assessedExternalStorageType value. + */ + public ExternalStorageType assessedExternalStorageType() { + return this.assessedExternalStorageType; + } + + /** + * Get the estimatedDiskSizeInGB property: Estimated Disk Size in GB. + * + * @return the estimatedDiskSizeInGB value. + */ + public Float estimatedDiskSizeInGB() { + return this.estimatedDiskSizeInGB; + } + + /** + * 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 AvsAssessedDiskV2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessedDiskV2 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 AvsAssessedDiskV2. + */ + public static AvsAssessedDiskV2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessedDiskV2 deserializedAvsAssessedDiskV2 = new AvsAssessedDiskV2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAvsAssessedDiskV2.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAvsAssessedDiskV2.displayName = reader.getString(); + } else if ("gigabytesProvisioned".equals(fieldName)) { + deserializedAvsAssessedDiskV2.gigabytesProvisioned = reader.getNullable(JsonReader::getFloat); + } else if ("megabytesPerSecondOfRead".equals(fieldName)) { + deserializedAvsAssessedDiskV2.megabytesPerSecondOfRead = reader.getNullable(JsonReader::getFloat); + } else if ("megabytesPerSecondOfWrite".equals(fieldName)) { + deserializedAvsAssessedDiskV2.megabytesPerSecondOfWrite = reader.getNullable(JsonReader::getFloat); + } else if ("numberOfReadOperationsPerSecond".equals(fieldName)) { + deserializedAvsAssessedDiskV2.numberOfReadOperationsPerSecond + = reader.getNullable(JsonReader::getFloat); + } else if ("numberOfWriteOperationsPerSecond".equals(fieldName)) { + deserializedAvsAssessedDiskV2.numberOfWriteOperationsPerSecond + = reader.getNullable(JsonReader::getFloat); + } else if ("assessedExternalStorageType".equals(fieldName)) { + deserializedAvsAssessedDiskV2.assessedExternalStorageType + = ExternalStorageType.fromString(reader.getString()); + } else if ("estimatedDiskSizeInGB".equals(fieldName)) { + deserializedAvsAssessedDiskV2.estimatedDiskSizeInGB = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessedDiskV2; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachine.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachine.java deleted file mode 100644 index 3d1507001f14..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachine.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessedMachineInner; - -/** - * An immutable client-side representation of AvsAssessedMachine. - */ -public interface AvsAssessedMachine { - /** - * 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. - */ - AvsAssessedMachineProperties 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.migration.assessment.fluent.models.AvsAssessedMachineInner object. - * - * @return the inner object. - */ - AvsAssessedMachineInner innerModel(); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachineExtendedDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachineExtendedDetails.java new file mode 100644 index 000000000000..01f7e326e7c3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachineExtendedDetails.java @@ -0,0 +1,373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 avs assessed machine extended details. + */ +@Immutable +public final class AvsAssessedMachineExtendedDetails implements JsonSerializable { + /* + * List of errors for this machine. + */ + private List errors; + + /* + * List of Disks that were assessed as part of this machine's assessment. + */ + private List disks; + + /* + * List of Network Adapters that were assessed as part of this machine's + * assessment. + */ + private List networkAdapters; + + /* + * Gets the storage in use. + */ + private Float storageInUseGB; + + /* + * 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; + + /* + * Display Name of the Machine. + */ + private String displayName; + + /* + * Description for the machine. + */ + private String description; + + /* + * Data center management server name. + */ + private String datacenterManagementServerName; + + /* + * Megabytes of memory found allocated for the machine in private data center. + */ + private Float 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 Float percentageCoresUtilization; + + /* + * Percentile of Percentage of Memory Utilized noted during time period T. + * + * Here N and T are settings on Assessment. + */ + private Float percentageMemoryUtilization; + + /* + * Gets the Avs Target Type for Machine. + */ + private AzureAvsNodeType avsTargetNode; + + /** + * Creates an instance of AvsAssessedMachineExtendedDetails class. + */ + public AvsAssessedMachineExtendedDetails() { + } + + /** + * Get the errors property: List of errors for this machine. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Get the disks property: List of Disks that were assessed as part of this machine's assessment. + * + * @return the disks value. + */ + public List disks() { + return this.disks; + } + + /** + * 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 storageInUseGB property: Gets the storage in use. + * + * @return the storageInUseGB value. + */ + public Float storageInUseGB() { + return this.storageInUseGB; + } + + /** + * 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 displayName property: Display Name of the Machine. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the description property: Description for the machine. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the datacenterManagementServerName property: Data center management server name. + * + * @return the datacenterManagementServerName value. + */ + public String datacenterManagementServerName() { + return this.datacenterManagementServerName; + } + + /** + * Get the megabytesOfMemory property: Megabytes of memory found allocated for the machine in private data center. + * + * @return the megabytesOfMemory value. + */ + public Float 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 Float 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 Float percentageMemoryUtilization() { + return this.percentageMemoryUtilization; + } + + /** + * Get the avsTargetNode property: Gets the Avs Target Type for Machine. + * + * @return the avsTargetNode value. + */ + public AzureAvsNodeType avsTargetNode() { + return this.avsTargetNode; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + if (disks() != null) { + disks().forEach(e -> e.validate()); + } + if (networkAdapters() != null) { + networkAdapters().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvsAssessedMachineExtendedDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessedMachineExtendedDetails 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 AvsAssessedMachineExtendedDetails. + */ + public static AvsAssessedMachineExtendedDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessedMachineExtendedDetails deserializedAvsAssessedMachineExtendedDetails + = new AvsAssessedMachineExtendedDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + deserializedAvsAssessedMachineExtendedDetails.errors = errors; + } else if ("disks".equals(fieldName)) { + List disks = reader.readArray(reader1 -> AvsAssessedDiskV2.fromJson(reader1)); + deserializedAvsAssessedMachineExtendedDetails.disks = disks; + } else if ("networkAdapters".equals(fieldName)) { + List networkAdapters + = reader.readArray(reader1 -> AvsAssessedNetworkAdapter.fromJson(reader1)); + deserializedAvsAssessedMachineExtendedDetails.networkAdapters = networkAdapters; + } else if ("storageInUseGB".equals(fieldName)) { + deserializedAvsAssessedMachineExtendedDetails.storageInUseGB + = reader.getNullable(JsonReader::getFloat); + } else if ("bootType".equals(fieldName)) { + deserializedAvsAssessedMachineExtendedDetails.bootType + = MachineBootType.fromString(reader.getString()); + } else if ("operatingSystemType".equals(fieldName)) { + deserializedAvsAssessedMachineExtendedDetails.operatingSystemType = reader.getString(); + } else if ("operatingSystemName".equals(fieldName)) { + deserializedAvsAssessedMachineExtendedDetails.operatingSystemName = reader.getString(); + } else if ("operatingSystemVersion".equals(fieldName)) { + deserializedAvsAssessedMachineExtendedDetails.operatingSystemVersion = reader.getString(); + } else if ("operatingSystemArchitecture".equals(fieldName)) { + deserializedAvsAssessedMachineExtendedDetails.operatingSystemArchitecture + = GuestOperatingSystemArchitecture.fromString(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedAvsAssessedMachineExtendedDetails.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAvsAssessedMachineExtendedDetails.description = reader.getString(); + } else if ("datacenterManagementServerName".equals(fieldName)) { + deserializedAvsAssessedMachineExtendedDetails.datacenterManagementServerName = reader.getString(); + } else if ("megabytesOfMemory".equals(fieldName)) { + deserializedAvsAssessedMachineExtendedDetails.megabytesOfMemory + = reader.getNullable(JsonReader::getFloat); + } else if ("numberOfCores".equals(fieldName)) { + deserializedAvsAssessedMachineExtendedDetails.numberOfCores + = reader.getNullable(JsonReader::getInt); + } else if ("percentageCoresUtilization".equals(fieldName)) { + deserializedAvsAssessedMachineExtendedDetails.percentageCoresUtilization + = reader.getNullable(JsonReader::getFloat); + } else if ("percentageMemoryUtilization".equals(fieldName)) { + deserializedAvsAssessedMachineExtendedDetails.percentageMemoryUtilization + = reader.getNullable(JsonReader::getFloat); + } else if ("avsTargetNode".equals(fieldName)) { + deserializedAvsAssessedMachineExtendedDetails.avsTargetNode + = AzureAvsNodeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessedMachineExtendedDetails; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachineListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachineListResult.java deleted file mode 100644 index f1a418ea5c51..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachineListResult.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -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.migration.assessment.fluent.models.AvsAssessedMachineInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a AvsAssessedMachine list operation. - */ -@Fluent -public final class AvsAssessedMachineListResult implements JsonSerializable { - /* - * The AvsAssessedMachine items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of AvsAssessedMachineListResult class. - */ - public AvsAssessedMachineListResult() { - } - - /** - * Get the value property: The AvsAssessedMachine items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The AvsAssessedMachine items on this page. - * - * @param value the value value to set. - * @return the AvsAssessedMachineListResult object itself. - */ - public AvsAssessedMachineListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the AvsAssessedMachineListResult object itself. - */ - public AvsAssessedMachineListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * 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 AvsAssessedMachineListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AvsAssessedMachineListResult.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 AvsAssessedMachineListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AvsAssessedMachineListResult 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 AvsAssessedMachineListResult. - */ - public static AvsAssessedMachineListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AvsAssessedMachineListResult deserializedAvsAssessedMachineListResult = new AvsAssessedMachineListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AvsAssessedMachineInner.fromJson(reader1)); - deserializedAvsAssessedMachineListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAvsAssessedMachineListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAvsAssessedMachineListResult; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachineProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachineProperties.java deleted file mode 100644 index fc978a354155..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachineProperties.java +++ /dev/null @@ -1,515 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; -import java.util.Map; - -/** - * AVS assessed machine properties web model. - */ -@Immutable -public final class AvsAssessedMachineProperties implements JsonSerializable { - /* - * List of errors for this machine. - */ - private List errors; - - /* - * List of Disks that were assessed as part of this machine's assessment. - */ - private Map disks; - - /* - * List of Network Adapters that were assessed as part of this machine's - * assessment. - */ - private Map networkAdapters; - - /* - * Gets the storage in use. - */ - private Float storageInUseGB; - - /* - * Gets the explanation if machine is not suitable for cloud. - */ - private AzureAvsVmSuitabilityExplanation suitabilityExplanation; - - /* - * Gets the details if machine is not suitable for cloud. - */ - private AzureAvsVmSuitabilityDetail suitabilityDetail; - - /* - * Assessed machine type. - */ - private AssessedMachineType type; - - /* - * 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; - - /* - * When was machine first created. - */ - private OffsetDateTime createdTimestamp; - - /* - * When was machine last updated. - */ - private OffsetDateTime updatedTimestamp; - - /* - * Display Name of the Machine. - */ - private String displayName; - - /* - * Description for the machine. - */ - private String description; - - /* - * Data center machine ARM id. - */ - private String datacenterMachineArmId; - - /* - * Data center management server ARM id. - */ - private String datacenterManagementServerArmId; - - /* - * Data center management server name. - */ - private String datacenterManagementServerName; - - /* - * Megabytes of memory found allocated for the machine in private data center. - */ - private Float megabytesOfMemory; - - /* - * Number of CPU cores found on the machine. - */ - private Integer numberOfCores; - - /* - * Confidence Rating in Percentage. - */ - private Float confidenceRatingInPercentage; - - /* - * Percentile of Percentage of Cores Utilized noted during time period T. - * - * Here N and T are settings on Assessment. - */ - private Float percentageCoresUtilization; - - /* - * Percentile of Percentage of Memory Utilized noted during time period T. - * - * Here N and T are settings on Assessment. - */ - private Float percentageMemoryUtilization; - - /* - * Gets a value indicating whether machine is suitable for the cloud platform - * selected. - */ - private CloudSuitability suitability; - - /** - * Creates an instance of AvsAssessedMachineProperties class. - */ - public AvsAssessedMachineProperties() { - } - - /** - * Get the errors property: List of errors for this machine. - * - * @return the errors value. - */ - public List errors() { - return this.errors; - } - - /** - * Get the disks property: List of Disks that were assessed as part of this machine's assessment. - * - * @return the disks value. - */ - public Map disks() { - return this.disks; - } - - /** - * Get the networkAdapters property: List of Network Adapters that were assessed as part of this machine's - * assessment. - * - * @return the networkAdapters value. - */ - public Map networkAdapters() { - return this.networkAdapters; - } - - /** - * Get the storageInUseGB property: Gets the storage in use. - * - * @return the storageInUseGB value. - */ - public Float storageInUseGB() { - return this.storageInUseGB; - } - - /** - * Get the suitabilityExplanation property: Gets the explanation if machine is not suitable for cloud. - * - * @return the suitabilityExplanation value. - */ - public AzureAvsVmSuitabilityExplanation suitabilityExplanation() { - return this.suitabilityExplanation; - } - - /** - * Get the suitabilityDetail property: Gets the details if machine is not suitable for cloud. - * - * @return the suitabilityDetail value. - */ - public AzureAvsVmSuitabilityDetail suitabilityDetail() { - return this.suitabilityDetail; - } - - /** - * Get the type property: Assessed machine type. - * - * @return the type value. - */ - public AssessedMachineType type() { - return this.type; - } - - /** - * 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 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; - } - - /** - * Get the displayName property: Display Name of the Machine. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the description property: Description for the machine. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the datacenterMachineArmId property: Data center machine ARM id. - * - * @return the datacenterMachineArmId value. - */ - public String datacenterMachineArmId() { - return this.datacenterMachineArmId; - } - - /** - * Get the datacenterManagementServerArmId property: Data center management server ARM id. - * - * @return the datacenterManagementServerArmId value. - */ - public String datacenterManagementServerArmId() { - return this.datacenterManagementServerArmId; - } - - /** - * Get the datacenterManagementServerName property: Data center management server name. - * - * @return the datacenterManagementServerName value. - */ - public String datacenterManagementServerName() { - return this.datacenterManagementServerName; - } - - /** - * Get the megabytesOfMemory property: Megabytes of memory found allocated for the machine in private data center. - * - * @return the megabytesOfMemory value. - */ - public Float 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 confidenceRatingInPercentage property: Confidence Rating in Percentage. - * - * @return the confidenceRatingInPercentage value. - */ - public Float confidenceRatingInPercentage() { - return this.confidenceRatingInPercentage; - } - - /** - * 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 Float 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 Float percentageMemoryUtilization() { - return this.percentageMemoryUtilization; - } - - /** - * Get the suitability property: Gets a value indicating whether machine is suitable for the cloud platform - * selected. - * - * @return the suitability value. - */ - public CloudSuitability suitability() { - return this.suitability; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (errors() != null) { - errors().forEach(e -> e.validate()); - } - if (disks() != null) { - disks().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - if (networkAdapters() != null) { - networkAdapters().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AvsAssessedMachineProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AvsAssessedMachineProperties 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 AvsAssessedMachineProperties. - */ - public static AvsAssessedMachineProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AvsAssessedMachineProperties deserializedAvsAssessedMachineProperties = new AvsAssessedMachineProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("errors".equals(fieldName)) { - List errors = reader.readArray(reader1 -> Error.fromJson(reader1)); - deserializedAvsAssessedMachineProperties.errors = errors; - } else if ("disks".equals(fieldName)) { - Map disks = reader.readMap(reader1 -> AvsAssessedDisk.fromJson(reader1)); - deserializedAvsAssessedMachineProperties.disks = disks; - } else if ("networkAdapters".equals(fieldName)) { - Map networkAdapters - = reader.readMap(reader1 -> AvsAssessedNetworkAdapter.fromJson(reader1)); - deserializedAvsAssessedMachineProperties.networkAdapters = networkAdapters; - } else if ("storageInUseGB".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.storageInUseGB = reader.getNullable(JsonReader::getFloat); - } else if ("suitabilityExplanation".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.suitabilityExplanation - = AzureAvsVmSuitabilityExplanation.fromString(reader.getString()); - } else if ("suitabilityDetail".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.suitabilityDetail - = AzureAvsVmSuitabilityDetail.fromString(reader.getString()); - } else if ("type".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.type = AssessedMachineType.fromString(reader.getString()); - } else if ("bootType".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.bootType = MachineBootType.fromString(reader.getString()); - } else if ("operatingSystemType".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.operatingSystemType = reader.getString(); - } else if ("operatingSystemName".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.operatingSystemName = reader.getString(); - } else if ("operatingSystemVersion".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.operatingSystemVersion = reader.getString(); - } else if ("operatingSystemArchitecture".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.operatingSystemArchitecture - = GuestOperatingSystemArchitecture.fromString(reader.getString()); - } else if ("createdTimestamp".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.createdTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("updatedTimestamp".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.updatedTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("displayName".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.displayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.description = reader.getString(); - } else if ("datacenterMachineArmId".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.datacenterMachineArmId = reader.getString(); - } else if ("datacenterManagementServerArmId".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.datacenterManagementServerArmId = reader.getString(); - } else if ("datacenterManagementServerName".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.datacenterManagementServerName = reader.getString(); - } else if ("megabytesOfMemory".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.megabytesOfMemory - = reader.getNullable(JsonReader::getFloat); - } else if ("numberOfCores".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.numberOfCores = reader.getNullable(JsonReader::getInt); - } else if ("confidenceRatingInPercentage".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.confidenceRatingInPercentage - = reader.getNullable(JsonReader::getFloat); - } else if ("percentageCoresUtilization".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.percentageCoresUtilization - = reader.getNullable(JsonReader::getFloat); - } else if ("percentageMemoryUtilization".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.percentageMemoryUtilization - = reader.getNullable(JsonReader::getFloat); - } else if ("suitability".equals(fieldName)) { - deserializedAvsAssessedMachineProperties.suitability - = CloudSuitability.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAvsAssessedMachineProperties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinePropertiesV2.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinePropertiesV2.java new file mode 100644 index 000000000000..2d6ca94f054f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinePropertiesV2.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * AVS assessed machine properties web model. + */ +@Immutable +public final class AvsAssessedMachinePropertiesV2 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 AvsAssessedMachineExtendedDetails extendedDetails; + + /* + * Assessed machine type. + */ + private AssessedMachineType assessedMachineType; + + /* + * When was machine first created. + */ + private OffsetDateTime createdTimestamp; + + /* + * When was machine last updated. + */ + private OffsetDateTime updatedTimestamp; + + /** + * Creates an instance of AvsAssessedMachinePropertiesV2 class. + */ + public AvsAssessedMachinePropertiesV2() { + } + + /** + * 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 AvsAssessedMachineExtendedDetails extendedDetails() { + return this.extendedDetails; + } + + /** + * Get the assessedMachineType property: Assessed machine type. + * + * @return the assessedMachineType value. + */ + public AssessedMachineType assessedMachineType() { + return this.assessedMachineType; + } + + /** + * 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 AvsAssessedMachinePropertiesV2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessedMachinePropertiesV2 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 AvsAssessedMachinePropertiesV2. + */ + public static AvsAssessedMachinePropertiesV2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessedMachinePropertiesV2 deserializedAvsAssessedMachinePropertiesV2 + = new AvsAssessedMachinePropertiesV2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("workloadType".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2.workloadType + = MigrateWorkloadType.fromString(reader.getString()); + } else if ("linkages".equals(fieldName)) { + List linkages = reader.readArray(reader1 -> Linkages.fromJson(reader1)); + deserializedAvsAssessedMachinePropertiesV2.linkages = linkages; + } else if ("recommendations".equals(fieldName)) { + List recommendations = reader + .readArray(reader1 -> AvsAssessedMachinePropertiesV2RecommendationsItem.fromJson(reader1)); + deserializedAvsAssessedMachinePropertiesV2.recommendations = recommendations; + } else if ("extendedDetails".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2.extendedDetails + = AvsAssessedMachineExtendedDetails.fromJson(reader); + } else if ("assessedMachineType".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2.assessedMachineType + = AssessedMachineType.fromString(reader.getString()); + } else if ("createdTimestamp".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2.createdTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedTimestamp".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2.updatedTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessedMachinePropertiesV2; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinePropertiesV2RecommendationsItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinePropertiesV2RecommendationsItem.java new file mode 100644 index 000000000000..c9fb4a2dcb70 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinePropertiesV2RecommendationsItem.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * AVS-specific recommendations details. + */ +@Fluent +public final class AvsAssessedMachinePropertiesV2RecommendationsItem + implements JsonSerializable { + /* + * The configuration data. + */ + private Configuration configuration; + + /* + * The recommended details. + */ + private RecommendedFor recommendedFor; + + /* + * The migration Platform. + */ + private MigrationPlatform migrationPlatform; + + /* + * The confidence score. + */ + private Float 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; + + /* + * Gets or sets the machine assessment ARM ID for VM fallback. + */ + private String fallbackMachineAssessmentArmId; + + /** + * Creates an instance of AvsAssessedMachinePropertiesV2RecommendationsItem class. + */ + public AvsAssessedMachinePropertiesV2RecommendationsItem() { + } + + /** + * 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 Float 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 fallbackMachineAssessmentArmId property: Gets or sets the machine assessment ARM ID for VM fallback. + * + * @return the fallbackMachineAssessmentArmId value. + */ + public String fallbackMachineAssessmentArmId() { + return this.fallbackMachineAssessmentArmId; + } + + /** + * Set the fallbackMachineAssessmentArmId property: Gets or sets the machine assessment ARM ID for VM fallback. + * + * @param fallbackMachineAssessmentArmId the fallbackMachineAssessmentArmId value to set. + * @return the AvsAssessedMachinePropertiesV2RecommendationsItem object itself. + */ + public AvsAssessedMachinePropertiesV2RecommendationsItem + withFallbackMachineAssessmentArmId(String fallbackMachineAssessmentArmId) { + this.fallbackMachineAssessmentArmId = fallbackMachineAssessmentArmId; + return this; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fallbackMachineAssessmentArmId", this.fallbackMachineAssessmentArmId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvsAssessedMachinePropertiesV2RecommendationsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessedMachinePropertiesV2RecommendationsItem 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 AvsAssessedMachinePropertiesV2RecommendationsItem. + */ + public static AvsAssessedMachinePropertiesV2RecommendationsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessedMachinePropertiesV2RecommendationsItem deserializedAvsAssessedMachinePropertiesV2RecommendationsItem + = new AvsAssessedMachinePropertiesV2RecommendationsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configuration".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2RecommendationsItem.configuration + = Configuration.fromJson(reader); + } else if ("recommendedFor".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2RecommendationsItem.recommendedFor + = RecommendedFor.fromJson(reader); + } else if ("migrationPlatform".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2RecommendationsItem.migrationPlatform + = MigrationPlatform.fromString(reader.getString()); + } else if ("confidenceScore".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2RecommendationsItem.confidenceScore + = reader.getNullable(JsonReader::getFloat); + } else if ("migrationSuitability".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2RecommendationsItem.migrationSuitability + = MigrationSuitability.fromJson(reader); + } else if ("securitySuitability".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2RecommendationsItem.securitySuitability + = SecuritySuitability.fromJson(reader); + } else if ("totalCost".equals(fieldName)) { + List totalCost + = reader.readArray(reader1 -> CostDetailsCommon.fromJson(reader1)); + deserializedAvsAssessedMachinePropertiesV2RecommendationsItem.totalCost = totalCost; + } else if ("totalSavings".equals(fieldName)) { + List totalSavings + = reader.readArray(reader1 -> SavingsDetailsCommon.fromJson(reader1)); + deserializedAvsAssessedMachinePropertiesV2RecommendationsItem.totalSavings = totalSavings; + } else if ("migrationIssues".equals(fieldName)) { + List migrationIssues + = reader.readArray(reader1 -> MigrationIssues.fromJson(reader1)); + deserializedAvsAssessedMachinePropertiesV2RecommendationsItem.migrationIssues = migrationIssues; + } else if ("skus".equals(fieldName)) { + List skus = reader.readArray( + reader1 -> AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem.fromJson(reader1)); + deserializedAvsAssessedMachinePropertiesV2RecommendationsItem.skus = skus; + } else if ("fallbackMachineAssessmentArmId".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2RecommendationsItem.fallbackMachineAssessmentArmId + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessedMachinePropertiesV2RecommendationsItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem.java new file mode 100644 index 000000000000..95fe999b1268 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem + 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 AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem class. + */ + public AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem() { + } + + /** + * 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 AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem 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 + * AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem. + */ + public static AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem deserializedAvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem + = new AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem.kind + = SkuKind.fromString(reader.getString()); + } else if ("resourceUri".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem.resourceUri + = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem.displayName + = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem.id + = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem.type + = SkuType.fromString(reader.getString()); + } else if ("sources".equals(fieldName)) { + List sources = reader + .readArray(reader1 -> AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem + .fromJson(reader1)); + deserializedAvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem.sources = sources; + } else if ("details".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem.details + = SkuDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem.java new file mode 100644 index 000000000000..9d7ee546681b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem + implements JsonSerializable { + /* + * The sku name. + */ + private String name; + + /* + * The sku type. + */ + private MigrationSuitability migrationSuitability; + + /** + * Creates an instance of AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem class. + */ + public AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem() { + } + + /** + * 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 AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem 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 + * AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem. + */ + public static AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem + fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem deserializedAvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem + = new AvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem.name + = reader.getString(); + } else if ("migrationSuitability".equals(fieldName)) { + deserializedAvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem.migrationSuitability + = MigrationSuitability.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessedMachinePropertiesV2RecommendationsPropertiesItemsSourcesItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachineV2.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachineV2.java new file mode 100644 index 000000000000..12855b734167 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachineV2.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessedMachineV2Inner; + +/** + * An immutable client-side representation of AvsAssessedMachineV2. + */ +public interface AvsAssessedMachineV2 { + /** + * 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. + */ + AvsAssessedMachinePropertiesV2 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.migration.assessment.fluent.models.AvsAssessedMachineV2Inner object. + * + * @return the inner object. + */ + AvsAssessedMachineV2Inner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachineV2ListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachineV2ListResult.java new file mode 100644 index 000000000000..0ad7fcf6d608 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachineV2ListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AvsAssessedMachineV2Inner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AvsAssessedMachineV2 list operation. + */ +@Fluent +public final class AvsAssessedMachineV2ListResult implements JsonSerializable { + /* + * The AvsAssessedMachineV2 items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AvsAssessedMachineV2ListResult class. + */ + public AvsAssessedMachineV2ListResult() { + } + + /** + * Get the value property: The AvsAssessedMachineV2 items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AvsAssessedMachineV2 items on this page. + * + * @param value the value value to set. + * @return the AvsAssessedMachineV2ListResult object itself. + */ + public AvsAssessedMachineV2ListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AvsAssessedMachineV2ListResult object itself. + */ + public AvsAssessedMachineV2ListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 AvsAssessedMachineV2ListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AvsAssessedMachineV2ListResult.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 AvsAssessedMachineV2ListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessedMachineV2ListResult 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 AvsAssessedMachineV2ListResult. + */ + public static AvsAssessedMachineV2ListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessedMachineV2ListResult deserializedAvsAssessedMachineV2ListResult + = new AvsAssessedMachineV2ListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AvsAssessedMachineV2Inner.fromJson(reader1)); + deserializedAvsAssessedMachineV2ListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAvsAssessedMachineV2ListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessedMachineV2ListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinesOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinesOperations.java deleted file mode 100644 index bd3c851a9e5b..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinesOperations.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 AvsAssessedMachinesOperations. - */ -public interface AvsAssessedMachinesOperations { - /** - * List AvsAssessedMachine resources by AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessedMachine list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByAvsAssessment(String resourceGroupName, String projectName, - String groupName, String assessmentName); - - /** - * List AvsAssessedMachine resources by AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessedMachine list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByAvsAssessment(String resourceGroupName, String projectName, - String groupName, String assessmentName, String filter, Integer pageSize, String continuationToken, - Integer totalRecordCount, Context context); - - /** - * Get a AvsAssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment ARM name. - * @param avsAssessedMachineName AVS assessment 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 AvsAssessedMachine along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, String avsAssessedMachineName, Context context); - - /** - * Get a AvsAssessedMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment ARM name. - * @param avsAssessedMachineName AVS assessment 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 AvsAssessedMachine. - */ - AvsAssessedMachine get(String resourceGroupName, String projectName, String groupName, String assessmentName, - String avsAssessedMachineName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinesV2Operations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinesV2Operations.java new file mode 100644 index 000000000000..64b2c2fd090c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedMachinesV2Operations.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AvsAssessedMachinesV2Operations. + */ +public interface AvsAssessedMachinesV2Operations { + /** + * List AvsAssessedMachineV2 resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessedMachineV2 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List AvsAssessedMachineV2 resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessedMachineV2 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); + + /** + * Get a AvsAssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param avsAssessedMachineName AVS assessment Assessed Machine 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 AvsAssessedMachineV2 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + String avsAssessedMachineName, Context context); + + /** + * Get a AvsAssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param avsAssessedMachineName AVS assessment Assessed Machine 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 AvsAssessedMachineV2. + */ + AvsAssessedMachineV2 get(String resourceGroupName, String projectName, String assessmentName, + String avsAssessedMachineName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedNetworkAdapter.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedNetworkAdapter.java index 943ba7143a6d..be579073eda4 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedNetworkAdapter.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessedNetworkAdapter.java @@ -33,11 +33,16 @@ public final class AvsAssessedNetworkAdapter implements JsonSerializable { - /* - * The AvsAssessment items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of AvsAssessmentListResult class. - */ - public AvsAssessmentListResult() { - } - - /** - * Get the value property: The AvsAssessment items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The AvsAssessment items on this page. - * - * @param value the value value to set. - * @return the AvsAssessmentListResult object itself. - */ - public AvsAssessmentListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the AvsAssessmentListResult object itself. - */ - public AvsAssessmentListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * 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 AvsAssessmentListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AvsAssessmentListResult.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 AvsAssessmentListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AvsAssessmentListResult 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 AvsAssessmentListResult. - */ - public static AvsAssessmentListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AvsAssessmentListResult deserializedAvsAssessmentListResult = new AvsAssessmentListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> AvsAssessmentInner.fromJson(reader1)); - deserializedAvsAssessmentListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAvsAssessmentListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAvsAssessmentListResult; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentOptions.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentOptions.java deleted file mode 100644 index fb95db57bb8e..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentOptions.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentOptionsInner; - -/** - * An immutable client-side representation of AvsAssessmentOptions. - */ -public interface AvsAssessmentOptions { - /** - * 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. - */ - AvsAssessmentOptionsProperties 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.migration.assessment.fluent.models.AvsAssessmentOptionsInner object. - * - * @return the inner object. - */ - AvsAssessmentOptionsInner innerModel(); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentOptionsListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentOptionsListResult.java deleted file mode 100644 index 507d5b352d57..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentOptionsListResult.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -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.migration.assessment.fluent.models.AvsAssessmentOptionsInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a AvsAssessmentOptions list operation. - */ -@Fluent -public final class AvsAssessmentOptionsListResult implements JsonSerializable { - /* - * The AvsAssessmentOptions items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of AvsAssessmentOptionsListResult class. - */ - public AvsAssessmentOptionsListResult() { - } - - /** - * Get the value property: The AvsAssessmentOptions items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The AvsAssessmentOptions items on this page. - * - * @param value the value value to set. - * @return the AvsAssessmentOptionsListResult object itself. - */ - public AvsAssessmentOptionsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the AvsAssessmentOptionsListResult object itself. - */ - public AvsAssessmentOptionsListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * 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 AvsAssessmentOptionsListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AvsAssessmentOptionsListResult.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 AvsAssessmentOptionsListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AvsAssessmentOptionsListResult 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 AvsAssessmentOptionsListResult. - */ - public static AvsAssessmentOptionsListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AvsAssessmentOptionsListResult deserializedAvsAssessmentOptionsListResult - = new AvsAssessmentOptionsListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AvsAssessmentOptionsInner.fromJson(reader1)); - deserializedAvsAssessmentOptionsListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAvsAssessmentOptionsListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAvsAssessmentOptionsListResult; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentOptionsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentOptionsOperations.java deleted file mode 100644 index 4b32288da733..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentOptionsOperations.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 AvsAssessmentOptionsOperations. - */ -public interface AvsAssessmentOptionsOperations { - /** - * List AvsAssessmentOptions 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 AvsAssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); - - /** - * List AvsAssessmentOptions 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 AvsAssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); - - /** - * Get a AvsAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param avsAssessmentOptionsName AVS Assessment options ARM name. Accepted value is 'default'. - * @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 AvsAssessmentOptions along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String projectName, - String avsAssessmentOptionsName, Context context); - - /** - * Get a AvsAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param avsAssessmentOptionsName AVS Assessment options ARM name. Accepted value is 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 AvsAssessmentOptions. - */ - AvsAssessmentOptions get(String resourceGroupName, String projectName, String avsAssessmentOptionsName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentOptionsOutboundEdgeGroup.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentOptionsOutboundEdgeGroup.java new file mode 100644 index 000000000000..6c08e55dfb88 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentOptionsOutboundEdgeGroup.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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. + */ +@Fluent +public final class AvsAssessmentOptionsOutboundEdgeGroup + 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 Avs External Storage Type. + */ + private List avsExternalStorageTypes; + + /* + * Gets or sets the Azure Avs Node Type. + */ + private List avsNodes; + + /* + * Gets or sets the Azure SQL service tiers. + */ + private List failuresToTolerateAndRaidLevelValues; + + /** + * Creates an instance of AvsAssessmentOptionsOutboundEdgeGroup class. + */ + public AvsAssessmentOptionsOutboundEdgeGroup() { + } + + /** + * Get the targetLocations property: Gets or sets the Azure Locations. + * + * @return the targetLocations value. + */ + public List targetLocations() { + return this.targetLocations; + } + + /** + * Set the targetLocations property: Gets or sets the Azure Locations. + * + * @param targetLocations the targetLocations value to set. + * @return the AvsAssessmentOptionsOutboundEdgeGroup object itself. + */ + public AvsAssessmentOptionsOutboundEdgeGroup withTargetLocations(List targetLocations) { + this.targetLocations = targetLocations; + return this; + } + + /** + * Get the currencies property: Gets or sets the Azure Currency. + * + * @return the currencies value. + */ + public List currencies() { + return this.currencies; + } + + /** + * Set the currencies property: Gets or sets the Azure Currency. + * + * @param currencies the currencies value to set. + * @return the AvsAssessmentOptionsOutboundEdgeGroup object itself. + */ + public AvsAssessmentOptionsOutboundEdgeGroup withCurrencies(List currencies) { + this.currencies = currencies; + return this; + } + + /** + * Get the savingsOptions property: Gets or sets the Assessment Savings Options. + * + * @return the savingsOptions value. + */ + public List savingsOptions() { + return this.savingsOptions; + } + + /** + * Set the savingsOptions property: Gets or sets the Assessment Savings Options. + * + * @param savingsOptions the savingsOptions value to set. + * @return the AvsAssessmentOptionsOutboundEdgeGroup object itself. + */ + public AvsAssessmentOptionsOutboundEdgeGroup withSavingsOptions(List savingsOptions) { + this.savingsOptions = savingsOptions; + return this; + } + + /** + * Get the licensingProgram property: Gets or sets the Licensing Program. + * + * @return the licensingProgram value. + */ + public List licensingProgram() { + return this.licensingProgram; + } + + /** + * Set the licensingProgram property: Gets or sets the Licensing Program. + * + * @param licensingProgram the licensingProgram value to set. + * @return the AvsAssessmentOptionsOutboundEdgeGroup object itself. + */ + public AvsAssessmentOptionsOutboundEdgeGroup withLicensingProgram(List licensingProgram) { + this.licensingProgram = licensingProgram; + return this; + } + + /** + * Get the avsExternalStorageTypes property: Gets or sets the Avs External Storage Type. + * + * @return the avsExternalStorageTypes value. + */ + public List avsExternalStorageTypes() { + return this.avsExternalStorageTypes; + } + + /** + * Set the avsExternalStorageTypes property: Gets or sets the Avs External Storage Type. + * + * @param avsExternalStorageTypes the avsExternalStorageTypes value to set. + * @return the AvsAssessmentOptionsOutboundEdgeGroup object itself. + */ + public AvsAssessmentOptionsOutboundEdgeGroup + withAvsExternalStorageTypes(List avsExternalStorageTypes) { + this.avsExternalStorageTypes = avsExternalStorageTypes; + return this; + } + + /** + * Get the avsNodes property: Gets or sets the Azure Avs Node Type. + * + * @return the avsNodes value. + */ + public List avsNodes() { + return this.avsNodes; + } + + /** + * Set the avsNodes property: Gets or sets the Azure Avs Node Type. + * + * @param avsNodes the avsNodes value to set. + * @return the AvsAssessmentOptionsOutboundEdgeGroup object itself. + */ + public AvsAssessmentOptionsOutboundEdgeGroup withAvsNodes(List avsNodes) { + this.avsNodes = avsNodes; + return this; + } + + /** + * Get the failuresToTolerateAndRaidLevelValues property: Gets or sets the Azure SQL service tiers. + * + * @return the failuresToTolerateAndRaidLevelValues value. + */ + public List failuresToTolerateAndRaidLevelValues() { + return this.failuresToTolerateAndRaidLevelValues; + } + + /** + * Set the failuresToTolerateAndRaidLevelValues property: Gets or sets the Azure SQL service tiers. + * + * @param failuresToTolerateAndRaidLevelValues the failuresToTolerateAndRaidLevelValues value to set. + * @return the AvsAssessmentOptionsOutboundEdgeGroup object itself. + */ + public AvsAssessmentOptionsOutboundEdgeGroup + withFailuresToTolerateAndRaidLevelValues(List failuresToTolerateAndRaidLevelValues) { + this.failuresToTolerateAndRaidLevelValues = failuresToTolerateAndRaidLevelValues; + return this; + } + + /** + * 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 AvsAssessmentOptionsOutboundEdgeGroup")); + } + if (currencies() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property currencies in model AvsAssessmentOptionsOutboundEdgeGroup")); + } + if (savingsOptions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property savingsOptions in model AvsAssessmentOptionsOutboundEdgeGroup")); + } + if (licensingProgram() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property licensingProgram in model AvsAssessmentOptionsOutboundEdgeGroup")); + } + if (avsExternalStorageTypes() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property avsExternalStorageTypes in model AvsAssessmentOptionsOutboundEdgeGroup")); + } + if (avsNodes() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property avsNodes in model AvsAssessmentOptionsOutboundEdgeGroup")); + } + if (failuresToTolerateAndRaidLevelValues() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property failuresToTolerateAndRaidLevelValues in model AvsAssessmentOptionsOutboundEdgeGroup")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AvsAssessmentOptionsOutboundEdgeGroup.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("avsExternalStorageTypes", this.avsExternalStorageTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("avsNodes", this.avsNodes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("failuresToTolerateAndRaidLevelValues", this.failuresToTolerateAndRaidLevelValues, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvsAssessmentOptionsOutboundEdgeGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessmentOptionsOutboundEdgeGroup 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 AvsAssessmentOptionsOutboundEdgeGroup. + */ + public static AvsAssessmentOptionsOutboundEdgeGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessmentOptionsOutboundEdgeGroup deserializedAvsAssessmentOptionsOutboundEdgeGroup + = new AvsAssessmentOptionsOutboundEdgeGroup(); + 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())); + deserializedAvsAssessmentOptionsOutboundEdgeGroup.targetLocations = targetLocations; + } else if ("currencies".equals(fieldName)) { + List currencies + = reader.readArray(reader1 -> AzureCurrency.fromString(reader1.getString())); + deserializedAvsAssessmentOptionsOutboundEdgeGroup.currencies = currencies; + } else if ("savingsOptions".equals(fieldName)) { + List savingsOptions + = reader.readArray(reader1 -> SavingsOptions.fromString(reader1.getString())); + deserializedAvsAssessmentOptionsOutboundEdgeGroup.savingsOptions = savingsOptions; + } else if ("licensingProgram".equals(fieldName)) { + List licensingProgram + = reader.readArray(reader1 -> LicensingProgram.fromString(reader1.getString())); + deserializedAvsAssessmentOptionsOutboundEdgeGroup.licensingProgram = licensingProgram; + } else if ("avsExternalStorageTypes".equals(fieldName)) { + List avsExternalStorageTypes + = reader.readArray(reader1 -> ExternalStorageType.fromString(reader1.getString())); + deserializedAvsAssessmentOptionsOutboundEdgeGroup.avsExternalStorageTypes = avsExternalStorageTypes; + } else if ("avsNodes".equals(fieldName)) { + List avsNodes + = reader.readArray(reader1 -> AzureAvsNodeType.fromString(reader1.getString())); + deserializedAvsAssessmentOptionsOutboundEdgeGroup.avsNodes = avsNodes; + } else if ("failuresToTolerateAndRaidLevelValues".equals(fieldName)) { + List failuresToTolerateAndRaidLevelValues + = reader.readArray(reader1 -> FttAndRaidLevel.fromString(reader1.getString())); + deserializedAvsAssessmentOptionsOutboundEdgeGroup.failuresToTolerateAndRaidLevelValues + = failuresToTolerateAndRaidLevelValues; + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessmentOptionsOutboundEdgeGroup; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentOptionsProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentOptionsProperties.java deleted file mode 100644 index 86f8015a0bdd..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentOptionsProperties.java +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * AVS Assessment options properties. - */ -@Fluent -public final class AvsAssessmentOptionsProperties implements JsonSerializable { - /* - * AVS SKU Nodes. - */ - private List avsNodes; - - /* - * FTT and Raid level values. - */ - private List failuresToTolerateAndRaidLevelValues; - - /* - * List of AVS nodes for RI. - */ - private List reservedInstanceAvsNodes; - - /* - * List of supported Azure regions for reserved instances. - */ - private List reservedInstanceSupportedLocations; - - /* - * List of supported currencies for reserved instances. - */ - private List reservedInstanceSupportedCurrencies; - - /* - * List of supported Azure offer codes for reserved instances. - */ - private List reservedInstanceSupportedOffers; - - /** - * Creates an instance of AvsAssessmentOptionsProperties class. - */ - public AvsAssessmentOptionsProperties() { - } - - /** - * Get the avsNodes property: AVS SKU Nodes. - * - * @return the avsNodes value. - */ - public List avsNodes() { - return this.avsNodes; - } - - /** - * Set the avsNodes property: AVS SKU Nodes. - * - * @param avsNodes the avsNodes value to set. - * @return the AvsAssessmentOptionsProperties object itself. - */ - public AvsAssessmentOptionsProperties withAvsNodes(List avsNodes) { - this.avsNodes = avsNodes; - return this; - } - - /** - * Get the failuresToTolerateAndRaidLevelValues property: FTT and Raid level values. - * - * @return the failuresToTolerateAndRaidLevelValues value. - */ - public List failuresToTolerateAndRaidLevelValues() { - return this.failuresToTolerateAndRaidLevelValues; - } - - /** - * Set the failuresToTolerateAndRaidLevelValues property: FTT and Raid level values. - * - * @param failuresToTolerateAndRaidLevelValues the failuresToTolerateAndRaidLevelValues value to set. - * @return the AvsAssessmentOptionsProperties object itself. - */ - public AvsAssessmentOptionsProperties - withFailuresToTolerateAndRaidLevelValues(List failuresToTolerateAndRaidLevelValues) { - this.failuresToTolerateAndRaidLevelValues = failuresToTolerateAndRaidLevelValues; - return this; - } - - /** - * Get the reservedInstanceAvsNodes property: List of AVS nodes for RI. - * - * @return the reservedInstanceAvsNodes value. - */ - public List reservedInstanceAvsNodes() { - return this.reservedInstanceAvsNodes; - } - - /** - * Set the reservedInstanceAvsNodes property: List of AVS nodes for RI. - * - * @param reservedInstanceAvsNodes the reservedInstanceAvsNodes value to set. - * @return the AvsAssessmentOptionsProperties object itself. - */ - public AvsAssessmentOptionsProperties - withReservedInstanceAvsNodes(List reservedInstanceAvsNodes) { - this.reservedInstanceAvsNodes = reservedInstanceAvsNodes; - return this; - } - - /** - * Get the reservedInstanceSupportedLocations property: List of supported Azure regions for reserved instances. - * - * @return the reservedInstanceSupportedLocations value. - */ - public List reservedInstanceSupportedLocations() { - return this.reservedInstanceSupportedLocations; - } - - /** - * Set the reservedInstanceSupportedLocations property: List of supported Azure regions for reserved instances. - * - * @param reservedInstanceSupportedLocations the reservedInstanceSupportedLocations value to set. - * @return the AvsAssessmentOptionsProperties object itself. - */ - public AvsAssessmentOptionsProperties - withReservedInstanceSupportedLocations(List reservedInstanceSupportedLocations) { - this.reservedInstanceSupportedLocations = reservedInstanceSupportedLocations; - return this; - } - - /** - * Get the reservedInstanceSupportedCurrencies property: List of supported currencies for reserved instances. - * - * @return the reservedInstanceSupportedCurrencies value. - */ - public List reservedInstanceSupportedCurrencies() { - return this.reservedInstanceSupportedCurrencies; - } - - /** - * Set the reservedInstanceSupportedCurrencies property: List of supported currencies for reserved instances. - * - * @param reservedInstanceSupportedCurrencies the reservedInstanceSupportedCurrencies value to set. - * @return the AvsAssessmentOptionsProperties object itself. - */ - public AvsAssessmentOptionsProperties - withReservedInstanceSupportedCurrencies(List reservedInstanceSupportedCurrencies) { - this.reservedInstanceSupportedCurrencies = reservedInstanceSupportedCurrencies; - return this; - } - - /** - * Get the reservedInstanceSupportedOffers property: List of supported Azure offer codes for reserved instances. - * - * @return the reservedInstanceSupportedOffers value. - */ - public List reservedInstanceSupportedOffers() { - return this.reservedInstanceSupportedOffers; - } - - /** - * Set the reservedInstanceSupportedOffers property: List of supported Azure offer codes for reserved instances. - * - * @param reservedInstanceSupportedOffers the reservedInstanceSupportedOffers value to set. - * @return the AvsAssessmentOptionsProperties object itself. - */ - public AvsAssessmentOptionsProperties - withReservedInstanceSupportedOffers(List reservedInstanceSupportedOffers) { - this.reservedInstanceSupportedOffers = reservedInstanceSupportedOffers; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (avsNodes() != null) { - avsNodes().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("avsNodes", this.avsNodes, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("failuresToTolerateAndRaidLevelValues", this.failuresToTolerateAndRaidLevelValues, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("reservedInstanceAvsNodes", this.reservedInstanceAvsNodes, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("reservedInstanceSupportedLocations", this.reservedInstanceSupportedLocations, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("reservedInstanceSupportedCurrencies", this.reservedInstanceSupportedCurrencies, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("reservedInstanceSupportedOffers", this.reservedInstanceSupportedOffers, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AvsAssessmentOptionsProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AvsAssessmentOptionsProperties 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 AvsAssessmentOptionsProperties. - */ - public static AvsAssessmentOptionsProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AvsAssessmentOptionsProperties deserializedAvsAssessmentOptionsProperties - = new AvsAssessmentOptionsProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("avsNodes".equals(fieldName)) { - List avsNodes = reader.readArray(reader1 -> AvsSkuOptions.fromJson(reader1)); - deserializedAvsAssessmentOptionsProperties.avsNodes = avsNodes; - } else if ("failuresToTolerateAndRaidLevelValues".equals(fieldName)) { - List failuresToTolerateAndRaidLevelValues - = reader.readArray(reader1 -> FttAndRaidLevel.fromString(reader1.getString())); - deserializedAvsAssessmentOptionsProperties.failuresToTolerateAndRaidLevelValues - = failuresToTolerateAndRaidLevelValues; - } else if ("reservedInstanceAvsNodes".equals(fieldName)) { - List reservedInstanceAvsNodes - = reader.readArray(reader1 -> AzureAvsNodeType.fromString(reader1.getString())); - deserializedAvsAssessmentOptionsProperties.reservedInstanceAvsNodes = reservedInstanceAvsNodes; - } else if ("reservedInstanceSupportedLocations".equals(fieldName)) { - List reservedInstanceSupportedLocations - = reader.readArray(reader1 -> AzureLocation.fromString(reader1.getString())); - deserializedAvsAssessmentOptionsProperties.reservedInstanceSupportedLocations - = reservedInstanceSupportedLocations; - } else if ("reservedInstanceSupportedCurrencies".equals(fieldName)) { - List reservedInstanceSupportedCurrencies - = reader.readArray(reader1 -> AzureCurrency.fromString(reader1.getString())); - deserializedAvsAssessmentOptionsProperties.reservedInstanceSupportedCurrencies - = reservedInstanceSupportedCurrencies; - } else if ("reservedInstanceSupportedOffers".equals(fieldName)) { - List reservedInstanceSupportedOffers - = reader.readArray(reader1 -> AzureOfferCode.fromString(reader1.getString())); - deserializedAvsAssessmentOptionsProperties.reservedInstanceSupportedOffers - = reservedInstanceSupportedOffers; - } else { - reader.skipChildren(); - } - } - - return deserializedAvsAssessmentOptionsProperties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentProperties.java deleted file mode 100644 index bf7d377e37e2..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentProperties.java +++ /dev/null @@ -1,963 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.Map; - -/** - * Properties of the AVS assessment. - */ -@Fluent -public final class AvsAssessmentProperties extends AzureResourceProperties { - /* - * Gets the assessment error summary. - * This is the number of machines - * affected by each type of error in this assessment. - */ - private Map assessmentErrorSummary; - - /* - * Failures to tolerate and RAID level in a common property. - */ - private FttAndRaidLevel failuresToTolerateAndRaidLevel; - - /* - * VCPU over subscription. - */ - private Float vcpuOversubscription; - - /* - * AVS node type. - */ - private AzureAvsNodeType nodeType; - - /* - * Reserved instance. - */ - private AzureReservedInstance reservedInstance; - - /* - * Total monthly cost. - */ - private Float totalMonthlyCost; - - /* - * Gets or sets the Assessment cloud suitability. - */ - private CloudSuitability suitability; - - /* - * Gets or sets the Assessment suitability explanation. - */ - private AzureAvsSuitabilityExplanation suitabilityExplanation; - - /* - * Recommended number of nodes. - */ - private Integer numberOfNodes; - - /* - * Predicted CPU utilization. - */ - private Float cpuUtilization; - - /* - * Predicted RAM utilization. - */ - private Float ramUtilization; - - /* - * Predicted storage utilization. - */ - private Float storageUtilization; - - /* - * Predicted total CPU cores used. - */ - private Float totalCpuCores; - - /* - * Predicted total RAM used in GB. - */ - private Float totalRamInGB; - - /* - * Predicted total Storage used in GB. - */ - private Float totalStorageInGB; - - /* - * Number of machines part of the assessment. - */ - private Integer numberOfMachines; - - /* - * Cloud suitability summary for all the machines in the assessment. - */ - private Map suitabilitySummary; - - /* - * Memory overcommit. - */ - private Float memOvercommit; - - /* - * De-duplication compression. - */ - private Float dedupeCompression; - - /* - * Limiting factor. - */ - private String limitingFactor; - - /* - * Is Stretch Cluster Enabled. - */ - private Boolean isStretchClusterEnabled; - - /* - * Gets the group type for the assessment. - */ - private GroupType groupType; - - /* - * Assessment type of the assessment. - */ - private AssessmentType assessmentType; - - /* - * Azure Location or Azure region where to which the machines will be migrated. - */ - private AzureLocation azureLocation; - - /* - * Azure Offer code according to which cost estimation is done. - */ - private AzureOfferCode azureOfferCode; - - /* - * Currency in which prices should be reported. - */ - private AzureCurrency currency; - - /* - * Percentage of buffer that user wants on performance metrics when recommending - * Azure sizes. - */ - private Float scalingFactor; - - /* - * 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; - - /* - * User configurable setting to display the Stage of Assessment. - */ - private AssessmentStage stage; - - /* - * Custom discount percentage. - */ - private Float discountPercentage; - - /* - * Assessment sizing criterion. - */ - private AssessmentSizingCriterion sizingCriterion; - - /* - * Confidence Rating in Percentage. - */ - private Float confidenceRatingInPercentage; - - /* - * Time when the Azure Prices were queried. Date-Time represented in ISO-8601 - * format. - */ - 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; - - /* - * Schema version. - */ - private String schemaVersion; - - /** - * Creates an instance of AvsAssessmentProperties class. - */ - public AvsAssessmentProperties() { - } - - /** - * Get the assessmentErrorSummary property: Gets the assessment error summary. - * This is the number of machines - * affected by each type of error in this assessment. - * - * @return the assessmentErrorSummary value. - */ - public Map assessmentErrorSummary() { - return this.assessmentErrorSummary; - } - - /** - * Get the failuresToTolerateAndRaidLevel property: Failures to tolerate and RAID level in a common property. - * - * @return the failuresToTolerateAndRaidLevel value. - */ - public FttAndRaidLevel failuresToTolerateAndRaidLevel() { - return this.failuresToTolerateAndRaidLevel; - } - - /** - * Set the failuresToTolerateAndRaidLevel property: Failures to tolerate and RAID level in a common property. - * - * @param failuresToTolerateAndRaidLevel the failuresToTolerateAndRaidLevel value to set. - * @return the AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties withFailuresToTolerateAndRaidLevel(FttAndRaidLevel failuresToTolerateAndRaidLevel) { - this.failuresToTolerateAndRaidLevel = failuresToTolerateAndRaidLevel; - return this; - } - - /** - * Get the vcpuOversubscription property: VCPU over subscription. - * - * @return the vcpuOversubscription value. - */ - public Float vcpuOversubscription() { - return this.vcpuOversubscription; - } - - /** - * Set the vcpuOversubscription property: VCPU over subscription. - * - * @param vcpuOversubscription the vcpuOversubscription value to set. - * @return the AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties withVcpuOversubscription(Float vcpuOversubscription) { - this.vcpuOversubscription = vcpuOversubscription; - return this; - } - - /** - * Get the nodeType property: AVS node type. - * - * @return the nodeType value. - */ - public AzureAvsNodeType nodeType() { - return this.nodeType; - } - - /** - * Set the nodeType property: AVS node type. - * - * @param nodeType the nodeType value to set. - * @return the AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties withNodeType(AzureAvsNodeType nodeType) { - this.nodeType = nodeType; - return this; - } - - /** - * Get the reservedInstance property: Reserved instance. - * - * @return the reservedInstance value. - */ - public AzureReservedInstance reservedInstance() { - return this.reservedInstance; - } - - /** - * Set the reservedInstance property: Reserved instance. - * - * @param reservedInstance the reservedInstance value to set. - * @return the AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties withReservedInstance(AzureReservedInstance reservedInstance) { - this.reservedInstance = reservedInstance; - return this; - } - - /** - * Get the totalMonthlyCost property: Total monthly cost. - * - * @return the totalMonthlyCost value. - */ - public Float totalMonthlyCost() { - return this.totalMonthlyCost; - } - - /** - * Get the suitability property: Gets or sets the Assessment cloud suitability. - * - * @return the suitability value. - */ - public CloudSuitability suitability() { - return this.suitability; - } - - /** - * Get the suitabilityExplanation property: Gets or sets the Assessment suitability explanation. - * - * @return the suitabilityExplanation value. - */ - public AzureAvsSuitabilityExplanation suitabilityExplanation() { - return this.suitabilityExplanation; - } - - /** - * Get the numberOfNodes property: Recommended number of nodes. - * - * @return the numberOfNodes value. - */ - public Integer numberOfNodes() { - return this.numberOfNodes; - } - - /** - * Get the cpuUtilization property: Predicted CPU utilization. - * - * @return the cpuUtilization value. - */ - public Float cpuUtilization() { - return this.cpuUtilization; - } - - /** - * Get the ramUtilization property: Predicted RAM utilization. - * - * @return the ramUtilization value. - */ - public Float ramUtilization() { - return this.ramUtilization; - } - - /** - * Get the storageUtilization property: Predicted storage utilization. - * - * @return the storageUtilization value. - */ - public Float storageUtilization() { - return this.storageUtilization; - } - - /** - * Get the totalCpuCores property: Predicted total CPU cores used. - * - * @return the totalCpuCores value. - */ - public Float totalCpuCores() { - return this.totalCpuCores; - } - - /** - * Get the totalRamInGB property: Predicted total RAM used in GB. - * - * @return the totalRamInGB value. - */ - public Float totalRamInGB() { - return this.totalRamInGB; - } - - /** - * Get the totalStorageInGB property: Predicted total Storage used in GB. - * - * @return the totalStorageInGB value. - */ - public Float totalStorageInGB() { - return this.totalStorageInGB; - } - - /** - * Get the numberOfMachines property: Number of machines part of the assessment. - * - * @return the numberOfMachines value. - */ - public Integer numberOfMachines() { - return this.numberOfMachines; - } - - /** - * Get the suitabilitySummary property: Cloud suitability summary for all the machines in the assessment. - * - * @return the suitabilitySummary value. - */ - public Map suitabilitySummary() { - return this.suitabilitySummary; - } - - /** - * Get the memOvercommit property: Memory overcommit. - * - * @return the memOvercommit value. - */ - public Float memOvercommit() { - return this.memOvercommit; - } - - /** - * Set the memOvercommit property: Memory overcommit. - * - * @param memOvercommit the memOvercommit value to set. - * @return the AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties withMemOvercommit(Float memOvercommit) { - this.memOvercommit = memOvercommit; - return this; - } - - /** - * Get the dedupeCompression property: De-duplication compression. - * - * @return the dedupeCompression value. - */ - public Float dedupeCompression() { - return this.dedupeCompression; - } - - /** - * Set the dedupeCompression property: De-duplication compression. - * - * @param dedupeCompression the dedupeCompression value to set. - * @return the AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties withDedupeCompression(Float dedupeCompression) { - this.dedupeCompression = dedupeCompression; - return this; - } - - /** - * Get the limitingFactor property: Limiting factor. - * - * @return the limitingFactor value. - */ - public String limitingFactor() { - return this.limitingFactor; - } - - /** - * Get the isStretchClusterEnabled property: Is Stretch Cluster Enabled. - * - * @return the isStretchClusterEnabled value. - */ - public Boolean isStretchClusterEnabled() { - return this.isStretchClusterEnabled; - } - - /** - * Set the isStretchClusterEnabled property: Is Stretch Cluster Enabled. - * - * @param isStretchClusterEnabled the isStretchClusterEnabled value to set. - * @return the AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties withIsStretchClusterEnabled(Boolean isStretchClusterEnabled) { - this.isStretchClusterEnabled = isStretchClusterEnabled; - return this; - } - - /** - * Get the groupType property: Gets the group type for the assessment. - * - * @return the groupType value. - */ - public GroupType groupType() { - return this.groupType; - } - - /** - * Get the assessmentType property: Assessment type of the assessment. - * - * @return the assessmentType value. - */ - public AssessmentType assessmentType() { - return this.assessmentType; - } - - /** - * Get the azureLocation property: Azure Location or Azure region where to which the machines will be migrated. - * - * @return the azureLocation value. - */ - public AzureLocation 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 AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties withAzureLocation(AzureLocation azureLocation) { - this.azureLocation = azureLocation; - return this; - } - - /** - * Get the azureOfferCode property: Azure Offer code according to which cost estimation is done. - * - * @return the azureOfferCode value. - */ - public AzureOfferCode azureOfferCode() { - return this.azureOfferCode; - } - - /** - * Set the azureOfferCode property: Azure Offer code according to which cost estimation is done. - * - * @param azureOfferCode the azureOfferCode value to set. - * @return the AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties withAzureOfferCode(AzureOfferCode azureOfferCode) { - this.azureOfferCode = azureOfferCode; - 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 AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties 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 Float 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 AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties withScalingFactor(Float scalingFactor) { - this.scalingFactor = scalingFactor; - return this; - } - - /** - * 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 AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties 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 AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties 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 AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties 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 AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties withPerfDataEndTime(OffsetDateTime perfDataEndTime) { - this.perfDataEndTime = perfDataEndTime; - return this; - } - - /** - * Get the stage property: User configurable setting to display the Stage of Assessment. - * - * @return the stage value. - */ - public AssessmentStage stage() { - return this.stage; - } - - /** - * Get the discountPercentage property: Custom discount percentage. - * - * @return the discountPercentage value. - */ - public Float discountPercentage() { - return this.discountPercentage; - } - - /** - * Set the discountPercentage property: Custom discount percentage. - * - * @param discountPercentage the discountPercentage value to set. - * @return the AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties withDiscountPercentage(Float 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 AvsAssessmentProperties object itself. - */ - public AvsAssessmentProperties withSizingCriterion(AssessmentSizingCriterion sizingCriterion) { - this.sizingCriterion = sizingCriterion; - return this; - } - - /** - * Get the confidenceRatingInPercentage property: Confidence Rating in Percentage. - * - * @return the confidenceRatingInPercentage value. - */ - public Float confidenceRatingInPercentage() { - return this.confidenceRatingInPercentage; - } - - /** - * Get the pricesTimestamp property: Time when the Azure Prices were queried. Date-Time represented in ISO-8601 - * format. - * - * @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; - } - - /** - * Get the schemaVersion property: Schema version. - * - * @return the schemaVersion value. - */ - public String schemaVersion() { - return this.schemaVersion; - } - - /** - * {@inheritDoc} - */ - @Override - public AvsAssessmentProperties withProvisioningState(ProvisioningState provisioningState) { - super.withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provisioningState", - provisioningState() == null ? null : provisioningState().toString()); - jsonWriter.writeStringField("failuresToTolerateAndRaidLevel", - this.failuresToTolerateAndRaidLevel == null ? null : this.failuresToTolerateAndRaidLevel.toString()); - jsonWriter.writeNumberField("vcpuOversubscription", this.vcpuOversubscription); - jsonWriter.writeStringField("nodeType", this.nodeType == null ? null : this.nodeType.toString()); - jsonWriter.writeStringField("reservedInstance", - this.reservedInstance == null ? null : this.reservedInstance.toString()); - jsonWriter.writeNumberField("memOvercommit", this.memOvercommit); - jsonWriter.writeNumberField("dedupeCompression", this.dedupeCompression); - jsonWriter.writeBooleanField("isStretchClusterEnabled", this.isStretchClusterEnabled); - jsonWriter.writeStringField("azureLocation", this.azureLocation == null ? null : this.azureLocation.toString()); - jsonWriter.writeStringField("azureOfferCode", - this.azureOfferCode == null ? null : this.azureOfferCode.toString()); - jsonWriter.writeStringField("currency", this.currency == null ? null : this.currency.toString()); - jsonWriter.writeNumberField("scalingFactor", this.scalingFactor); - 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)); - jsonWriter.writeNumberField("discountPercentage", this.discountPercentage); - jsonWriter.writeStringField("sizingCriterion", - this.sizingCriterion == null ? null : this.sizingCriterion.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AvsAssessmentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AvsAssessmentProperties 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 AvsAssessmentProperties. - */ - public static AvsAssessmentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AvsAssessmentProperties deserializedAvsAssessmentProperties = new AvsAssessmentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedAvsAssessmentProperties - .withProvisioningState(ProvisioningState.fromString(reader.getString())); - } else if ("assessmentErrorSummary".equals(fieldName)) { - Map assessmentErrorSummary = reader.readMap(reader1 -> reader1.getInt()); - deserializedAvsAssessmentProperties.assessmentErrorSummary = assessmentErrorSummary; - } else if ("failuresToTolerateAndRaidLevel".equals(fieldName)) { - deserializedAvsAssessmentProperties.failuresToTolerateAndRaidLevel - = FttAndRaidLevel.fromString(reader.getString()); - } else if ("vcpuOversubscription".equals(fieldName)) { - deserializedAvsAssessmentProperties.vcpuOversubscription = reader.getNullable(JsonReader::getFloat); - } else if ("nodeType".equals(fieldName)) { - deserializedAvsAssessmentProperties.nodeType = AzureAvsNodeType.fromString(reader.getString()); - } else if ("reservedInstance".equals(fieldName)) { - deserializedAvsAssessmentProperties.reservedInstance - = AzureReservedInstance.fromString(reader.getString()); - } else if ("totalMonthlyCost".equals(fieldName)) { - deserializedAvsAssessmentProperties.totalMonthlyCost = reader.getNullable(JsonReader::getFloat); - } else if ("suitability".equals(fieldName)) { - deserializedAvsAssessmentProperties.suitability = CloudSuitability.fromString(reader.getString()); - } else if ("suitabilityExplanation".equals(fieldName)) { - deserializedAvsAssessmentProperties.suitabilityExplanation - = AzureAvsSuitabilityExplanation.fromString(reader.getString()); - } else if ("numberOfNodes".equals(fieldName)) { - deserializedAvsAssessmentProperties.numberOfNodes = reader.getNullable(JsonReader::getInt); - } else if ("cpuUtilization".equals(fieldName)) { - deserializedAvsAssessmentProperties.cpuUtilization = reader.getNullable(JsonReader::getFloat); - } else if ("ramUtilization".equals(fieldName)) { - deserializedAvsAssessmentProperties.ramUtilization = reader.getNullable(JsonReader::getFloat); - } else if ("storageUtilization".equals(fieldName)) { - deserializedAvsAssessmentProperties.storageUtilization = reader.getNullable(JsonReader::getFloat); - } else if ("totalCpuCores".equals(fieldName)) { - deserializedAvsAssessmentProperties.totalCpuCores = reader.getNullable(JsonReader::getFloat); - } else if ("totalRamInGB".equals(fieldName)) { - deserializedAvsAssessmentProperties.totalRamInGB = reader.getNullable(JsonReader::getFloat); - } else if ("totalStorageInGB".equals(fieldName)) { - deserializedAvsAssessmentProperties.totalStorageInGB = reader.getNullable(JsonReader::getFloat); - } else if ("numberOfMachines".equals(fieldName)) { - deserializedAvsAssessmentProperties.numberOfMachines = reader.getNullable(JsonReader::getInt); - } else if ("suitabilitySummary".equals(fieldName)) { - Map suitabilitySummary = reader.readMap(reader1 -> reader1.getInt()); - deserializedAvsAssessmentProperties.suitabilitySummary = suitabilitySummary; - } else if ("memOvercommit".equals(fieldName)) { - deserializedAvsAssessmentProperties.memOvercommit = reader.getNullable(JsonReader::getFloat); - } else if ("dedupeCompression".equals(fieldName)) { - deserializedAvsAssessmentProperties.dedupeCompression = reader.getNullable(JsonReader::getFloat); - } else if ("limitingFactor".equals(fieldName)) { - deserializedAvsAssessmentProperties.limitingFactor = reader.getString(); - } else if ("isStretchClusterEnabled".equals(fieldName)) { - deserializedAvsAssessmentProperties.isStretchClusterEnabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("groupType".equals(fieldName)) { - deserializedAvsAssessmentProperties.groupType = GroupType.fromString(reader.getString()); - } else if ("assessmentType".equals(fieldName)) { - deserializedAvsAssessmentProperties.assessmentType = AssessmentType.fromString(reader.getString()); - } else if ("azureLocation".equals(fieldName)) { - deserializedAvsAssessmentProperties.azureLocation = AzureLocation.fromString(reader.getString()); - } else if ("azureOfferCode".equals(fieldName)) { - deserializedAvsAssessmentProperties.azureOfferCode = AzureOfferCode.fromString(reader.getString()); - } else if ("currency".equals(fieldName)) { - deserializedAvsAssessmentProperties.currency = AzureCurrency.fromString(reader.getString()); - } else if ("scalingFactor".equals(fieldName)) { - deserializedAvsAssessmentProperties.scalingFactor = reader.getNullable(JsonReader::getFloat); - } else if ("percentile".equals(fieldName)) { - deserializedAvsAssessmentProperties.percentile = Percentile.fromString(reader.getString()); - } else if ("timeRange".equals(fieldName)) { - deserializedAvsAssessmentProperties.timeRange = TimeRange.fromString(reader.getString()); - } else if ("perfDataStartTime".equals(fieldName)) { - deserializedAvsAssessmentProperties.perfDataStartTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("perfDataEndTime".equals(fieldName)) { - deserializedAvsAssessmentProperties.perfDataEndTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("stage".equals(fieldName)) { - deserializedAvsAssessmentProperties.stage = AssessmentStage.fromString(reader.getString()); - } else if ("discountPercentage".equals(fieldName)) { - deserializedAvsAssessmentProperties.discountPercentage = reader.getNullable(JsonReader::getFloat); - } else if ("sizingCriterion".equals(fieldName)) { - deserializedAvsAssessmentProperties.sizingCriterion - = AssessmentSizingCriterion.fromString(reader.getString()); - } else if ("confidenceRatingInPercentage".equals(fieldName)) { - deserializedAvsAssessmentProperties.confidenceRatingInPercentage - = reader.getNullable(JsonReader::getFloat); - } else if ("pricesTimestamp".equals(fieldName)) { - deserializedAvsAssessmentProperties.pricesTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("createdTimestamp".equals(fieldName)) { - deserializedAvsAssessmentProperties.createdTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("updatedTimestamp".equals(fieldName)) { - deserializedAvsAssessmentProperties.updatedTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("status".equals(fieldName)) { - deserializedAvsAssessmentProperties.status = AssessmentStatus.fromString(reader.getString()); - } else if ("schemaVersion".equals(fieldName)) { - deserializedAvsAssessmentProperties.schemaVersion = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAvsAssessmentProperties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentPropertiesV2.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentPropertiesV2.java new file mode 100644 index 000000000000..d3ce8a281c36 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentPropertiesV2.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AvsAssessmentPropertiesV2 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 AvsAssessmentSettings settings; + + /* + * Gets or sets the details of the assessment. + */ + private AssessmentDetails details; + + /* + * Gets or sets the machine assessment ARM ID for VM fallback. + */ + private String fallbackMachineAssessmentArmId; + + /** + * Creates an instance of AvsAssessmentPropertiesV2 class. + */ + public AvsAssessmentPropertiesV2() { + } + + /** + * 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 AvsAssessmentPropertiesV2 object itself. + */ + public AvsAssessmentPropertiesV2 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 AvsAssessmentSettings 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 AvsAssessmentPropertiesV2 object itself. + */ + public AvsAssessmentPropertiesV2 withSettings(AvsAssessmentSettings 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 AvsAssessmentPropertiesV2 object itself. + */ + public AvsAssessmentPropertiesV2 withDetails(AssessmentDetails details) { + this.details = details; + return this; + } + + /** + * Get the fallbackMachineAssessmentArmId property: Gets or sets the machine assessment ARM ID for VM fallback. + * + * @return the fallbackMachineAssessmentArmId value. + */ + public String fallbackMachineAssessmentArmId() { + return this.fallbackMachineAssessmentArmId; + } + + /** + * Set the fallbackMachineAssessmentArmId property: Gets or sets the machine assessment ARM ID for VM fallback. + * + * @param fallbackMachineAssessmentArmId the fallbackMachineAssessmentArmId value to set. + * @return the AvsAssessmentPropertiesV2 object itself. + */ + public AvsAssessmentPropertiesV2 withFallbackMachineAssessmentArmId(String fallbackMachineAssessmentArmId) { + this.fallbackMachineAssessmentArmId = fallbackMachineAssessmentArmId; + 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); + jsonWriter.writeStringField("fallbackMachineAssessmentArmId", this.fallbackMachineAssessmentArmId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvsAssessmentPropertiesV2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessmentPropertiesV2 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 AvsAssessmentPropertiesV2. + */ + public static AvsAssessmentPropertiesV2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessmentPropertiesV2 deserializedAvsAssessmentPropertiesV2 = new AvsAssessmentPropertiesV2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedAvsAssessmentPropertiesV2.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("scope".equals(fieldName)) { + deserializedAvsAssessmentPropertiesV2.scope = Scope.fromJson(reader); + } else if ("settings".equals(fieldName)) { + deserializedAvsAssessmentPropertiesV2.settings = AvsAssessmentSettings.fromJson(reader); + } else if ("details".equals(fieldName)) { + deserializedAvsAssessmentPropertiesV2.details = AssessmentDetails.fromJson(reader); + } else if ("fallbackMachineAssessmentArmId".equals(fieldName)) { + deserializedAvsAssessmentPropertiesV2.fallbackMachineAssessmentArmId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessmentPropertiesV2; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentScenario.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentScenario.java new file mode 100644 index 000000000000..a1284c2b15d0 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentScenario.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Scenarios with which Avs Assessments can be created. + */ +public final class AvsAssessmentScenario extends ExpandableStringEnum { + /** + * Static value Unknown for AvsAssessmentScenario. + */ + public static final AvsAssessmentScenario UNKNOWN = fromString("Unknown"); + + /** + * Static value NewAvsSddc for AvsAssessmentScenario. + */ + public static final AvsAssessmentScenario NEW_AVS_SDDC = fromString("NewAvsSddc"); + + /** + * Static value AvsSddcExpansion for AvsAssessmentScenario. + */ + public static final AvsAssessmentScenario AVS_SDDC_EXPANSION = fromString("AvsSddcExpansion"); + + /** + * Creates a new instance of AvsAssessmentScenario value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AvsAssessmentScenario() { + } + + /** + * Creates or finds a AvsAssessmentScenario from its string representation. + * + * @param name a name to look for. + * @return the corresponding AvsAssessmentScenario. + */ + public static AvsAssessmentScenario fromString(String name) { + return fromString(name, AvsAssessmentScenario.class); + } + + /** + * Gets known AvsAssessmentScenario values. + * + * @return known AvsAssessmentScenario values. + */ + public static Collection values() { + return values(AvsAssessmentScenario.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentSettings.java new file mode 100644 index 000000000000..13dfffceeabb --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentSettings.java @@ -0,0 +1,629 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 the AVS assessment. + */ +@Fluent +public final class AvsAssessmentSettings 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 Float scalingFactor; + + /* + * Custom discount percentage. + */ + private Float 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; + + /* + * List of Failures to tolerate and RAID levels in a common property. + */ + private List failuresToTolerateAndRaidLevelList; + + /* + * VCPU over subscription. + */ + private Float vcpuOversubscription; + + /* + * AVS node types. + */ + private List nodeTypes; + + /* + * AVS Assessment Scenario. + */ + private AvsAssessmentScenario avsAssessmentScenario; + + /* + * List of AVS external storage types. + */ + private List externalStorageTypes; + + /* + * Gets or sets the CPU headroom. + */ + private Float cpuHeadroom; + + /* + * Is VCF license applied + */ + private Boolean isVcfByolEnabled; + + /* + * Memory overcommit. + */ + private Float memOvercommit; + + /* + * De-duplication compression. + */ + private Float dedupeCompression; + + /* + * Is Stretch Cluster Enabled. + */ + private Boolean isStretchClusterEnabled; + + /** + * Creates an instance of AvsAssessmentSettings class. + */ + public AvsAssessmentSettings() { + } + + /** + * 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 AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings 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 AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings 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 Float 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 AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings withScalingFactor(Float scalingFactor) { + this.scalingFactor = scalingFactor; + return this; + } + + /** + * Get the discountPercentage property: Custom discount percentage. + * + * @return the discountPercentage value. + */ + public Float discountPercentage() { + return this.discountPercentage; + } + + /** + * Set the discountPercentage property: Custom discount percentage. + * + * @param discountPercentage the discountPercentage value to set. + * @return the AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings withDiscountPercentage(Float 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 AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings 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 AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings 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 AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings 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 AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings 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 AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings withEnvironmentType(EnvironmentType environmentType) { + this.environmentType = environmentType; + return this; + } + + /** + * Get the failuresToTolerateAndRaidLevelList property: List of Failures to tolerate and RAID levels in a common + * property. + * + * @return the failuresToTolerateAndRaidLevelList value. + */ + public List failuresToTolerateAndRaidLevelList() { + return this.failuresToTolerateAndRaidLevelList; + } + + /** + * Set the failuresToTolerateAndRaidLevelList property: List of Failures to tolerate and RAID levels in a common + * property. + * + * @param failuresToTolerateAndRaidLevelList the failuresToTolerateAndRaidLevelList value to set. + * @return the AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings + withFailuresToTolerateAndRaidLevelList(List failuresToTolerateAndRaidLevelList) { + this.failuresToTolerateAndRaidLevelList = failuresToTolerateAndRaidLevelList; + return this; + } + + /** + * Get the vcpuOversubscription property: VCPU over subscription. + * + * @return the vcpuOversubscription value. + */ + public Float vcpuOversubscription() { + return this.vcpuOversubscription; + } + + /** + * Set the vcpuOversubscription property: VCPU over subscription. + * + * @param vcpuOversubscription the vcpuOversubscription value to set. + * @return the AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings withVcpuOversubscription(Float vcpuOversubscription) { + this.vcpuOversubscription = vcpuOversubscription; + return this; + } + + /** + * Get the nodeTypes property: AVS node types. + * + * @return the nodeTypes value. + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the nodeTypes property: AVS node types. + * + * @param nodeTypes the nodeTypes value to set. + * @return the AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the avsAssessmentScenario property: AVS Assessment Scenario. + * + * @return the avsAssessmentScenario value. + */ + public AvsAssessmentScenario avsAssessmentScenario() { + return this.avsAssessmentScenario; + } + + /** + * Set the avsAssessmentScenario property: AVS Assessment Scenario. + * + * @param avsAssessmentScenario the avsAssessmentScenario value to set. + * @return the AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings withAvsAssessmentScenario(AvsAssessmentScenario avsAssessmentScenario) { + this.avsAssessmentScenario = avsAssessmentScenario; + return this; + } + + /** + * Get the externalStorageTypes property: List of AVS external storage types. + * + * @return the externalStorageTypes value. + */ + public List externalStorageTypes() { + return this.externalStorageTypes; + } + + /** + * Set the externalStorageTypes property: List of AVS external storage types. + * + * @param externalStorageTypes the externalStorageTypes value to set. + * @return the AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings withExternalStorageTypes(List externalStorageTypes) { + this.externalStorageTypes = externalStorageTypes; + return this; + } + + /** + * Get the cpuHeadroom property: Gets or sets the CPU headroom. + * + * @return the cpuHeadroom value. + */ + public Float cpuHeadroom() { + return this.cpuHeadroom; + } + + /** + * Set the cpuHeadroom property: Gets or sets the CPU headroom. + * + * @param cpuHeadroom the cpuHeadroom value to set. + * @return the AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings withCpuHeadroom(Float cpuHeadroom) { + this.cpuHeadroom = cpuHeadroom; + return this; + } + + /** + * Get the isVcfByolEnabled property: Is VCF license applied. + * + * @return the isVcfByolEnabled value. + */ + public Boolean isVcfByolEnabled() { + return this.isVcfByolEnabled; + } + + /** + * Set the isVcfByolEnabled property: Is VCF license applied. + * + * @param isVcfByolEnabled the isVcfByolEnabled value to set. + * @return the AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings withIsVcfByolEnabled(Boolean isVcfByolEnabled) { + this.isVcfByolEnabled = isVcfByolEnabled; + return this; + } + + /** + * Get the memOvercommit property: Memory overcommit. + * + * @return the memOvercommit value. + */ + public Float memOvercommit() { + return this.memOvercommit; + } + + /** + * Set the memOvercommit property: Memory overcommit. + * + * @param memOvercommit the memOvercommit value to set. + * @return the AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings withMemOvercommit(Float memOvercommit) { + this.memOvercommit = memOvercommit; + return this; + } + + /** + * Get the dedupeCompression property: De-duplication compression. + * + * @return the dedupeCompression value. + */ + public Float dedupeCompression() { + return this.dedupeCompression; + } + + /** + * Set the dedupeCompression property: De-duplication compression. + * + * @param dedupeCompression the dedupeCompression value to set. + * @return the AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings withDedupeCompression(Float dedupeCompression) { + this.dedupeCompression = dedupeCompression; + return this; + } + + /** + * Get the isStretchClusterEnabled property: Is Stretch Cluster Enabled. + * + * @return the isStretchClusterEnabled value. + */ + public Boolean isStretchClusterEnabled() { + return this.isStretchClusterEnabled; + } + + /** + * Set the isStretchClusterEnabled property: Is Stretch Cluster Enabled. + * + * @param isStretchClusterEnabled the isStretchClusterEnabled value to set. + * @return the AvsAssessmentSettings object itself. + */ + public AvsAssessmentSettings withIsStretchClusterEnabled(Boolean isStretchClusterEnabled) { + this.isStretchClusterEnabled = isStretchClusterEnabled; + 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(); + } + } + + /** + * {@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.writeArrayField("failuresToTolerateAndRaidLevelList", this.failuresToTolerateAndRaidLevelList, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeNumberField("vcpuOversubscription", this.vcpuOversubscription); + jsonWriter.writeArrayField("nodeTypes", this.nodeTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("avsAssessmentScenario", + this.avsAssessmentScenario == null ? null : this.avsAssessmentScenario.toString()); + jsonWriter.writeArrayField("externalStorageTypes", this.externalStorageTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeNumberField("cpuHeadroom", this.cpuHeadroom); + jsonWriter.writeBooleanField("isVcfByolEnabled", this.isVcfByolEnabled); + jsonWriter.writeNumberField("memOvercommit", this.memOvercommit); + jsonWriter.writeNumberField("dedupeCompression", this.dedupeCompression); + jsonWriter.writeBooleanField("isStretchClusterEnabled", this.isStretchClusterEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvsAssessmentSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessmentSettings 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 AvsAssessmentSettings. + */ + public static AvsAssessmentSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessmentSettings deserializedAvsAssessmentSettings = new AvsAssessmentSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureLocation".equals(fieldName)) { + deserializedAvsAssessmentSettings.azureLocation = reader.getString(); + } else if ("currency".equals(fieldName)) { + deserializedAvsAssessmentSettings.currency = AzureCurrency.fromString(reader.getString()); + } else if ("scalingFactor".equals(fieldName)) { + deserializedAvsAssessmentSettings.scalingFactor = reader.getNullable(JsonReader::getFloat); + } else if ("discountPercentage".equals(fieldName)) { + deserializedAvsAssessmentSettings.discountPercentage = reader.getNullable(JsonReader::getFloat); + } else if ("sizingCriterion".equals(fieldName)) { + deserializedAvsAssessmentSettings.sizingCriterion + = AssessmentSizingCriterion.fromString(reader.getString()); + } else if ("performanceData".equals(fieldName)) { + deserializedAvsAssessmentSettings.performanceData = PerformanceData.fromJson(reader); + } else if ("savingsSettings".equals(fieldName)) { + deserializedAvsAssessmentSettings.savingsSettings = SavingsSettings.fromJson(reader); + } else if ("billingSettings".equals(fieldName)) { + deserializedAvsAssessmentSettings.billingSettings = BillingSettings.fromJson(reader); + } else if ("environmentType".equals(fieldName)) { + deserializedAvsAssessmentSettings.environmentType = EnvironmentType.fromString(reader.getString()); + } else if ("failuresToTolerateAndRaidLevelList".equals(fieldName)) { + List failuresToTolerateAndRaidLevelList + = reader.readArray(reader1 -> FttAndRaidLevel.fromString(reader1.getString())); + deserializedAvsAssessmentSettings.failuresToTolerateAndRaidLevelList + = failuresToTolerateAndRaidLevelList; + } else if ("vcpuOversubscription".equals(fieldName)) { + deserializedAvsAssessmentSettings.vcpuOversubscription = reader.getNullable(JsonReader::getFloat); + } else if ("nodeTypes".equals(fieldName)) { + List nodeTypes + = reader.readArray(reader1 -> AzureAvsNodeType.fromString(reader1.getString())); + deserializedAvsAssessmentSettings.nodeTypes = nodeTypes; + } else if ("avsAssessmentScenario".equals(fieldName)) { + deserializedAvsAssessmentSettings.avsAssessmentScenario + = AvsAssessmentScenario.fromString(reader.getString()); + } else if ("externalStorageTypes".equals(fieldName)) { + List externalStorageTypes + = reader.readArray(reader1 -> ExternalStorageType.fromString(reader1.getString())); + deserializedAvsAssessmentSettings.externalStorageTypes = externalStorageTypes; + } else if ("cpuHeadroom".equals(fieldName)) { + deserializedAvsAssessmentSettings.cpuHeadroom = reader.getNullable(JsonReader::getFloat); + } else if ("isVcfByolEnabled".equals(fieldName)) { + deserializedAvsAssessmentSettings.isVcfByolEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("memOvercommit".equals(fieldName)) { + deserializedAvsAssessmentSettings.memOvercommit = reader.getNullable(JsonReader::getFloat); + } else if ("dedupeCompression".equals(fieldName)) { + deserializedAvsAssessmentSettings.dedupeCompression = reader.getNullable(JsonReader::getFloat); + } else if ("isStretchClusterEnabled".equals(fieldName)) { + deserializedAvsAssessmentSettings.isStretchClusterEnabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessmentSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentSummaryPropertiesV2.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentSummaryPropertiesV2.java new file mode 100644 index 000000000000..a987ce56a2fa --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentSummaryPropertiesV2.java @@ -0,0 +1,435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Properties of the Machine Assessment V2 Summary. + */ +@Immutable +public final class AvsAssessmentSummaryPropertiesV2 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; + + /* + * Gets or sets the Assessment cloud suitability. + */ + private CloudSuitability suitability; + + /* + * Gets or sets the Assessment suitability explanation. + */ + private AzureAvsSuitabilityExplanation suitabilityExplanation; + + /* + * Recommended number of nodes. + */ + private Integer numberOfNodes; + + /* + * Predicted CPU utilization. + */ + private Float cpuUtilization; + + /* + * Predicted RAM utilization. + */ + private Float ramUtilization; + + /* + * Predicted storage utilization. + */ + private Float storageUtilization; + + /* + * Predicted total CPU cores used. + */ + private Float totalCpuCores; + + /* + * Predicted total RAM used in GB. + */ + private Float totalRamInGB; + + /* + * Predicted total Storage used in GB. + */ + private Float totalStorageInGB; + + /* + * Estimated AVS SKU for Assessment. + */ + private List avsEstimatedNodes; + + /* + * Estimated External Storage for Assessment. + */ + private List avsEstimatedExternalStorages; + + /* + * Estimated External Storage for Assessment. + */ + private List avsEstimatedNetworks; + + /* + * Limiting factor. + */ + private String limitingFactor; + + /** + * Creates an instance of AvsAssessmentSummaryPropertiesV2 class. + */ + public AvsAssessmentSummaryPropertiesV2() { + } + + /** + * 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; + } + + /** + * Get the suitability property: Gets or sets the Assessment cloud suitability. + * + * @return the suitability value. + */ + public CloudSuitability suitability() { + return this.suitability; + } + + /** + * Get the suitabilityExplanation property: Gets or sets the Assessment suitability explanation. + * + * @return the suitabilityExplanation value. + */ + public AzureAvsSuitabilityExplanation suitabilityExplanation() { + return this.suitabilityExplanation; + } + + /** + * Get the numberOfNodes property: Recommended number of nodes. + * + * @return the numberOfNodes value. + */ + public Integer numberOfNodes() { + return this.numberOfNodes; + } + + /** + * Get the cpuUtilization property: Predicted CPU utilization. + * + * @return the cpuUtilization value. + */ + public Float cpuUtilization() { + return this.cpuUtilization; + } + + /** + * Get the ramUtilization property: Predicted RAM utilization. + * + * @return the ramUtilization value. + */ + public Float ramUtilization() { + return this.ramUtilization; + } + + /** + * Get the storageUtilization property: Predicted storage utilization. + * + * @return the storageUtilization value. + */ + public Float storageUtilization() { + return this.storageUtilization; + } + + /** + * Get the totalCpuCores property: Predicted total CPU cores used. + * + * @return the totalCpuCores value. + */ + public Float totalCpuCores() { + return this.totalCpuCores; + } + + /** + * Get the totalRamInGB property: Predicted total RAM used in GB. + * + * @return the totalRamInGB value. + */ + public Float totalRamInGB() { + return this.totalRamInGB; + } + + /** + * Get the totalStorageInGB property: Predicted total Storage used in GB. + * + * @return the totalStorageInGB value. + */ + public Float totalStorageInGB() { + return this.totalStorageInGB; + } + + /** + * Get the avsEstimatedNodes property: Estimated AVS SKU for Assessment. + * + * @return the avsEstimatedNodes value. + */ + public List avsEstimatedNodes() { + return this.avsEstimatedNodes; + } + + /** + * Get the avsEstimatedExternalStorages property: Estimated External Storage for Assessment. + * + * @return the avsEstimatedExternalStorages value. + */ + public List avsEstimatedExternalStorages() { + return this.avsEstimatedExternalStorages; + } + + /** + * Get the avsEstimatedNetworks property: Estimated External Storage for Assessment. + * + * @return the avsEstimatedNetworks value. + */ + public List avsEstimatedNetworks() { + return this.avsEstimatedNetworks; + } + + /** + * Get the limitingFactor property: Limiting factor. + * + * @return the limitingFactor value. + */ + public String limitingFactor() { + return this.limitingFactor; + } + + /** + * 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()); + } + if (avsEstimatedNodes() != null) { + avsEstimatedNodes().forEach(e -> e.validate()); + } + if (avsEstimatedExternalStorages() != null) { + avsEstimatedExternalStorages().forEach(e -> e.validate()); + } + if (avsEstimatedNetworks() != null) { + avsEstimatedNetworks().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvsAssessmentSummaryPropertiesV2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessmentSummaryPropertiesV2 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 AvsAssessmentSummaryPropertiesV2. + */ + public static AvsAssessmentSummaryPropertiesV2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessmentSummaryPropertiesV2 deserializedAvsAssessmentSummaryPropertiesV2 + = new AvsAssessmentSummaryPropertiesV2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("summaryType".equals(fieldName)) { + deserializedAvsAssessmentSummaryPropertiesV2.summaryType + = SummaryType.fromString(reader.getString()); + } else if ("summaryName".equals(fieldName)) { + deserializedAvsAssessmentSummaryPropertiesV2.summaryName = reader.getString(); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> SourceDetails.fromJson(reader1)); + deserializedAvsAssessmentSummaryPropertiesV2.sources = sources; + } else if ("targets".equals(fieldName)) { + List targets = reader.readArray(reader1 -> TargetDetails.fromJson(reader1)); + deserializedAvsAssessmentSummaryPropertiesV2.targets = targets; + } else if ("targetSourceMapping".equals(fieldName)) { + List targetSourceMapping + = reader.readArray(reader1 -> TargetSourcePair.fromJson(reader1)); + deserializedAvsAssessmentSummaryPropertiesV2.targetSourceMapping = targetSourceMapping; + } else if ("costComponents".equals(fieldName)) { + List costComponents + = reader.readArray(reader1 -> CostDetailsCommon.fromJson(reader1)); + deserializedAvsAssessmentSummaryPropertiesV2.costComponents = costComponents; + } else if ("savingsComponents".equals(fieldName)) { + List savingsComponents + = reader.readArray(reader1 -> SavingsDetailsCommon.fromJson(reader1)); + deserializedAvsAssessmentSummaryPropertiesV2.savingsComponents = savingsComponents; + } else if ("suitability".equals(fieldName)) { + deserializedAvsAssessmentSummaryPropertiesV2.suitability + = CloudSuitability.fromString(reader.getString()); + } else if ("suitabilityExplanation".equals(fieldName)) { + deserializedAvsAssessmentSummaryPropertiesV2.suitabilityExplanation + = AzureAvsSuitabilityExplanation.fromString(reader.getString()); + } else if ("numberOfNodes".equals(fieldName)) { + deserializedAvsAssessmentSummaryPropertiesV2.numberOfNodes = reader.getNullable(JsonReader::getInt); + } else if ("cpuUtilization".equals(fieldName)) { + deserializedAvsAssessmentSummaryPropertiesV2.cpuUtilization + = reader.getNullable(JsonReader::getFloat); + } else if ("ramUtilization".equals(fieldName)) { + deserializedAvsAssessmentSummaryPropertiesV2.ramUtilization + = reader.getNullable(JsonReader::getFloat); + } else if ("storageUtilization".equals(fieldName)) { + deserializedAvsAssessmentSummaryPropertiesV2.storageUtilization + = reader.getNullable(JsonReader::getFloat); + } else if ("totalCpuCores".equals(fieldName)) { + deserializedAvsAssessmentSummaryPropertiesV2.totalCpuCores + = reader.getNullable(JsonReader::getFloat); + } else if ("totalRamInGB".equals(fieldName)) { + deserializedAvsAssessmentSummaryPropertiesV2.totalRamInGB + = reader.getNullable(JsonReader::getFloat); + } else if ("totalStorageInGB".equals(fieldName)) { + deserializedAvsAssessmentSummaryPropertiesV2.totalStorageInGB + = reader.getNullable(JsonReader::getFloat); + } else if ("avsEstimatedNodes".equals(fieldName)) { + List avsEstimatedNodes + = reader.readArray(reader1 -> AvsEstimatedNode.fromJson(reader1)); + deserializedAvsAssessmentSummaryPropertiesV2.avsEstimatedNodes = avsEstimatedNodes; + } else if ("avsEstimatedExternalStorages".equals(fieldName)) { + List avsEstimatedExternalStorages + = reader.readArray(reader1 -> AvsEstimatedExternalStorage.fromJson(reader1)); + deserializedAvsAssessmentSummaryPropertiesV2.avsEstimatedExternalStorages + = avsEstimatedExternalStorages; + } else if ("avsEstimatedNetworks".equals(fieldName)) { + List avsEstimatedNetworks + = reader.readArray(reader1 -> AvsEstimatedNetwork.fromJson(reader1)); + deserializedAvsAssessmentSummaryPropertiesV2.avsEstimatedNetworks = avsEstimatedNetworks; + } else if ("limitingFactor".equals(fieldName)) { + deserializedAvsAssessmentSummaryPropertiesV2.limitingFactor = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessmentSummaryPropertiesV2; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentV2.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentV2.java new file mode 100644 index 000000000000..50ae79721a2b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentV2.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentV2Inner; + +/** + * An immutable client-side representation of AvsAssessmentV2. + */ +public interface AvsAssessmentV2 { + /** + * 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. + */ + AvsAssessmentPropertiesV2 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.migration.assessment.fluent.models.AvsAssessmentV2Inner object. + * + * @return the inner object. + */ + AvsAssessmentV2Inner innerModel(); + + /** + * The entirety of the AvsAssessmentV2 definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The AvsAssessmentV2 definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AvsAssessmentV2 definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the AvsAssessmentV2 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 AvsAssessmentV2 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. + */ + AvsAssessmentV2 create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AvsAssessmentV2 create(Context context); + } + + /** + * The stage of the AvsAssessmentV2 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(AvsAssessmentPropertiesV2 properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AvsAssessmentV2 refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AvsAssessmentV2 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 the URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(Object 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 the URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(Object body, Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentV2ListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentV2ListResult.java new file mode 100644 index 000000000000..4e15650c4822 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentV2ListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AvsAssessmentV2Inner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AvsAssessmentV2 list operation. + */ +@Fluent +public final class AvsAssessmentV2ListResult implements JsonSerializable { + /* + * The AvsAssessmentV2 items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AvsAssessmentV2ListResult class. + */ + public AvsAssessmentV2ListResult() { + } + + /** + * Get the value property: The AvsAssessmentV2 items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AvsAssessmentV2 items on this page. + * + * @param value the value value to set. + * @return the AvsAssessmentV2ListResult object itself. + */ + public AvsAssessmentV2ListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AvsAssessmentV2ListResult object itself. + */ + public AvsAssessmentV2ListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 AvsAssessmentV2ListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AvsAssessmentV2ListResult.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 AvsAssessmentV2ListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessmentV2ListResult 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 AvsAssessmentV2ListResult. + */ + public static AvsAssessmentV2ListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessmentV2ListResult deserializedAvsAssessmentV2ListResult = new AvsAssessmentV2ListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AvsAssessmentV2Inner.fromJson(reader1)); + deserializedAvsAssessmentV2ListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAvsAssessmentV2ListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessmentV2ListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentV2Summary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentV2Summary.java new file mode 100644 index 000000000000..12064d63d597 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentV2Summary.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentV2SummaryInner; + +/** + * An immutable client-side representation of AvsAssessmentV2Summary. + */ +public interface AvsAssessmentV2Summary { + /** + * 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. + */ + AvsAssessmentSummaryPropertiesV2 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.migration.assessment.fluent.models.AvsAssessmentV2SummaryInner object. + * + * @return the inner object. + */ + AvsAssessmentV2SummaryInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentV2SummaryListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentV2SummaryListResult.java new file mode 100644 index 000000000000..2a96d82443d2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentV2SummaryListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AvsAssessmentV2SummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AvsAssessmentV2Summary list operation. + */ +@Fluent +public final class AvsAssessmentV2SummaryListResult implements JsonSerializable { + /* + * The AvsAssessmentV2Summary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AvsAssessmentV2SummaryListResult class. + */ + public AvsAssessmentV2SummaryListResult() { + } + + /** + * Get the value property: The AvsAssessmentV2Summary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AvsAssessmentV2Summary items on this page. + * + * @param value the value value to set. + * @return the AvsAssessmentV2SummaryListResult object itself. + */ + public AvsAssessmentV2SummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AvsAssessmentV2SummaryListResult object itself. + */ + public AvsAssessmentV2SummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 AvsAssessmentV2SummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AvsAssessmentV2SummaryListResult.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 AvsAssessmentV2SummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsAssessmentV2SummaryListResult 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 AvsAssessmentV2SummaryListResult. + */ + public static AvsAssessmentV2SummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsAssessmentV2SummaryListResult deserializedAvsAssessmentV2SummaryListResult + = new AvsAssessmentV2SummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AvsAssessmentV2SummaryInner.fromJson(reader1)); + deserializedAvsAssessmentV2SummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAvsAssessmentV2SummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsAssessmentV2SummaryListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentV2SummaryOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentV2SummaryOperations.java new file mode 100644 index 000000000000..4879ccbf1ede --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentV2SummaryOperations.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AvsAssessmentV2SummaryOperations. + */ +public interface AvsAssessmentV2SummaryOperations { + /** + * List AvsAssessmentV2Summary resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2Summary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List AvsAssessmentV2Summary resources by AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2Summary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a AvsAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param summaryName Gets the Name of the AVS Assessment 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 AvsAssessmentV2Summary along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String summaryName, Context context); + + /** + * Get a AvsAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment ARM name. + * @param summaryName Gets the Name of the AVS Assessment 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 AvsAssessmentV2Summary. + */ + AvsAssessmentV2Summary get(String resourceGroupName, String projectName, String assessmentName, String summaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentsOperations.java deleted file mode 100644 index 5f023d43b38f..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentsOperations.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 AvsAssessmentsOperations. - */ -public interface AvsAssessmentsOperations { - /** - * List AvsAssessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 AvsAssessment list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName); - - /** - * List AvsAssessment resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 AvsAssessment list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName, - Context context); - - /** - * Get a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessment along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, Context context); - - /** - * Get a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 AvsAssessment. - */ - AvsAssessment get(String resourceGroupName, String projectName, String groupName, String assessmentName); - - /** - * Delete a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 groupName, - String assessmentName, Context context); - - /** - * Delete a AvsAssessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName AVS Assessment 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 groupName, 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 URL for downloading the assessment in a report format. - */ - DownloadUrl downloadUrl(String resourceGroupName, String projectName, String groupName, String assessmentName, - Object 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 groupName Group ARM name. - * @param assessmentName AVS Assessment 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 URL for downloading the assessment in a report format. - */ - DownloadUrl downloadUrl(String resourceGroupName, String projectName, String groupName, String assessmentName, - Object body, Context context); - - /** - * Get a AvsAssessment. - * - * @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 AvsAssessment along with {@link Response}. - */ - AvsAssessment getById(String id); - - /** - * Get a AvsAssessment. - * - * @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 AvsAssessment along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a AvsAssessment. - * - * @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 AvsAssessment. - * - * @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 AvsAssessment resource. - * - * @param name resource name. - * @return the first stage of the new AvsAssessment definition. - */ - AvsAssessment.DefinitionStages.Blank define(String name); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentsV2Operations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentsV2Operations.java new file mode 100644 index 000000000000..41da04a96879 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsAssessmentsV2Operations.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AvsAssessmentsV2Operations. + */ +public interface AvsAssessmentsV2Operations { + /** + * List AvsAssessmentV2 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 AvsAssessmentV2 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List AvsAssessmentV2 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 AvsAssessmentV2 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + Context context); + + /** + * Get a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2. + */ + AvsAssessmentV2 get(String resourceGroupName, String projectName, String assessmentName); + + /** + * Delete a AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AvsAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName AVS Assessment 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 AVS Assessment 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 URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object 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 AVS Assessment 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 URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object body, + Context context); + + /** + * Get a AvsAssessmentV2. + * + * @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 AvsAssessmentV2 along with {@link Response}. + */ + AvsAssessmentV2 getById(String id); + + /** + * Get a AvsAssessmentV2. + * + * @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 AvsAssessmentV2 along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a AvsAssessmentV2. + * + * @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 AvsAssessmentV2. + * + * @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 AvsAssessmentV2 resource. + * + * @param name resource name. + * @return the first stage of the new AvsAssessmentV2 definition. + */ + AvsAssessmentV2.DefinitionStages.Blank define(String name); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsEstimatedExternalStorage.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsEstimatedExternalStorage.java new file mode 100644 index 000000000000..ff6a20a8a8ad --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsEstimatedExternalStorage.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 Estimated External Storage for AVS Assessment. + */ +@Fluent +public final class AvsEstimatedExternalStorage implements JsonSerializable { + /* + * Total monthly cost for type of storage. + */ + private Float monthlyPrice; + + /* + * Recommended External Storage. + */ + private ExternalStorageType storageType; + + /* + * Predicted total Storage used in GB. + */ + private Float totalStorageInGB; + + /* + * Predicted storage utilization. + */ + private Float storageUtilization; + + /** + * Creates an instance of AvsEstimatedExternalStorage class. + */ + public AvsEstimatedExternalStorage() { + } + + /** + * Get the monthlyPrice property: Total monthly cost for type of storage. + * + * @return the monthlyPrice value. + */ + public Float monthlyPrice() { + return this.monthlyPrice; + } + + /** + * Set the monthlyPrice property: Total monthly cost for type of storage. + * + * @param monthlyPrice the monthlyPrice value to set. + * @return the AvsEstimatedExternalStorage object itself. + */ + public AvsEstimatedExternalStorage withMonthlyPrice(Float monthlyPrice) { + this.monthlyPrice = monthlyPrice; + return this; + } + + /** + * Get the storageType property: Recommended External Storage. + * + * @return the storageType value. + */ + public ExternalStorageType storageType() { + return this.storageType; + } + + /** + * Set the storageType property: Recommended External Storage. + * + * @param storageType the storageType value to set. + * @return the AvsEstimatedExternalStorage object itself. + */ + public AvsEstimatedExternalStorage withStorageType(ExternalStorageType storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the totalStorageInGB property: Predicted total Storage used in GB. + * + * @return the totalStorageInGB value. + */ + public Float totalStorageInGB() { + return this.totalStorageInGB; + } + + /** + * Set the totalStorageInGB property: Predicted total Storage used in GB. + * + * @param totalStorageInGB the totalStorageInGB value to set. + * @return the AvsEstimatedExternalStorage object itself. + */ + public AvsEstimatedExternalStorage withTotalStorageInGB(Float totalStorageInGB) { + this.totalStorageInGB = totalStorageInGB; + return this; + } + + /** + * Get the storageUtilization property: Predicted storage utilization. + * + * @return the storageUtilization value. + */ + public Float storageUtilization() { + return this.storageUtilization; + } + + /** + * Set the storageUtilization property: Predicted storage utilization. + * + * @param storageUtilization the storageUtilization value to set. + * @return the AvsEstimatedExternalStorage object itself. + */ + public AvsEstimatedExternalStorage withStorageUtilization(Float storageUtilization) { + this.storageUtilization = storageUtilization; + 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("monthlyPrice", this.monthlyPrice); + jsonWriter.writeStringField("storageType", this.storageType == null ? null : this.storageType.toString()); + jsonWriter.writeNumberField("totalStorageInGB", this.totalStorageInGB); + jsonWriter.writeNumberField("storageUtilization", this.storageUtilization); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvsEstimatedExternalStorage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsEstimatedExternalStorage 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 AvsEstimatedExternalStorage. + */ + public static AvsEstimatedExternalStorage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsEstimatedExternalStorage deserializedAvsEstimatedExternalStorage = new AvsEstimatedExternalStorage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("monthlyPrice".equals(fieldName)) { + deserializedAvsEstimatedExternalStorage.monthlyPrice = reader.getNullable(JsonReader::getFloat); + } else if ("storageType".equals(fieldName)) { + deserializedAvsEstimatedExternalStorage.storageType + = ExternalStorageType.fromString(reader.getString()); + } else if ("totalStorageInGB".equals(fieldName)) { + deserializedAvsEstimatedExternalStorage.totalStorageInGB = reader.getNullable(JsonReader::getFloat); + } else if ("storageUtilization".equals(fieldName)) { + deserializedAvsEstimatedExternalStorage.storageUtilization + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsEstimatedExternalStorage; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsEstimatedNetwork.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsEstimatedNetwork.java new file mode 100644 index 000000000000..b182a6371848 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsEstimatedNetwork.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 Estimated Network Costs for AVS Assessment. + */ +@Fluent +public final class AvsEstimatedNetwork implements JsonSerializable { + /* + * Monthly cost for network type. + */ + private Float monthlyPrice; + + /* + * Recommended Network Sku. + */ + private NetworkSkuType networkType; + + /** + * Creates an instance of AvsEstimatedNetwork class. + */ + public AvsEstimatedNetwork() { + } + + /** + * Get the monthlyPrice property: Monthly cost for network type. + * + * @return the monthlyPrice value. + */ + public Float monthlyPrice() { + return this.monthlyPrice; + } + + /** + * Set the monthlyPrice property: Monthly cost for network type. + * + * @param monthlyPrice the monthlyPrice value to set. + * @return the AvsEstimatedNetwork object itself. + */ + public AvsEstimatedNetwork withMonthlyPrice(Float monthlyPrice) { + this.monthlyPrice = monthlyPrice; + return this; + } + + /** + * Get the networkType property: Recommended Network Sku. + * + * @return the networkType value. + */ + public NetworkSkuType networkType() { + return this.networkType; + } + + /** + * Set the networkType property: Recommended Network Sku. + * + * @param networkType the networkType value to set. + * @return the AvsEstimatedNetwork object itself. + */ + public AvsEstimatedNetwork withNetworkType(NetworkSkuType networkType) { + this.networkType = networkType; + 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("monthlyPrice", this.monthlyPrice); + jsonWriter.writeStringField("networkType", this.networkType == null ? null : this.networkType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvsEstimatedNetwork from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsEstimatedNetwork 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 AvsEstimatedNetwork. + */ + public static AvsEstimatedNetwork fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsEstimatedNetwork deserializedAvsEstimatedNetwork = new AvsEstimatedNetwork(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("monthlyPrice".equals(fieldName)) { + deserializedAvsEstimatedNetwork.monthlyPrice = reader.getNullable(JsonReader::getFloat); + } else if ("networkType".equals(fieldName)) { + deserializedAvsEstimatedNetwork.networkType = NetworkSkuType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsEstimatedNetwork; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsEstimatedNode.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsEstimatedNode.java new file mode 100644 index 000000000000..fec67c9bdcf4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsEstimatedNode.java @@ -0,0 +1,375 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 Estimated nodes for AVS Assessment. + */ +@Fluent +public final class AvsEstimatedNode implements JsonSerializable { + /* + * Total monthly cost for type and number of nodes. + */ + private Float monthlyPrice; + + /* + * Recommended SKU. + */ + private AzureAvsNodeType nodeType; + + /* + * Number of nodes that will be needed. + */ + private Integer nodeNumber; + + /* + * Predicted CPU utilization. + */ + private Float cpuUtilization; + + /* + * Predicted RAM utilization. + */ + private Float ramUtilization; + + /* + * Predicted storage utilization. + */ + private Float storageUtilization; + + /* + * Predicted total CPU cores across the set of nodes. + */ + private Float totalCpu; + + /* + * Predicted total RAM used in GB. + */ + private Float totalRam; + + /* + * Predicted total Storage used in GB. + */ + private Float totalStorage; + + /* + * Pricing model indicates what hour multiplier to use while estimating the Nodes cost. + */ + private AzureReservedInstance pricingModel; + + /* + * FttRaidLevel recommended for Node. + */ + private FttAndRaidLevel fttRaidLevel; + + /** + * Creates an instance of AvsEstimatedNode class. + */ + public AvsEstimatedNode() { + } + + /** + * Get the monthlyPrice property: Total monthly cost for type and number of nodes. + * + * @return the monthlyPrice value. + */ + public Float monthlyPrice() { + return this.monthlyPrice; + } + + /** + * Set the monthlyPrice property: Total monthly cost for type and number of nodes. + * + * @param monthlyPrice the monthlyPrice value to set. + * @return the AvsEstimatedNode object itself. + */ + public AvsEstimatedNode withMonthlyPrice(Float monthlyPrice) { + this.monthlyPrice = monthlyPrice; + return this; + } + + /** + * Get the nodeType property: Recommended SKU. + * + * @return the nodeType value. + */ + public AzureAvsNodeType nodeType() { + return this.nodeType; + } + + /** + * Set the nodeType property: Recommended SKU. + * + * @param nodeType the nodeType value to set. + * @return the AvsEstimatedNode object itself. + */ + public AvsEstimatedNode withNodeType(AzureAvsNodeType nodeType) { + this.nodeType = nodeType; + return this; + } + + /** + * Get the nodeNumber property: Number of nodes that will be needed. + * + * @return the nodeNumber value. + */ + public Integer nodeNumber() { + return this.nodeNumber; + } + + /** + * Set the nodeNumber property: Number of nodes that will be needed. + * + * @param nodeNumber the nodeNumber value to set. + * @return the AvsEstimatedNode object itself. + */ + public AvsEstimatedNode withNodeNumber(Integer nodeNumber) { + this.nodeNumber = nodeNumber; + return this; + } + + /** + * Get the cpuUtilization property: Predicted CPU utilization. + * + * @return the cpuUtilization value. + */ + public Float cpuUtilization() { + return this.cpuUtilization; + } + + /** + * Set the cpuUtilization property: Predicted CPU utilization. + * + * @param cpuUtilization the cpuUtilization value to set. + * @return the AvsEstimatedNode object itself. + */ + public AvsEstimatedNode withCpuUtilization(Float cpuUtilization) { + this.cpuUtilization = cpuUtilization; + return this; + } + + /** + * Get the ramUtilization property: Predicted RAM utilization. + * + * @return the ramUtilization value. + */ + public Float ramUtilization() { + return this.ramUtilization; + } + + /** + * Set the ramUtilization property: Predicted RAM utilization. + * + * @param ramUtilization the ramUtilization value to set. + * @return the AvsEstimatedNode object itself. + */ + public AvsEstimatedNode withRamUtilization(Float ramUtilization) { + this.ramUtilization = ramUtilization; + return this; + } + + /** + * Get the storageUtilization property: Predicted storage utilization. + * + * @return the storageUtilization value. + */ + public Float storageUtilization() { + return this.storageUtilization; + } + + /** + * Set the storageUtilization property: Predicted storage utilization. + * + * @param storageUtilization the storageUtilization value to set. + * @return the AvsEstimatedNode object itself. + */ + public AvsEstimatedNode withStorageUtilization(Float storageUtilization) { + this.storageUtilization = storageUtilization; + return this; + } + + /** + * Get the totalCpu property: Predicted total CPU cores across the set of nodes. + * + * @return the totalCpu value. + */ + public Float totalCpu() { + return this.totalCpu; + } + + /** + * Set the totalCpu property: Predicted total CPU cores across the set of nodes. + * + * @param totalCpu the totalCpu value to set. + * @return the AvsEstimatedNode object itself. + */ + public AvsEstimatedNode withTotalCpu(Float totalCpu) { + this.totalCpu = totalCpu; + return this; + } + + /** + * Get the totalRam property: Predicted total RAM used in GB. + * + * @return the totalRam value. + */ + public Float totalRam() { + return this.totalRam; + } + + /** + * Set the totalRam property: Predicted total RAM used in GB. + * + * @param totalRam the totalRam value to set. + * @return the AvsEstimatedNode object itself. + */ + public AvsEstimatedNode withTotalRam(Float totalRam) { + this.totalRam = totalRam; + return this; + } + + /** + * Get the totalStorage property: Predicted total Storage used in GB. + * + * @return the totalStorage value. + */ + public Float totalStorage() { + return this.totalStorage; + } + + /** + * Set the totalStorage property: Predicted total Storage used in GB. + * + * @param totalStorage the totalStorage value to set. + * @return the AvsEstimatedNode object itself. + */ + public AvsEstimatedNode withTotalStorage(Float totalStorage) { + this.totalStorage = totalStorage; + return this; + } + + /** + * Get the pricingModel property: Pricing model indicates what hour multiplier to use while estimating the Nodes + * cost. + * + * @return the pricingModel value. + */ + public AzureReservedInstance pricingModel() { + return this.pricingModel; + } + + /** + * Set the pricingModel property: Pricing model indicates what hour multiplier to use while estimating the Nodes + * cost. + * + * @param pricingModel the pricingModel value to set. + * @return the AvsEstimatedNode object itself. + */ + public AvsEstimatedNode withPricingModel(AzureReservedInstance pricingModel) { + this.pricingModel = pricingModel; + return this; + } + + /** + * Get the fttRaidLevel property: FttRaidLevel recommended for Node. + * + * @return the fttRaidLevel value. + */ + public FttAndRaidLevel fttRaidLevel() { + return this.fttRaidLevel; + } + + /** + * Set the fttRaidLevel property: FttRaidLevel recommended for Node. + * + * @param fttRaidLevel the fttRaidLevel value to set. + * @return the AvsEstimatedNode object itself. + */ + public AvsEstimatedNode withFttRaidLevel(FttAndRaidLevel fttRaidLevel) { + this.fttRaidLevel = fttRaidLevel; + 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("monthlyPrice", this.monthlyPrice); + jsonWriter.writeStringField("nodeType", this.nodeType == null ? null : this.nodeType.toString()); + jsonWriter.writeNumberField("nodeNumber", this.nodeNumber); + jsonWriter.writeNumberField("cpuUtilization", this.cpuUtilization); + jsonWriter.writeNumberField("ramUtilization", this.ramUtilization); + jsonWriter.writeNumberField("storageUtilization", this.storageUtilization); + jsonWriter.writeNumberField("totalCpu", this.totalCpu); + jsonWriter.writeNumberField("totalRam", this.totalRam); + jsonWriter.writeNumberField("totalStorage", this.totalStorage); + jsonWriter.writeStringField("pricingModel", this.pricingModel == null ? null : this.pricingModel.toString()); + jsonWriter.writeStringField("fttRaidLevel", this.fttRaidLevel == null ? null : this.fttRaidLevel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvsEstimatedNode from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsEstimatedNode 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 AvsEstimatedNode. + */ + public static AvsEstimatedNode fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsEstimatedNode deserializedAvsEstimatedNode = new AvsEstimatedNode(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("monthlyPrice".equals(fieldName)) { + deserializedAvsEstimatedNode.monthlyPrice = reader.getNullable(JsonReader::getFloat); + } else if ("nodeType".equals(fieldName)) { + deserializedAvsEstimatedNode.nodeType = AzureAvsNodeType.fromString(reader.getString()); + } else if ("nodeNumber".equals(fieldName)) { + deserializedAvsEstimatedNode.nodeNumber = reader.getNullable(JsonReader::getInt); + } else if ("cpuUtilization".equals(fieldName)) { + deserializedAvsEstimatedNode.cpuUtilization = reader.getNullable(JsonReader::getFloat); + } else if ("ramUtilization".equals(fieldName)) { + deserializedAvsEstimatedNode.ramUtilization = reader.getNullable(JsonReader::getFloat); + } else if ("storageUtilization".equals(fieldName)) { + deserializedAvsEstimatedNode.storageUtilization = reader.getNullable(JsonReader::getFloat); + } else if ("totalCpu".equals(fieldName)) { + deserializedAvsEstimatedNode.totalCpu = reader.getNullable(JsonReader::getFloat); + } else if ("totalRam".equals(fieldName)) { + deserializedAvsEstimatedNode.totalRam = reader.getNullable(JsonReader::getFloat); + } else if ("totalStorage".equals(fieldName)) { + deserializedAvsEstimatedNode.totalStorage = reader.getNullable(JsonReader::getFloat); + } else if ("pricingModel".equals(fieldName)) { + deserializedAvsEstimatedNode.pricingModel = AzureReservedInstance.fromString(reader.getString()); + } else if ("fttRaidLevel".equals(fieldName)) { + deserializedAvsEstimatedNode.fttRaidLevel = FttAndRaidLevel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsEstimatedNode; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsGraphAssessmentOptions.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsGraphAssessmentOptions.java new file mode 100644 index 000000000000..5fdb7b42fd3a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsGraphAssessmentOptions.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsGraphAssessmentOptionsInner; + +/** + * An immutable client-side representation of AvsGraphAssessmentOptions. + */ +public interface AvsGraphAssessmentOptions { + /** + * 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. + */ + AvsGraphAssessmentOptionsProperties 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.migration.assessment.fluent.models.AvsGraphAssessmentOptionsInner + * object. + * + * @return the inner object. + */ + AvsGraphAssessmentOptionsInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsGraphAssessmentOptionsListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsGraphAssessmentOptionsListResult.java new file mode 100644 index 000000000000..ff73c19d223a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsGraphAssessmentOptionsListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AvsGraphAssessmentOptionsInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AvsGraphAssessmentOptions list operation. + */ +@Fluent +public final class AvsGraphAssessmentOptionsListResult + implements JsonSerializable { + /* + * The AvsGraphAssessmentOptions items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AvsGraphAssessmentOptionsListResult class. + */ + public AvsGraphAssessmentOptionsListResult() { + } + + /** + * Get the value property: The AvsGraphAssessmentOptions items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AvsGraphAssessmentOptions items on this page. + * + * @param value the value value to set. + * @return the AvsGraphAssessmentOptionsListResult object itself. + */ + public AvsGraphAssessmentOptionsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AvsGraphAssessmentOptionsListResult object itself. + */ + public AvsGraphAssessmentOptionsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 AvsGraphAssessmentOptionsListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AvsGraphAssessmentOptionsListResult.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 AvsGraphAssessmentOptionsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsGraphAssessmentOptionsListResult 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 AvsGraphAssessmentOptionsListResult. + */ + public static AvsGraphAssessmentOptionsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsGraphAssessmentOptionsListResult deserializedAvsGraphAssessmentOptionsListResult + = new AvsGraphAssessmentOptionsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AvsGraphAssessmentOptionsInner.fromJson(reader1)); + deserializedAvsGraphAssessmentOptionsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAvsGraphAssessmentOptionsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsGraphAssessmentOptionsListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsGraphAssessmentOptionsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsGraphAssessmentOptionsOperations.java new file mode 100644 index 000000000000..99a3c5e218fd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsGraphAssessmentOptionsOperations.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 AvsGraphAssessmentOptionsOperations. + */ +public interface AvsGraphAssessmentOptionsOperations { + /** + * List AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List AvsGraphAssessmentOptions 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 AvsGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + Context context); + + /** + * Get a AvsGraphAssessmentOptions. + * + * @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 AvsGraphAssessmentOptions along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, Context context); + + /** + * Get a AvsGraphAssessmentOptions. + * + * @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 AvsGraphAssessmentOptions. + */ + AvsGraphAssessmentOptions get(String resourceGroupName, String projectName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsGraphAssessmentOptionsProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsGraphAssessmentOptionsProperties.java new file mode 100644 index 000000000000..e86fd5bedb8d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsGraphAssessmentOptionsProperties.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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. + */ +@Fluent +public final class AvsGraphAssessmentOptionsProperties + implements JsonSerializable { + /* + * Gets or sets the edges. + */ + private Map edges; + + /** + * Creates an instance of AvsGraphAssessmentOptionsProperties class. + */ + public AvsGraphAssessmentOptionsProperties() { + } + + /** + * Get the edges property: Gets or sets the edges. + * + * @return the edges value. + */ + public Map edges() { + return this.edges; + } + + /** + * Set the edges property: Gets or sets the edges. + * + * @param edges the edges value to set. + * @return the AvsGraphAssessmentOptionsProperties object itself. + */ + public AvsGraphAssessmentOptionsProperties withEdges(Map edges) { + this.edges = edges; + return this; + } + + /** + * 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 AvsGraphAssessmentOptionsProperties")); + } else { + edges().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AvsGraphAssessmentOptionsProperties.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 AvsGraphAssessmentOptionsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsGraphAssessmentOptionsProperties 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 AvsGraphAssessmentOptionsProperties. + */ + public static AvsGraphAssessmentOptionsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsGraphAssessmentOptionsProperties deserializedAvsGraphAssessmentOptionsProperties + = new AvsGraphAssessmentOptionsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("edges".equals(fieldName)) { + Map edges + = reader.readMap(reader1 -> AvsAssessmentOptionsOutboundEdgeGroup.fromJson(reader1)); + deserializedAvsGraphAssessmentOptionsProperties.edges = edges; + } else { + reader.skipChildren(); + } + } + + return deserializedAvsGraphAssessmentOptionsProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsNodeSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsNodeSummary.java new file mode 100644 index 000000000000..b6e91fb2ab20 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsNodeSummary.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Azure Avs Node summary. + */ +@Immutable +public final class AvsNodeSummary implements JsonSerializable { + /* + * Servers suitable for migration. + */ + private Integer serversSuitableForMigration; + + /* + * The total number of servers. + */ + private Integer totalNumberOfServers; + + /* + * The total number of Avs VM cores. + */ + private Integer cores; + + /* + * The total memory in GB. + */ + private Float memoryGb; + + /* + * The on premises PaaS cost. + */ + private CostDetails avsNodeCostDetails; + + /* + * Estimated cost. + */ + private Float estimatedCost; + + /* + * OS licensing cost. + */ + private Float osLicensingCost; + + /* + * Estimated cost by offer. + */ + private List estimatedCostByRecommendedOffer; + + /* + * The recommended VM family summary. + */ + private List recommendedAvsNodeTypeSummary; + + /* + * Estimated External Storage + */ + private List estimatedExternalStorage; + + /* + * Estimated Network + */ + private List estimatedNetwork; + + /* + * Estimated Cost With VCF BYOL + */ + private Float estimatedCostWithVcfByol; + + /* + * Represents errors which might have occurred while calculating AVS Node Summary + */ + private List errors; + + /** + * Creates an instance of AvsNodeSummary class. + */ + public AvsNodeSummary() { + } + + /** + * Get the serversSuitableForMigration property: Servers suitable for migration. + * + * @return the serversSuitableForMigration value. + */ + public Integer serversSuitableForMigration() { + return this.serversSuitableForMigration; + } + + /** + * Get the totalNumberOfServers property: The total number of servers. + * + * @return the totalNumberOfServers value. + */ + public Integer totalNumberOfServers() { + return this.totalNumberOfServers; + } + + /** + * Get the cores property: The total number of Avs VM cores. + * + * @return the cores value. + */ + public Integer cores() { + return this.cores; + } + + /** + * Get the memoryGb property: The total memory in GB. + * + * @return the memoryGb value. + */ + public Float memoryGb() { + return this.memoryGb; + } + + /** + * Get the avsNodeCostDetails property: The on premises PaaS cost. + * + * @return the avsNodeCostDetails value. + */ + public CostDetails avsNodeCostDetails() { + return this.avsNodeCostDetails; + } + + /** + * Get the estimatedCost property: Estimated cost. + * + * @return the estimatedCost value. + */ + public Float estimatedCost() { + return this.estimatedCost; + } + + /** + * Get the osLicensingCost property: OS licensing cost. + * + * @return the osLicensingCost value. + */ + public Float osLicensingCost() { + return this.osLicensingCost; + } + + /** + * Get the estimatedCostByRecommendedOffer property: Estimated cost by offer. + * + * @return the estimatedCostByRecommendedOffer value. + */ + public List estimatedCostByRecommendedOffer() { + return this.estimatedCostByRecommendedOffer; + } + + /** + * Get the recommendedAvsNodeTypeSummary property: The recommended VM family summary. + * + * @return the recommendedAvsNodeTypeSummary value. + */ + public List recommendedAvsNodeTypeSummary() { + return this.recommendedAvsNodeTypeSummary; + } + + /** + * Get the estimatedExternalStorage property: Estimated External Storage. + * + * @return the estimatedExternalStorage value. + */ + public List estimatedExternalStorage() { + return this.estimatedExternalStorage; + } + + /** + * Get the estimatedNetwork property: Estimated Network. + * + * @return the estimatedNetwork value. + */ + public List estimatedNetwork() { + return this.estimatedNetwork; + } + + /** + * Get the estimatedCostWithVcfByol property: Estimated Cost With VCF BYOL. + * + * @return the estimatedCostWithVcfByol value. + */ + public Float estimatedCostWithVcfByol() { + return this.estimatedCostWithVcfByol; + } + + /** + * Get the errors property: Represents errors which might have occurred while calculating AVS Node Summary. + * + * @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 (avsNodeCostDetails() != null) { + avsNodeCostDetails().validate(); + } + if (estimatedCostByRecommendedOffer() != null) { + estimatedCostByRecommendedOffer().forEach(e -> e.validate()); + } + if (recommendedAvsNodeTypeSummary() != null) { + recommendedAvsNodeTypeSummary().forEach(e -> e.validate()); + } + if (estimatedExternalStorage() != null) { + estimatedExternalStorage().forEach(e -> e.validate()); + } + if (estimatedNetwork() != null) { + estimatedNetwork().forEach(e -> e.validate()); + } + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvsNodeSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsNodeSummary 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 AvsNodeSummary. + */ + public static AvsNodeSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsNodeSummary deserializedAvsNodeSummary = new AvsNodeSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serversSuitableForMigration".equals(fieldName)) { + deserializedAvsNodeSummary.serversSuitableForMigration = reader.getNullable(JsonReader::getInt); + } else if ("totalNumberOfServers".equals(fieldName)) { + deserializedAvsNodeSummary.totalNumberOfServers = reader.getNullable(JsonReader::getInt); + } else if ("cores".equals(fieldName)) { + deserializedAvsNodeSummary.cores = reader.getNullable(JsonReader::getInt); + } else if ("memoryGb".equals(fieldName)) { + deserializedAvsNodeSummary.memoryGb = reader.getNullable(JsonReader::getFloat); + } else if ("avsNodeCostDetails".equals(fieldName)) { + deserializedAvsNodeSummary.avsNodeCostDetails = CostDetails.fromJson(reader); + } else if ("estimatedCost".equals(fieldName)) { + deserializedAvsNodeSummary.estimatedCost = reader.getNullable(JsonReader::getFloat); + } else if ("osLicensingCost".equals(fieldName)) { + deserializedAvsNodeSummary.osLicensingCost = reader.getNullable(JsonReader::getFloat); + } else if ("estimatedCostByRecommendedOffer".equals(fieldName)) { + List estimatedCostByRecommendedOffer + = reader.readArray(reader1 -> EstimatedCostByOffer.fromJson(reader1)); + deserializedAvsNodeSummary.estimatedCostByRecommendedOffer = estimatedCostByRecommendedOffer; + } else if ("recommendedAvsNodeTypeSummary".equals(fieldName)) { + List recommendedAvsNodeTypeSummary + = reader.readArray(reader1 -> RecommendedAvsNodeTypeSummary.fromJson(reader1)); + deserializedAvsNodeSummary.recommendedAvsNodeTypeSummary = recommendedAvsNodeTypeSummary; + } else if ("estimatedExternalStorage".equals(fieldName)) { + List estimatedExternalStorage + = reader.readArray(reader1 -> EstimatedExternalStorage.fromJson(reader1)); + deserializedAvsNodeSummary.estimatedExternalStorage = estimatedExternalStorage; + } else if ("estimatedNetwork".equals(fieldName)) { + List estimatedNetwork + = reader.readArray(reader1 -> EstimatedNetwork.fromJson(reader1)); + deserializedAvsNodeSummary.estimatedNetwork = estimatedNetwork; + } else if ("estimatedCostWithVcfByol".equals(fieldName)) { + deserializedAvsNodeSummary.estimatedCostWithVcfByol = reader.getNullable(JsonReader::getFloat); + } else if ("errors".equals(fieldName)) { + List errors + = reader.readArray(reader1 -> ErrorDetailAutoGenerated.fromJson(reader1)); + deserializedAvsNodeSummary.errors = errors; + } else { + reader.skipChildren(); + } + } + + return deserializedAvsNodeSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsSkuOptions.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsSkuOptions.java deleted file mode 100644 index 926490834aaf..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsSkuOptions.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * AVS SKU specific options. - */ -@Fluent -public final class AvsSkuOptions implements JsonSerializable { - /* - * AVS Node type. - */ - private AzureAvsNodeType nodeType; - - /* - * List of locations where this node type is available. - */ - private List targetLocations; - - /** - * Creates an instance of AvsSkuOptions class. - */ - public AvsSkuOptions() { - } - - /** - * Get the nodeType property: AVS Node type. - * - * @return the nodeType value. - */ - public AzureAvsNodeType nodeType() { - return this.nodeType; - } - - /** - * Set the nodeType property: AVS Node type. - * - * @param nodeType the nodeType value to set. - * @return the AvsSkuOptions object itself. - */ - public AvsSkuOptions withNodeType(AzureAvsNodeType nodeType) { - this.nodeType = nodeType; - return this; - } - - /** - * Get the targetLocations property: List of locations where this node type is available. - * - * @return the targetLocations value. - */ - public List targetLocations() { - return this.targetLocations; - } - - /** - * Set the targetLocations property: List of locations where this node type is available. - * - * @param targetLocations the targetLocations value to set. - * @return the AvsSkuOptions object itself. - */ - public AvsSkuOptions withTargetLocations(List targetLocations) { - this.targetLocations = targetLocations; - 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("nodeType", this.nodeType == null ? null : this.nodeType.toString()); - jsonWriter.writeArrayField("targetLocations", this.targetLocations, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AvsSkuOptions from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AvsSkuOptions 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 AvsSkuOptions. - */ - public static AvsSkuOptions fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AvsSkuOptions deserializedAvsSkuOptions = new AvsSkuOptions(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nodeType".equals(fieldName)) { - deserializedAvsSkuOptions.nodeType = AzureAvsNodeType.fromString(reader.getString()); - } else if ("targetLocations".equals(fieldName)) { - List targetLocations - = reader.readArray(reader1 -> AzureLocation.fromString(reader1.getString())); - deserializedAvsSkuOptions.targetLocations = targetLocations; - } else { - reader.skipChildren(); - } - } - - return deserializedAvsSkuOptions; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsSummary.java new file mode 100644 index 000000000000..3d1764d0e137 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsSummary.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.AvsSummaryInner; + +/** + * An immutable client-side representation of AvsSummary. + */ +public interface AvsSummary { + /** + * 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. + */ + AvsSummaryProperties 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.migration.assessment.fluent.models.AvsSummaryInner object. + * + * @return the inner object. + */ + AvsSummaryInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsSummaryListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsSummaryListResult.java new file mode 100644 index 000000000000..beac62c73a91 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsSummaryListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.AvsSummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AvsSummary list operation. + */ +@Fluent +public final class AvsSummaryListResult implements JsonSerializable { + /* + * The AvsSummary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AvsSummaryListResult class. + */ + public AvsSummaryListResult() { + } + + /** + * Get the value property: The AvsSummary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AvsSummary items on this page. + * + * @param value the value value to set. + * @return the AvsSummaryListResult object itself. + */ + public AvsSummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AvsSummaryListResult object itself. + */ + public AvsSummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 AvsSummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AvsSummaryListResult.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 AvsSummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsSummaryListResult 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 AvsSummaryListResult. + */ + public static AvsSummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsSummaryListResult deserializedAvsSummaryListResult = new AvsSummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AvsSummaryInner.fromJson(reader1)); + deserializedAvsSummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAvsSummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsSummaryListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsSummaryProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsSummaryProperties.java new file mode 100644 index 000000000000..7718f53a0e63 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AvsSummaryProperties.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Avs summary properties class. + */ +@Immutable +public final class AvsSummaryProperties implements JsonSerializable { + /* + * The Azure Avs summary. + */ + private AzureAvsSummary azureAvsSummary; + + /* + * The on premises IaaS summary. + */ + private OnPremisesIaasSummary onPremisesAvsSummary; + + /** + * Creates an instance of AvsSummaryProperties class. + */ + public AvsSummaryProperties() { + } + + /** + * Get the azureAvsSummary property: The Azure Avs summary. + * + * @return the azureAvsSummary value. + */ + public AzureAvsSummary azureAvsSummary() { + return this.azureAvsSummary; + } + + /** + * Get the onPremisesAvsSummary property: The on premises IaaS summary. + * + * @return the onPremisesAvsSummary value. + */ + public OnPremisesIaasSummary onPremisesAvsSummary() { + return this.onPremisesAvsSummary; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureAvsSummary() != null) { + azureAvsSummary().validate(); + } + if (onPremisesAvsSummary() != null) { + onPremisesAvsSummary().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvsSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvsSummaryProperties 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 AvsSummaryProperties. + */ + public static AvsSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvsSummaryProperties deserializedAvsSummaryProperties = new AvsSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureAvsSummary".equals(fieldName)) { + deserializedAvsSummaryProperties.azureAvsSummary = AzureAvsSummary.fromJson(reader); + } else if ("onPremisesAvsSummary".equals(fieldName)) { + deserializedAvsSummaryProperties.onPremisesAvsSummary = OnPremisesIaasSummary.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAvsSummaryProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAppServiceContainerSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAppServiceContainerSummary.java new file mode 100644 index 000000000000..c4b226653217 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAppServiceContainerSummary.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Shows Azure App Service Container summary. + */ +@Immutable +public final class AzureAppServiceContainerSummary implements JsonSerializable { + /* + * Estimated cost by recommendation offer. + */ + private List estimatedCostByOffer; + + /* + * Distribution by SKU. + */ + private List distributionBySku; + + /* + * Distribution by application type. + */ + private List distributionByApp; + + /** + * Creates an instance of AzureAppServiceContainerSummary class. + */ + public AzureAppServiceContainerSummary() { + } + + /** + * Get the estimatedCostByOffer property: Estimated cost by recommendation offer. + * + * @return the estimatedCostByOffer value. + */ + public List estimatedCostByOffer() { + return this.estimatedCostByOffer; + } + + /** + * Get the distributionBySku property: Distribution by SKU. + * + * @return the distributionBySku value. + */ + public List distributionBySku() { + return this.distributionBySku; + } + + /** + * Get the distributionByApp property: Distribution by application type. + * + * @return the distributionByApp value. + */ + public List distributionByApp() { + return this.distributionByApp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (estimatedCostByOffer() != null) { + estimatedCostByOffer().forEach(e -> e.validate()); + } + if (distributionBySku() != null) { + distributionBySku().forEach(e -> e.validate()); + } + if (distributionByApp() != null) { + distributionByApp().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureAppServiceContainerSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureAppServiceContainerSummary 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 AzureAppServiceContainerSummary. + */ + public static AzureAppServiceContainerSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureAppServiceContainerSummary deserializedAzureAppServiceContainerSummary + = new AzureAppServiceContainerSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("estimatedCostByOffer".equals(fieldName)) { + List estimatedCostByOffer + = reader.readArray(reader1 -> EstimatedCostByOffer.fromJson(reader1)); + deserializedAzureAppServiceContainerSummary.estimatedCostByOffer = estimatedCostByOffer; + } else if ("distributionBySku".equals(fieldName)) { + List distributionBySku + = reader.readArray(reader1 -> WebAppTargetSku.fromJson(reader1)); + deserializedAzureAppServiceContainerSummary.distributionBySku = distributionBySku; + } else if ("distributionByApp".equals(fieldName)) { + List distributionByApp + = reader.readArray(reader1 -> WebAppDistribution.fromJson(reader1)); + deserializedAzureAppServiceContainerSummary.distributionByApp = distributionByApp; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureAppServiceContainerSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAppServiceSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAppServiceSummary.java new file mode 100644 index 000000000000..206749400e03 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAppServiceSummary.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Shows Azure App Service summary. + */ +@Immutable +public final class AzureAppServiceSummary implements JsonSerializable { + /* + * Estimated cost by recommendation offer. + */ + private List estimatedCostByOffer; + + /* + * Distribution by SKU. + */ + private List distributionBySku; + + /* + * Distribution by application type. + */ + private List distributionByApp; + + /** + * Creates an instance of AzureAppServiceSummary class. + */ + public AzureAppServiceSummary() { + } + + /** + * Get the estimatedCostByOffer property: Estimated cost by recommendation offer. + * + * @return the estimatedCostByOffer value. + */ + public List estimatedCostByOffer() { + return this.estimatedCostByOffer; + } + + /** + * Get the distributionBySku property: Distribution by SKU. + * + * @return the distributionBySku value. + */ + public List distributionBySku() { + return this.distributionBySku; + } + + /** + * Get the distributionByApp property: Distribution by application type. + * + * @return the distributionByApp value. + */ + public List distributionByApp() { + return this.distributionByApp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (estimatedCostByOffer() != null) { + estimatedCostByOffer().forEach(e -> e.validate()); + } + if (distributionBySku() != null) { + distributionBySku().forEach(e -> e.validate()); + } + if (distributionByApp() != null) { + distributionByApp().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureAppServiceSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureAppServiceSummary 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 AzureAppServiceSummary. + */ + public static AzureAppServiceSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureAppServiceSummary deserializedAzureAppServiceSummary = new AzureAppServiceSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("estimatedCostByOffer".equals(fieldName)) { + List estimatedCostByOffer + = reader.readArray(reader1 -> EstimatedCostByOffer.fromJson(reader1)); + deserializedAzureAppServiceSummary.estimatedCostByOffer = estimatedCostByOffer; + } else if ("distributionBySku".equals(fieldName)) { + List distributionBySku + = reader.readArray(reader1 -> AppServiceSku.fromJson(reader1)); + deserializedAzureAppServiceSummary.distributionBySku = distributionBySku; + } else if ("distributionByApp".equals(fieldName)) { + List distributionByApp + = reader.readArray(reader1 -> WebAppDistribution.fromJson(reader1)); + deserializedAzureAppServiceSummary.distributionByApp = distributionByApp; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureAppServiceSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureArcManagementSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureArcManagementSettings.java new file mode 100644 index 000000000000..fceaa4ff848f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureArcManagementSettings.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Azure Arc Management settings. + */ +@Fluent +public final class AzureArcManagementSettings implements JsonSerializable { + /* + * Gets the azure arc monitoring settings. + */ + private AzureArcMonitoringSettings monitoringSettings; + + /** + * Creates an instance of AzureArcManagementSettings class. + */ + public AzureArcManagementSettings() { + } + + /** + * Get the monitoringSettings property: Gets the azure arc monitoring settings. + * + * @return the monitoringSettings value. + */ + public AzureArcMonitoringSettings monitoringSettings() { + return this.monitoringSettings; + } + + /** + * Set the monitoringSettings property: Gets the azure arc monitoring settings. + * + * @param monitoringSettings the monitoringSettings value to set. + * @return the AzureArcManagementSettings object itself. + */ + public AzureArcManagementSettings withMonitoringSettings(AzureArcMonitoringSettings monitoringSettings) { + this.monitoringSettings = monitoringSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (monitoringSettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property monitoringSettings in model AzureArcManagementSettings")); + } else { + monitoringSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureArcManagementSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("monitoringSettings", this.monitoringSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureArcManagementSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureArcManagementSettings 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 AzureArcManagementSettings. + */ + public static AzureArcManagementSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureArcManagementSettings deserializedAzureArcManagementSettings = new AzureArcManagementSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("monitoringSettings".equals(fieldName)) { + deserializedAzureArcManagementSettings.monitoringSettings + = AzureArcMonitoringSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureArcManagementSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureArcMonitoringSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureArcMonitoringSettings.java new file mode 100644 index 000000000000..9b2e422eb50f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureArcMonitoringSettings.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Azure Arc Monitoring settings. + */ +@Fluent +public final class AzureArcMonitoringSettings implements JsonSerializable { + /* + * Logs volume settings. + */ + private float logsVolumeInGB; + + /* + * Number of alert rules settings. + */ + private int alertRulesCount; + + /** + * Creates an instance of AzureArcMonitoringSettings class. + */ + public AzureArcMonitoringSettings() { + } + + /** + * Get the logsVolumeInGB property: Logs volume settings. + * + * @return the logsVolumeInGB value. + */ + public float logsVolumeInGB() { + return this.logsVolumeInGB; + } + + /** + * Set the logsVolumeInGB property: Logs volume settings. + * + * @param logsVolumeInGB the logsVolumeInGB value to set. + * @return the AzureArcMonitoringSettings object itself. + */ + public AzureArcMonitoringSettings withLogsVolumeInGB(float logsVolumeInGB) { + this.logsVolumeInGB = logsVolumeInGB; + return this; + } + + /** + * Get the alertRulesCount property: Number of alert rules settings. + * + * @return the alertRulesCount value. + */ + public int alertRulesCount() { + return this.alertRulesCount; + } + + /** + * Set the alertRulesCount property: Number of alert rules settings. + * + * @param alertRulesCount the alertRulesCount value to set. + * @return the AzureArcMonitoringSettings object itself. + */ + public AzureArcMonitoringSettings withAlertRulesCount(int alertRulesCount) { + this.alertRulesCount = alertRulesCount; + 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.writeFloatField("logsVolumeInGB", this.logsVolumeInGB); + jsonWriter.writeIntField("alertRulesCount", this.alertRulesCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureArcMonitoringSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureArcMonitoringSettings 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 AzureArcMonitoringSettings. + */ + public static AzureArcMonitoringSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureArcMonitoringSettings deserializedAzureArcMonitoringSettings = new AzureArcMonitoringSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logsVolumeInGB".equals(fieldName)) { + deserializedAzureArcMonitoringSettings.logsVolumeInGB = reader.getFloat(); + } else if ("alertRulesCount".equals(fieldName)) { + deserializedAzureArcMonitoringSettings.alertRulesCount = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureArcMonitoringSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureArcSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureArcSettings.java new file mode 100644 index 000000000000..c30d5cb8b069 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureArcSettings.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Azure arc settings for a business case. + */ +@Fluent +public final class AzureArcSettings implements JsonSerializable { + /* + * AzureArc state indicates whether to include azure arc related costs in on-premises or not. + */ + private AzureArcState azureArcState; + + /* + * Gets Azure arc labour cost percentage. + */ + private Float laborCostPercentage; + + /* + * Management settings. + */ + private AzureArcManagementSettings managementSettings; + + /** + * Creates an instance of AzureArcSettings class. + */ + public AzureArcSettings() { + } + + /** + * Get the azureArcState property: AzureArc state indicates whether to include azure arc related costs in + * on-premises or not. + * + * @return the azureArcState value. + */ + public AzureArcState azureArcState() { + return this.azureArcState; + } + + /** + * Set the azureArcState property: AzureArc state indicates whether to include azure arc related costs in + * on-premises or not. + * + * @param azureArcState the azureArcState value to set. + * @return the AzureArcSettings object itself. + */ + public AzureArcSettings withAzureArcState(AzureArcState azureArcState) { + this.azureArcState = azureArcState; + return this; + } + + /** + * Get the laborCostPercentage property: Gets Azure arc labour cost percentage. + * + * @return the laborCostPercentage value. + */ + public Float laborCostPercentage() { + return this.laborCostPercentage; + } + + /** + * Set the laborCostPercentage property: Gets Azure arc labour cost percentage. + * + * @param laborCostPercentage the laborCostPercentage value to set. + * @return the AzureArcSettings object itself. + */ + public AzureArcSettings withLaborCostPercentage(Float laborCostPercentage) { + this.laborCostPercentage = laborCostPercentage; + return this; + } + + /** + * Get the managementSettings property: Management settings. + * + * @return the managementSettings value. + */ + public AzureArcManagementSettings managementSettings() { + return this.managementSettings; + } + + /** + * Set the managementSettings property: Management settings. + * + * @param managementSettings the managementSettings value to set. + * @return the AzureArcSettings object itself. + */ + public AzureArcSettings withManagementSettings(AzureArcManagementSettings managementSettings) { + this.managementSettings = managementSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureArcState() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property azureArcState in model AzureArcSettings")); + } + if (managementSettings() != null) { + managementSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureArcSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("azureArcState", this.azureArcState == null ? null : this.azureArcState.toString()); + jsonWriter.writeNumberField("laborCostPercentage", this.laborCostPercentage); + jsonWriter.writeJsonField("managementSettings", this.managementSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureArcSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureArcSettings 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 AzureArcSettings. + */ + public static AzureArcSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureArcSettings deserializedAzureArcSettings = new AzureArcSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureArcState".equals(fieldName)) { + deserializedAzureArcSettings.azureArcState = AzureArcState.fromString(reader.getString()); + } else if ("laborCostPercentage".equals(fieldName)) { + deserializedAzureArcSettings.laborCostPercentage = reader.getNullable(JsonReader::getFloat); + } else if ("managementSettings".equals(fieldName)) { + deserializedAzureArcSettings.managementSettings = AzureArcManagementSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureArcSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureArcState.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureArcState.java new file mode 100644 index 000000000000..a79758ad250c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureArcState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AzureArc state values. + */ +public final class AzureArcState extends ExpandableStringEnum { + /** + * Static value Disabled for AzureArcState. + */ + public static final AzureArcState DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for AzureArcState. + */ + public static final AzureArcState ENABLED = fromString("Enabled"); + + /** + * Static value Unknown for AzureArcState. + */ + public static final AzureArcState UNKNOWN = fromString("Unknown"); + + /** + * Creates a new instance of AzureArcState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureArcState() { + } + + /** + * Creates or finds a AzureArcState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureArcState. + */ + public static AzureArcState fromString(String name) { + return fromString(name, AzureArcState.class); + } + + /** + * Gets known AzureArcState values. + * + * @return known AzureArcState values. + */ + public static Collection values() { + return values(AzureArcState.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAvsNodeType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAvsNodeType.java index 2e2c7b58a5da..f7d32c3d8ee1 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAvsNodeType.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAvsNodeType.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for AzureAvsNodeType. + * Azure AVS Node type. */ public final class AzureAvsNodeType extends ExpandableStringEnum { /** @@ -21,6 +21,21 @@ public final class AzureAvsNodeType extends ExpandableStringEnum { /** @@ -27,6 +27,18 @@ public final class AzureAvsSuitabilityExplanation extends ExpandableStringEnum { + /* + * Shows the year-on-year cost overall. + */ + private YearOnYearEstimates yearOnYearEstimates; + + /* + * Avs virtual machine summary. + */ + private AvsNodeSummary avsNodeSummary; + + /* + * The on premises PaaS cost. + */ + private CostDetails avsCostDetails; + + /* + * The AVS Azure Sustainability Details. + */ + private CarbonEmissionsDetails azureAvsSustainabilityDetails; + + /** + * Creates an instance of AzureAvsSummary class. + */ + public AzureAvsSummary() { + } + + /** + * Get the yearOnYearEstimates property: Shows the year-on-year cost overall. + * + * @return the yearOnYearEstimates value. + */ + public YearOnYearEstimates yearOnYearEstimates() { + return this.yearOnYearEstimates; + } + + /** + * Get the avsNodeSummary property: Avs virtual machine summary. + * + * @return the avsNodeSummary value. + */ + public AvsNodeSummary avsNodeSummary() { + return this.avsNodeSummary; + } + + /** + * Get the avsCostDetails property: The on premises PaaS cost. + * + * @return the avsCostDetails value. + */ + public CostDetails avsCostDetails() { + return this.avsCostDetails; + } + + /** + * Get the azureAvsSustainabilityDetails property: The AVS Azure Sustainability Details. + * + * @return the azureAvsSustainabilityDetails value. + */ + public CarbonEmissionsDetails azureAvsSustainabilityDetails() { + return this.azureAvsSustainabilityDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (yearOnYearEstimates() != null) { + yearOnYearEstimates().validate(); + } + if (avsNodeSummary() != null) { + avsNodeSummary().validate(); + } + if (avsCostDetails() != null) { + avsCostDetails().validate(); + } + if (azureAvsSustainabilityDetails() != null) { + azureAvsSustainabilityDetails().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureAvsSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureAvsSummary 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 AzureAvsSummary. + */ + public static AzureAvsSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureAvsSummary deserializedAzureAvsSummary = new AzureAvsSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("yearOnYearEstimates".equals(fieldName)) { + deserializedAzureAvsSummary.yearOnYearEstimates = YearOnYearEstimates.fromJson(reader); + } else if ("avsNodeSummary".equals(fieldName)) { + deserializedAzureAvsSummary.avsNodeSummary = AvsNodeSummary.fromJson(reader); + } else if ("avsCostDetails".equals(fieldName)) { + deserializedAzureAvsSummary.avsCostDetails = CostDetails.fromJson(reader); + } else if ("azureAvsSustainabilityDetails".equals(fieldName)) { + deserializedAzureAvsSummary.azureAvsSustainabilityDetails = CarbonEmissionsDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureAvsSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAvsVmSuitabilityDetail.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAvsVmSuitabilityDetail.java deleted file mode 100644 index 7fb4f058cead..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAvsVmSuitabilityDetail.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AzureAvsVmSuitabilityDetail. - */ -public final class AzureAvsVmSuitabilityDetail extends ExpandableStringEnum { - /** - * Static value None for AzureAvsVmSuitabilityDetail. - */ - public static final AzureAvsVmSuitabilityDetail NONE = fromString("None"); - - /** - * Static value PercentageOfCoresUtilizedMissing for AzureAvsVmSuitabilityDetail. - */ - public static final AzureAvsVmSuitabilityDetail PERCENTAGE_OF_CORES_UTILIZED_MISSING - = fromString("PercentageOfCoresUtilizedMissing"); - - /** - * Static value PercentageOfMemoryUtilizedMissing for AzureAvsVmSuitabilityDetail. - */ - public static final AzureAvsVmSuitabilityDetail PERCENTAGE_OF_MEMORY_UTILIZED_MISSING - = fromString("PercentageOfMemoryUtilizedMissing"); - - /** - * Static value PercentageOfCoresUtilizedOutOfRange for AzureAvsVmSuitabilityDetail. - */ - public static final AzureAvsVmSuitabilityDetail PERCENTAGE_OF_CORES_UTILIZED_OUT_OF_RANGE - = fromString("PercentageOfCoresUtilizedOutOfRange"); - - /** - * Static value PercentageOfMemoryUtilizedOutOfRange for AzureAvsVmSuitabilityDetail. - */ - public static final AzureAvsVmSuitabilityDetail PERCENTAGE_OF_MEMORY_UTILIZED_OUT_OF_RANGE - = fromString("PercentageOfMemoryUtilizedOutOfRange"); - - /** - * Static value PercentageOfStorageUtilizedOutOfRange for AzureAvsVmSuitabilityDetail. - */ - public static final AzureAvsVmSuitabilityDetail PERCENTAGE_OF_STORAGE_UTILIZED_OUT_OF_RANGE - = fromString("PercentageOfStorageUtilizedOutOfRange"); - - /** - * Creates a new instance of AzureAvsVmSuitabilityDetail value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AzureAvsVmSuitabilityDetail() { - } - - /** - * Creates or finds a AzureAvsVmSuitabilityDetail from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureAvsVmSuitabilityDetail. - */ - public static AzureAvsVmSuitabilityDetail fromString(String name) { - return fromString(name, AzureAvsVmSuitabilityDetail.class); - } - - /** - * Gets known AzureAvsVmSuitabilityDetail values. - * - * @return known AzureAvsVmSuitabilityDetail values. - */ - public static Collection values() { - return values(AzureAvsVmSuitabilityDetail.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAvsVmSuitabilityExplanation.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAvsVmSuitabilityExplanation.java deleted file mode 100644 index 49725c4a825e..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureAvsVmSuitabilityExplanation.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AzureAvsVmSuitabilityExplanation. - */ -public final class AzureAvsVmSuitabilityExplanation extends ExpandableStringEnum { - /** - * Static value Unknown for AzureAvsVmSuitabilityExplanation. - */ - public static final AzureAvsVmSuitabilityExplanation UNKNOWN = fromString("Unknown"); - - /** - * Static value NotApplicable for AzureAvsVmSuitabilityExplanation. - */ - public static final AzureAvsVmSuitabilityExplanation NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Static value IpV6NotSupported for AzureAvsVmSuitabilityExplanation. - */ - public static final AzureAvsVmSuitabilityExplanation IP_V6NOT_SUPPORTED = fromString("IpV6NotSupported"); - - /** - * Static value UnsupportedOperatingSystem for AzureAvsVmSuitabilityExplanation. - */ - public static final AzureAvsVmSuitabilityExplanation UNSUPPORTED_OPERATING_SYSTEM - = fromString("UnsupportedOperatingSystem"); - - /** - * Creates a new instance of AzureAvsVmSuitabilityExplanation value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AzureAvsVmSuitabilityExplanation() { - } - - /** - * Creates or finds a AzureAvsVmSuitabilityExplanation from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureAvsVmSuitabilityExplanation. - */ - public static AzureAvsVmSuitabilityExplanation fromString(String name) { - return fromString(name, AzureAvsVmSuitabilityExplanation.class); - } - - /** - * Gets known AzureAvsVmSuitabilityExplanation values. - * - * @return known AzureAvsVmSuitabilityExplanation values. - */ - public static Collection values() { - return values(AzureAvsVmSuitabilityExplanation.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureDiskSize.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureDiskSize.java deleted file mode 100644 index 63e37894d6c8..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureDiskSize.java +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AzureDiskSize. - */ -public final class AzureDiskSize extends ExpandableStringEnum { - /** - * Static value Unknown for AzureDiskSize. - */ - public static final AzureDiskSize UNKNOWN = fromString("Unknown"); - - /** - * Static value Standard_S4 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_S4 = fromString("Standard_S4"); - - /** - * Static value Standard_S6 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_S6 = fromString("Standard_S6"); - - /** - * Static value Standard_S10 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_S10 = fromString("Standard_S10"); - - /** - * Static value Standard_S15 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_S15 = fromString("Standard_S15"); - - /** - * Static value Standard_S20 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_S20 = fromString("Standard_S20"); - - /** - * Static value Standard_S30 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_S30 = fromString("Standard_S30"); - - /** - * Static value Standard_S40 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_S40 = fromString("Standard_S40"); - - /** - * Static value Standard_S50 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_S50 = fromString("Standard_S50"); - - /** - * Static value Standard_S60 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_S60 = fromString("Standard_S60"); - - /** - * Static value Standard_S70 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_S70 = fromString("Standard_S70"); - - /** - * Static value Standard_S80 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_S80 = fromString("Standard_S80"); - - /** - * Static value Premium_P4 for AzureDiskSize. - */ - public static final AzureDiskSize PREMIUM_P4 = fromString("Premium_P4"); - - /** - * Static value Premium_P6 for AzureDiskSize. - */ - public static final AzureDiskSize PREMIUM_P6 = fromString("Premium_P6"); - - /** - * Static value Premium_P10 for AzureDiskSize. - */ - public static final AzureDiskSize PREMIUM_P10 = fromString("Premium_P10"); - - /** - * Static value Premium_P15 for AzureDiskSize. - */ - public static final AzureDiskSize PREMIUM_P15 = fromString("Premium_P15"); - - /** - * Static value Premium_P20 for AzureDiskSize. - */ - public static final AzureDiskSize PREMIUM_P20 = fromString("Premium_P20"); - - /** - * Static value Premium_P30 for AzureDiskSize. - */ - public static final AzureDiskSize PREMIUM_P30 = fromString("Premium_P30"); - - /** - * Static value Premium_P40 for AzureDiskSize. - */ - public static final AzureDiskSize PREMIUM_P40 = fromString("Premium_P40"); - - /** - * Static value Premium_P50 for AzureDiskSize. - */ - public static final AzureDiskSize PREMIUM_P50 = fromString("Premium_P50"); - - /** - * Static value Premium_P60 for AzureDiskSize. - */ - public static final AzureDiskSize PREMIUM_P60 = fromString("Premium_P60"); - - /** - * Static value Premium_P70 for AzureDiskSize. - */ - public static final AzureDiskSize PREMIUM_P70 = fromString("Premium_P70"); - - /** - * Static value Premium_P80 for AzureDiskSize. - */ - public static final AzureDiskSize PREMIUM_P80 = fromString("Premium_P80"); - - /** - * Static value StandardSSD_E10 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_SSD_E10 = fromString("StandardSSD_E10"); - - /** - * Static value StandardSSD_E15 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_SSD_E15 = fromString("StandardSSD_E15"); - - /** - * Static value StandardSSD_E20 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_SSD_E20 = fromString("StandardSSD_E20"); - - /** - * Static value StandardSSD_E30 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_SSD_E30 = fromString("StandardSSD_E30"); - - /** - * Static value StandardSSD_E40 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_SSD_E40 = fromString("StandardSSD_E40"); - - /** - * Static value StandardSSD_E50 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_SSD_E50 = fromString("StandardSSD_E50"); - - /** - * Static value StandardSSD_E60 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_SSD_E60 = fromString("StandardSSD_E60"); - - /** - * Static value StandardSSD_E70 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_SSD_E70 = fromString("StandardSSD_E70"); - - /** - * Static value StandardSSD_E80 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_SSD_E80 = fromString("StandardSSD_E80"); - - /** - * Static value StandardSSD_E4 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_SSD_E4 = fromString("StandardSSD_E4"); - - /** - * Static value StandardSSD_E6 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_SSD_E6 = fromString("StandardSSD_E6"); - - /** - * Static value StandardSSD_E1 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_SSD_E1 = fromString("StandardSSD_E1"); - - /** - * Static value StandardSSD_E2 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_SSD_E2 = fromString("StandardSSD_E2"); - - /** - * Static value StandardSSD_E3 for AzureDiskSize. - */ - public static final AzureDiskSize STANDARD_SSD_E3 = fromString("StandardSSD_E3"); - - /** - * Static value Premium_P1 for AzureDiskSize. - */ - public static final AzureDiskSize PREMIUM_P1 = fromString("Premium_P1"); - - /** - * Static value Premium_P2 for AzureDiskSize. - */ - public static final AzureDiskSize PREMIUM_P2 = fromString("Premium_P2"); - - /** - * Static value Premium_P3 for AzureDiskSize. - */ - public static final AzureDiskSize PREMIUM_P3 = fromString("Premium_P3"); - - /** - * Static value Ultra for AzureDiskSize. - */ - public static final AzureDiskSize ULTRA = fromString("Ultra"); - - /** - * Static value PremiumV2 for AzureDiskSize. - */ - public static final AzureDiskSize PREMIUM_V2 = fromString("PremiumV2"); - - /** - * Creates a new instance of AzureDiskSize value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AzureDiskSize() { - } - - /** - * Creates or finds a AzureDiskSize from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureDiskSize. - */ - public static AzureDiskSize fromString(String name) { - return fromString(name, AzureDiskSize.class); - } - - /** - * Gets known AzureDiskSize values. - * - * @return known AzureDiskSize values. - */ - public static Collection values() { - return values(AzureDiskSize.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureDiskSuitabilityDetail.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureDiskSuitabilityDetail.java deleted file mode 100644 index 50455f760acb..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureDiskSuitabilityDetail.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AzureDiskSuitabilityDetail. - */ -public final class AzureDiskSuitabilityDetail extends ExpandableStringEnum { - /** - * Static value None for AzureDiskSuitabilityDetail. - */ - public static final AzureDiskSuitabilityDetail NONE = fromString("None"); - - /** - * Static value NumberOfReadOperationsPerSecondMissing for AzureDiskSuitabilityDetail. - */ - public static final AzureDiskSuitabilityDetail NUMBER_OF_READ_OPERATIONS_PER_SECOND_MISSING - = fromString("NumberOfReadOperationsPerSecondMissing"); - - /** - * Static value NumberOfWriteOperationsPerSecondMissing for AzureDiskSuitabilityDetail. - */ - public static final AzureDiskSuitabilityDetail NUMBER_OF_WRITE_OPERATIONS_PER_SECOND_MISSING - = fromString("NumberOfWriteOperationsPerSecondMissing"); - - /** - * Static value MegabytesPerSecondOfReadMissing for AzureDiskSuitabilityDetail. - */ - public static final AzureDiskSuitabilityDetail MEGABYTES_PER_SECOND_OF_READ_MISSING - = fromString("MegabytesPerSecondOfReadMissing"); - - /** - * Static value MegabytesPerSecondOfWriteMissing for AzureDiskSuitabilityDetail. - */ - public static final AzureDiskSuitabilityDetail MEGABYTES_PER_SECOND_OF_WRITE_MISSING - = fromString("MegabytesPerSecondOfWriteMissing"); - - /** - * Static value DiskGigabytesConsumedMissing for AzureDiskSuitabilityDetail. - */ - public static final AzureDiskSuitabilityDetail DISK_GIGABYTES_CONSUMED_MISSING - = fromString("DiskGigabytesConsumedMissing"); - - /** - * Static value DiskGigabytesProvisionedMissing for AzureDiskSuitabilityDetail. - */ - public static final AzureDiskSuitabilityDetail DISK_GIGABYTES_PROVISIONED_MISSING - = fromString("DiskGigabytesProvisionedMissing"); - - /** - * Static value NumberOfReadOperationsPerSecondOutOfRange for AzureDiskSuitabilityDetail. - */ - public static final AzureDiskSuitabilityDetail NUMBER_OF_READ_OPERATIONS_PER_SECOND_OUT_OF_RANGE - = fromString("NumberOfReadOperationsPerSecondOutOfRange"); - - /** - * Static value NumberOfWriteOperationsPerSecondOutOfRange for AzureDiskSuitabilityDetail. - */ - public static final AzureDiskSuitabilityDetail NUMBER_OF_WRITE_OPERATIONS_PER_SECOND_OUT_OF_RANGE - = fromString("NumberOfWriteOperationsPerSecondOutOfRange"); - - /** - * Static value MegabytesPerSecondOfReadOutOfRange for AzureDiskSuitabilityDetail. - */ - public static final AzureDiskSuitabilityDetail MEGABYTES_PER_SECOND_OF_READ_OUT_OF_RANGE - = fromString("MegabytesPerSecondOfReadOutOfRange"); - - /** - * Static value MegabytesPerSecondOfWriteOutOfRange for AzureDiskSuitabilityDetail. - */ - public static final AzureDiskSuitabilityDetail MEGABYTES_PER_SECOND_OF_WRITE_OUT_OF_RANGE - = fromString("MegabytesPerSecondOfWriteOutOfRange"); - - /** - * Static value DiskGigabytesConsumedOutOfRange for AzureDiskSuitabilityDetail. - */ - public static final AzureDiskSuitabilityDetail DISK_GIGABYTES_CONSUMED_OUT_OF_RANGE - = fromString("DiskGigabytesConsumedOutOfRange"); - - /** - * Static value DiskGigabytesProvisionedOutOfRange for AzureDiskSuitabilityDetail. - */ - public static final AzureDiskSuitabilityDetail DISK_GIGABYTES_PROVISIONED_OUT_OF_RANGE - = fromString("DiskGigabytesProvisionedOutOfRange"); - - /** - * Creates a new instance of AzureDiskSuitabilityDetail value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AzureDiskSuitabilityDetail() { - } - - /** - * Creates or finds a AzureDiskSuitabilityDetail from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureDiskSuitabilityDetail. - */ - public static AzureDiskSuitabilityDetail fromString(String name) { - return fromString(name, AzureDiskSuitabilityDetail.class); - } - - /** - * Gets known AzureDiskSuitabilityDetail values. - * - * @return known AzureDiskSuitabilityDetail values. - */ - public static Collection values() { - return values(AzureDiskSuitabilityDetail.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureDiskSuitabilityExplanation.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureDiskSuitabilityExplanation.java deleted file mode 100644 index f551ecb0c842..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureDiskSuitabilityExplanation.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AzureDiskSuitabilityExplanation. - */ -public final class AzureDiskSuitabilityExplanation extends ExpandableStringEnum { - /** - * Static value Unknown for AzureDiskSuitabilityExplanation. - */ - public static final AzureDiskSuitabilityExplanation UNKNOWN = fromString("Unknown"); - - /** - * Static value NotApplicable for AzureDiskSuitabilityExplanation. - */ - public static final AzureDiskSuitabilityExplanation NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Static value DiskSizeGreaterThanSupported for AzureDiskSuitabilityExplanation. - */ - public static final AzureDiskSuitabilityExplanation DISK_SIZE_GREATER_THAN_SUPPORTED - = fromString("DiskSizeGreaterThanSupported"); - - /** - * Static value NoSuitableDiskSizeForIops for AzureDiskSuitabilityExplanation. - */ - public static final AzureDiskSuitabilityExplanation NO_SUITABLE_DISK_SIZE_FOR_IOPS - = fromString("NoSuitableDiskSizeForIops"); - - /** - * Static value NoSuitableDiskSizeForThroughput for AzureDiskSuitabilityExplanation. - */ - public static final AzureDiskSuitabilityExplanation NO_SUITABLE_DISK_SIZE_FOR_THROUGHPUT - = fromString("NoSuitableDiskSizeForThroughput"); - - /** - * Static value NoDiskSizeFoundInSelectedLocation for AzureDiskSuitabilityExplanation. - */ - public static final AzureDiskSuitabilityExplanation NO_DISK_SIZE_FOUND_IN_SELECTED_LOCATION - = fromString("NoDiskSizeFoundInSelectedLocation"); - - /** - * Static value NoDiskSizeFoundForSelectedRedundancy for AzureDiskSuitabilityExplanation. - */ - public static final AzureDiskSuitabilityExplanation NO_DISK_SIZE_FOUND_FOR_SELECTED_REDUNDANCY - = fromString("NoDiskSizeFoundForSelectedRedundancy"); - - /** - * Static value InternalErrorOccurredForDiskEvaluation for AzureDiskSuitabilityExplanation. - */ - public static final AzureDiskSuitabilityExplanation INTERNAL_ERROR_OCCURRED_FOR_DISK_EVALUATION - = fromString("InternalErrorOccurredForDiskEvaluation"); - - /** - * Static value NoEaPriceFoundForDiskSize for AzureDiskSuitabilityExplanation. - */ - public static final AzureDiskSuitabilityExplanation NO_EA_PRICE_FOUND_FOR_DISK_SIZE - = fromString("NoEaPriceFoundForDiskSize"); - - /** - * Creates a new instance of AzureDiskSuitabilityExplanation value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AzureDiskSuitabilityExplanation() { - } - - /** - * Creates or finds a AzureDiskSuitabilityExplanation from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureDiskSuitabilityExplanation. - */ - public static AzureDiskSuitabilityExplanation fromString(String name) { - return fromString(name, AzureDiskSuitabilityExplanation.class); - } - - /** - * Gets known AzureDiskSuitabilityExplanation values. - * - * @return known AzureDiskSuitabilityExplanation values. - */ - public static Collection values() { - return values(AzureDiskSuitabilityExplanation.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureDiskType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureDiskType.java index 847ab83d9d52..61e4afd403a7 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureDiskType.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureDiskType.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for AzureDiskType. + * Azure Disk Type. */ public final class AzureDiskType extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureHybridUseBenefit.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureHybridUseBenefit.java index 4b20e08874ca..dfadb2dab929 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureHybridUseBenefit.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureHybridUseBenefit.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for AzureHybridUseBenefit. + * Azure Hybrid Use Benefit. */ public final class AzureHybridUseBenefit extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureIaasSqlSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureIaasSqlSummary.java new file mode 100644 index 000000000000..c449bd65dcb8 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureIaasSqlSummary.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Azure Iaas sql server summary. + */ +@Immutable +public final class AzureIaasSqlSummary implements JsonSerializable { + /* + * Total SQL entities. + */ + private Integer totalSqlEntities; + + /* + * Suitable SQL entities. + */ + private Integer suitableSqlEntities; + + /* + * The on premises PaaS cost. + */ + private CostDetails azureSqlCostDetails; + + /* + * Estimated cost. + */ + private Float estimatedCost; + + /* + * OS licensing cost. + */ + private Float osLicensingCost; + + /* + * Estimated cost by offer. + */ + private List estimatedCostByRecommendedOffer; + + /* + * The recommended VM family summary. + */ + private List recommendedVmFamilySummary; + + /* + * The cost by storage type. + */ + private List costByStorageType; + + /** + * Creates an instance of AzureIaasSqlSummary class. + */ + public AzureIaasSqlSummary() { + } + + /** + * Get the totalSqlEntities property: Total SQL entities. + * + * @return the totalSqlEntities value. + */ + public Integer totalSqlEntities() { + return this.totalSqlEntities; + } + + /** + * Get the suitableSqlEntities property: Suitable SQL entities. + * + * @return the suitableSqlEntities value. + */ + public Integer suitableSqlEntities() { + return this.suitableSqlEntities; + } + + /** + * Get the azureSqlCostDetails property: The on premises PaaS cost. + * + * @return the azureSqlCostDetails value. + */ + public CostDetails azureSqlCostDetails() { + return this.azureSqlCostDetails; + } + + /** + * Get the estimatedCost property: Estimated cost. + * + * @return the estimatedCost value. + */ + public Float estimatedCost() { + return this.estimatedCost; + } + + /** + * Get the osLicensingCost property: OS licensing cost. + * + * @return the osLicensingCost value. + */ + public Float osLicensingCost() { + return this.osLicensingCost; + } + + /** + * Get the estimatedCostByRecommendedOffer property: Estimated cost by offer. + * + * @return the estimatedCostByRecommendedOffer value. + */ + public List estimatedCostByRecommendedOffer() { + return this.estimatedCostByRecommendedOffer; + } + + /** + * Get the recommendedVmFamilySummary property: The recommended VM family summary. + * + * @return the recommendedVmFamilySummary value. + */ + public List recommendedVmFamilySummary() { + return this.recommendedVmFamilySummary; + } + + /** + * Get the costByStorageType property: The cost by storage type. + * + * @return the costByStorageType value. + */ + public List costByStorageType() { + return this.costByStorageType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureSqlCostDetails() != null) { + azureSqlCostDetails().validate(); + } + if (estimatedCostByRecommendedOffer() != null) { + estimatedCostByRecommendedOffer().forEach(e -> e.validate()); + } + if (recommendedVmFamilySummary() != null) { + recommendedVmFamilySummary().forEach(e -> e.validate()); + } + if (costByStorageType() != null) { + costByStorageType().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureIaasSqlSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureIaasSqlSummary 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 AzureIaasSqlSummary. + */ + public static AzureIaasSqlSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureIaasSqlSummary deserializedAzureIaasSqlSummary = new AzureIaasSqlSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalSqlEntities".equals(fieldName)) { + deserializedAzureIaasSqlSummary.totalSqlEntities = reader.getNullable(JsonReader::getInt); + } else if ("suitableSqlEntities".equals(fieldName)) { + deserializedAzureIaasSqlSummary.suitableSqlEntities = reader.getNullable(JsonReader::getInt); + } else if ("azureSqlCostDetails".equals(fieldName)) { + deserializedAzureIaasSqlSummary.azureSqlCostDetails = CostDetails.fromJson(reader); + } else if ("estimatedCost".equals(fieldName)) { + deserializedAzureIaasSqlSummary.estimatedCost = reader.getNullable(JsonReader::getFloat); + } else if ("osLicensingCost".equals(fieldName)) { + deserializedAzureIaasSqlSummary.osLicensingCost = reader.getNullable(JsonReader::getFloat); + } else if ("estimatedCostByRecommendedOffer".equals(fieldName)) { + List estimatedCostByRecommendedOffer + = reader.readArray(reader1 -> EstimatedCostByOffer.fromJson(reader1)); + deserializedAzureIaasSqlSummary.estimatedCostByRecommendedOffer = estimatedCostByRecommendedOffer; + } else if ("recommendedVmFamilySummary".equals(fieldName)) { + List recommendedVmFamilySummary + = reader.readArray(reader1 -> RecommendedVmFamilySummary.fromJson(reader1)); + deserializedAzureIaasSqlSummary.recommendedVmFamilySummary = recommendedVmFamilySummary; + } else if ("costByStorageType".equals(fieldName)) { + List costByStorageType + = reader.readArray(reader1 -> CostByStorageType.fromJson(reader1)); + deserializedAzureIaasSqlSummary.costByStorageType = costByStorageType; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureIaasSqlSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureIaasSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureIaasSummary.java new file mode 100644 index 000000000000..1ca740350b35 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureIaasSummary.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 Azure IaaS summary. + */ +@Immutable +public final class AzureIaasSummary implements JsonSerializable { + /* + * Shows the year-on-year cost overall. + */ + private YearOnYearEstimates yearOnYearEstimates; + + /* + * Azure Iaas virtual machine summary. + */ + private AzureIaasVmSummary azureIaasVmSummary; + + /* + * Azure Iaas sql server summary. + */ + private AzureIaasSqlSummary azureIaasSqlSummary; + + /* + * The on premises PaaS cost. + */ + private CostDetails azureIaasCostDetails; + + /* + * The azure Iaas sustainability details. + */ + private CarbonEmissionsDetails azureIaasSustainabilityDetails; + + /** + * Creates an instance of AzureIaasSummary class. + */ + public AzureIaasSummary() { + } + + /** + * Get the yearOnYearEstimates property: Shows the year-on-year cost overall. + * + * @return the yearOnYearEstimates value. + */ + public YearOnYearEstimates yearOnYearEstimates() { + return this.yearOnYearEstimates; + } + + /** + * Get the azureIaasVmSummary property: Azure Iaas virtual machine summary. + * + * @return the azureIaasVmSummary value. + */ + public AzureIaasVmSummary azureIaasVmSummary() { + return this.azureIaasVmSummary; + } + + /** + * Get the azureIaasSqlSummary property: Azure Iaas sql server summary. + * + * @return the azureIaasSqlSummary value. + */ + public AzureIaasSqlSummary azureIaasSqlSummary() { + return this.azureIaasSqlSummary; + } + + /** + * Get the azureIaasCostDetails property: The on premises PaaS cost. + * + * @return the azureIaasCostDetails value. + */ + public CostDetails azureIaasCostDetails() { + return this.azureIaasCostDetails; + } + + /** + * Get the azureIaasSustainabilityDetails property: The azure Iaas sustainability details. + * + * @return the azureIaasSustainabilityDetails value. + */ + public CarbonEmissionsDetails azureIaasSustainabilityDetails() { + return this.azureIaasSustainabilityDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (yearOnYearEstimates() != null) { + yearOnYearEstimates().validate(); + } + if (azureIaasVmSummary() != null) { + azureIaasVmSummary().validate(); + } + if (azureIaasSqlSummary() != null) { + azureIaasSqlSummary().validate(); + } + if (azureIaasCostDetails() != null) { + azureIaasCostDetails().validate(); + } + if (azureIaasSustainabilityDetails() != null) { + azureIaasSustainabilityDetails().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureIaasSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureIaasSummary 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 AzureIaasSummary. + */ + public static AzureIaasSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureIaasSummary deserializedAzureIaasSummary = new AzureIaasSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("yearOnYearEstimates".equals(fieldName)) { + deserializedAzureIaasSummary.yearOnYearEstimates = YearOnYearEstimates.fromJson(reader); + } else if ("azureIaasVmSummary".equals(fieldName)) { + deserializedAzureIaasSummary.azureIaasVmSummary = AzureIaasVmSummary.fromJson(reader); + } else if ("azureIaasSqlSummary".equals(fieldName)) { + deserializedAzureIaasSummary.azureIaasSqlSummary = AzureIaasSqlSummary.fromJson(reader); + } else if ("azureIaasCostDetails".equals(fieldName)) { + deserializedAzureIaasSummary.azureIaasCostDetails = CostDetails.fromJson(reader); + } else if ("azureIaasSustainabilityDetails".equals(fieldName)) { + deserializedAzureIaasSummary.azureIaasSustainabilityDetails + = CarbonEmissionsDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureIaasSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureIaasVmSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureIaasVmSummary.java new file mode 100644 index 000000000000..86dbd8ed0724 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureIaasVmSummary.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Azure Iaas virtual machine summary. + */ +@Immutable +public final class AzureIaasVmSummary implements JsonSerializable { + /* + * Servers suitable for migration. + */ + private Integer serversSuitableForMigration; + + /* + * The total number of servers. + */ + private Integer totalNumberOfServers; + + /* + * The total number of IaaS VM cores. + */ + private Integer cores; + + /* + * The total memory in GB. + */ + private Float memoryGB; + + /* + * The on premises PaaS cost. + */ + private CostDetails azureVmCostDetails; + + /* + * Estimated cost. + */ + private Float estimatedCost; + + /* + * OS licensing cost. + */ + private Float osLicensingCost; + + /* + * Estimated cost by offer. + */ + private List estimatedCostByRecommendedOffer; + + /* + * The recommended VM family summary. + */ + private List recommendedVmFamilySummary; + + /* + * The cost by storage type. + */ + private List costByStorageType; + + /** + * Creates an instance of AzureIaasVmSummary class. + */ + public AzureIaasVmSummary() { + } + + /** + * Get the serversSuitableForMigration property: Servers suitable for migration. + * + * @return the serversSuitableForMigration value. + */ + public Integer serversSuitableForMigration() { + return this.serversSuitableForMigration; + } + + /** + * Get the totalNumberOfServers property: The total number of servers. + * + * @return the totalNumberOfServers value. + */ + public Integer totalNumberOfServers() { + return this.totalNumberOfServers; + } + + /** + * Get the cores property: The total number of IaaS VM cores. + * + * @return the cores value. + */ + public Integer cores() { + return this.cores; + } + + /** + * Get the memoryGB property: The total memory in GB. + * + * @return the memoryGB value. + */ + public Float memoryGB() { + return this.memoryGB; + } + + /** + * Get the azureVmCostDetails property: The on premises PaaS cost. + * + * @return the azureVmCostDetails value. + */ + public CostDetails azureVmCostDetails() { + return this.azureVmCostDetails; + } + + /** + * Get the estimatedCost property: Estimated cost. + * + * @return the estimatedCost value. + */ + public Float estimatedCost() { + return this.estimatedCost; + } + + /** + * Get the osLicensingCost property: OS licensing cost. + * + * @return the osLicensingCost value. + */ + public Float osLicensingCost() { + return this.osLicensingCost; + } + + /** + * Get the estimatedCostByRecommendedOffer property: Estimated cost by offer. + * + * @return the estimatedCostByRecommendedOffer value. + */ + public List estimatedCostByRecommendedOffer() { + return this.estimatedCostByRecommendedOffer; + } + + /** + * Get the recommendedVmFamilySummary property: The recommended VM family summary. + * + * @return the recommendedVmFamilySummary value. + */ + public List recommendedVmFamilySummary() { + return this.recommendedVmFamilySummary; + } + + /** + * Get the costByStorageType property: The cost by storage type. + * + * @return the costByStorageType value. + */ + public List costByStorageType() { + return this.costByStorageType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureVmCostDetails() != null) { + azureVmCostDetails().validate(); + } + if (estimatedCostByRecommendedOffer() != null) { + estimatedCostByRecommendedOffer().forEach(e -> e.validate()); + } + if (recommendedVmFamilySummary() != null) { + recommendedVmFamilySummary().forEach(e -> e.validate()); + } + if (costByStorageType() != null) { + costByStorageType().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureIaasVmSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureIaasVmSummary 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 AzureIaasVmSummary. + */ + public static AzureIaasVmSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureIaasVmSummary deserializedAzureIaasVmSummary = new AzureIaasVmSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serversSuitableForMigration".equals(fieldName)) { + deserializedAzureIaasVmSummary.serversSuitableForMigration = reader.getNullable(JsonReader::getInt); + } else if ("totalNumberOfServers".equals(fieldName)) { + deserializedAzureIaasVmSummary.totalNumberOfServers = reader.getNullable(JsonReader::getInt); + } else if ("cores".equals(fieldName)) { + deserializedAzureIaasVmSummary.cores = reader.getNullable(JsonReader::getInt); + } else if ("memoryGB".equals(fieldName)) { + deserializedAzureIaasVmSummary.memoryGB = reader.getNullable(JsonReader::getFloat); + } else if ("azureVmCostDetails".equals(fieldName)) { + deserializedAzureIaasVmSummary.azureVmCostDetails = CostDetails.fromJson(reader); + } else if ("estimatedCost".equals(fieldName)) { + deserializedAzureIaasVmSummary.estimatedCost = reader.getNullable(JsonReader::getFloat); + } else if ("osLicensingCost".equals(fieldName)) { + deserializedAzureIaasVmSummary.osLicensingCost = reader.getNullable(JsonReader::getFloat); + } else if ("estimatedCostByRecommendedOffer".equals(fieldName)) { + List estimatedCostByRecommendedOffer + = reader.readArray(reader1 -> EstimatedCostByOffer.fromJson(reader1)); + deserializedAzureIaasVmSummary.estimatedCostByRecommendedOffer = estimatedCostByRecommendedOffer; + } else if ("recommendedVmFamilySummary".equals(fieldName)) { + List recommendedVmFamilySummary + = reader.readArray(reader1 -> RecommendedVmFamilySummary.fromJson(reader1)); + deserializedAzureIaasVmSummary.recommendedVmFamilySummary = recommendedVmFamilySummary; + } else if ("costByStorageType".equals(fieldName)) { + List costByStorageType + = reader.readArray(reader1 -> CostByStorageType.fromJson(reader1)); + deserializedAzureIaasVmSummary.costByStorageType = costByStorageType; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureIaasVmSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureKubernetesServiceSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureKubernetesServiceSummary.java new file mode 100644 index 000000000000..ab5bacaf9be4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureKubernetesServiceSummary.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Shows Azure Kubernetes Service summary. + */ +@Immutable +public final class AzureKubernetesServiceSummary implements JsonSerializable { + /* + * Estimated cost by recommendation offer. + */ + private List estimatedCostByOffer; + + /* + * Distribution by SKU. + */ + private List distributionBySku; + + /* + * Distribution by application type. + */ + private List distributionByApp; + + /** + * Creates an instance of AzureKubernetesServiceSummary class. + */ + public AzureKubernetesServiceSummary() { + } + + /** + * Get the estimatedCostByOffer property: Estimated cost by recommendation offer. + * + * @return the estimatedCostByOffer value. + */ + public List estimatedCostByOffer() { + return this.estimatedCostByOffer; + } + + /** + * Get the distributionBySku property: Distribution by SKU. + * + * @return the distributionBySku value. + */ + public List distributionBySku() { + return this.distributionBySku; + } + + /** + * Get the distributionByApp property: Distribution by application type. + * + * @return the distributionByApp value. + */ + public List distributionByApp() { + return this.distributionByApp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (estimatedCostByOffer() != null) { + estimatedCostByOffer().forEach(e -> e.validate()); + } + if (distributionBySku() != null) { + distributionBySku().forEach(e -> e.validate()); + } + if (distributionByApp() != null) { + distributionByApp().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureKubernetesServiceSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureKubernetesServiceSummary 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 AzureKubernetesServiceSummary. + */ + public static AzureKubernetesServiceSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureKubernetesServiceSummary deserializedAzureKubernetesServiceSummary + = new AzureKubernetesServiceSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("estimatedCostByOffer".equals(fieldName)) { + List estimatedCostByOffer + = reader.readArray(reader1 -> EstimatedCostByOffer.fromJson(reader1)); + deserializedAzureKubernetesServiceSummary.estimatedCostByOffer = estimatedCostByOffer; + } else if ("distributionBySku".equals(fieldName)) { + List distributionBySku + = reader.readArray(reader1 -> WebAppTargetSku.fromJson(reader1)); + deserializedAzureKubernetesServiceSummary.distributionBySku = distributionBySku; + } else if ("distributionByApp".equals(fieldName)) { + List distributionByApp + = reader.readArray(reader1 -> WebAppDistribution.fromJson(reader1)); + deserializedAzureKubernetesServiceSummary.distributionByApp = distributionByApp; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureKubernetesServiceSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureLocation.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureLocation.java index e80f2739b2de..1efafefd69fe 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureLocation.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureLocation.java @@ -311,6 +311,41 @@ public final class AzureLocation extends ExpandableStringEnum { */ public static final AzureLocation QATAR_CENTRAL = fromString("QatarCentral"); + /** + * Static value JioIndiaWest for AzureLocation. + */ + public static final AzureLocation JIO_INDIA_WEST = fromString("JioIndiaWest"); + + /** + * Static value ItalyNorth for AzureLocation. + */ + public static final AzureLocation ITALY_NORTH = fromString("ItalyNorth"); + + /** + * Static value PolandCentral for AzureLocation. + */ + public static final AzureLocation POLAND_CENTRAL = fromString("PolandCentral"); + + /** + * Static value IsraelCentral for AzureLocation. + */ + public static final AzureLocation ISRAEL_CENTRAL = fromString("IsraelCentral"); + + /** + * Static value MexicoCentral for AzureLocation. + */ + public static final AzureLocation MEXICO_CENTRAL = fromString("MexicoCentral"); + + /** + * Static value NewZealandNorth for AzureLocation. + */ + public static final AzureLocation NEW_ZEALAND_NORTH = fromString("NewZealandNorth"); + + /** + * Static value SpainCentral for AzureLocation. + */ + public static final AzureLocation SPAIN_CENTRAL = fromString("SpainCentral"); + /** * Creates a new instance of AzureLocation value. * diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureManagedDiskSkuDto.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureManagedDiskSkuDto.java deleted file mode 100644 index ca65e3b8dc80..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureManagedDiskSkuDto.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Class representing an Azure Managed Disk SKU. - */ -@Immutable -public final class AzureManagedDiskSkuDto implements JsonSerializable { - /* - * Gets the Type ("tier") of disk - e.g. standard, premium, ultra. - */ - private AzureManagedDiskSkuDtoDiskType diskType; - - /* - * Gets the Size of the managed disk - e.g. P30, P40. - */ - private AzureDiskSize diskSize; - - /* - * Gets disk redundancy - e.g. LRS, ZRS. - */ - private AzureManagedDiskSkuDtoDiskRedundancy diskRedundancy; - - /* - * Gets the managed disk storage cost. - */ - private Float storageCost; - - /* - * Gets the recommended in GB of the managed disk. - */ - private Float recommendedSizeInGib; - - /* - * Gets the recommended throughput in MBPS of the managed disk. - */ - private Float recommendedThroughputInMbps; - - /* - * Gets the recommended IOPS of the managed disk. - */ - private Float recommendedIops; - - /** - * Creates an instance of AzureManagedDiskSkuDto class. - */ - public AzureManagedDiskSkuDto() { - } - - /** - * Get the diskType property: Gets the Type ("tier") of disk - e.g. standard, premium, ultra. - * - * @return the diskType value. - */ - public AzureManagedDiskSkuDtoDiskType diskType() { - return this.diskType; - } - - /** - * Get the diskSize property: Gets the Size of the managed disk - e.g. P30, P40. - * - * @return the diskSize value. - */ - public AzureDiskSize diskSize() { - return this.diskSize; - } - - /** - * Get the diskRedundancy property: Gets disk redundancy - e.g. LRS, ZRS. - * - * @return the diskRedundancy value. - */ - public AzureManagedDiskSkuDtoDiskRedundancy diskRedundancy() { - return this.diskRedundancy; - } - - /** - * Get the storageCost property: Gets the managed disk storage cost. - * - * @return the storageCost value. - */ - public Float storageCost() { - return this.storageCost; - } - - /** - * Get the recommendedSizeInGib property: Gets the recommended in GB of the managed disk. - * - * @return the recommendedSizeInGib value. - */ - public Float recommendedSizeInGib() { - return this.recommendedSizeInGib; - } - - /** - * Get the recommendedThroughputInMbps property: Gets the recommended throughput in MBPS of the managed disk. - * - * @return the recommendedThroughputInMbps value. - */ - public Float recommendedThroughputInMbps() { - return this.recommendedThroughputInMbps; - } - - /** - * Get the recommendedIops property: Gets the recommended IOPS of the managed disk. - * - * @return the recommendedIops value. - */ - public Float recommendedIops() { - return this.recommendedIops; - } - - /** - * 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 AzureManagedDiskSkuDto from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureManagedDiskSkuDto 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 AzureManagedDiskSkuDto. - */ - public static AzureManagedDiskSkuDto fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureManagedDiskSkuDto deserializedAzureManagedDiskSkuDto = new AzureManagedDiskSkuDto(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("diskType".equals(fieldName)) { - deserializedAzureManagedDiskSkuDto.diskType - = AzureManagedDiskSkuDtoDiskType.fromString(reader.getString()); - } else if ("diskSize".equals(fieldName)) { - deserializedAzureManagedDiskSkuDto.diskSize = AzureDiskSize.fromString(reader.getString()); - } else if ("diskRedundancy".equals(fieldName)) { - deserializedAzureManagedDiskSkuDto.diskRedundancy - = AzureManagedDiskSkuDtoDiskRedundancy.fromString(reader.getString()); - } else if ("storageCost".equals(fieldName)) { - deserializedAzureManagedDiskSkuDto.storageCost = reader.getNullable(JsonReader::getFloat); - } else if ("recommendedSizeInGib".equals(fieldName)) { - deserializedAzureManagedDiskSkuDto.recommendedSizeInGib = reader.getNullable(JsonReader::getFloat); - } else if ("recommendedThroughputInMbps".equals(fieldName)) { - deserializedAzureManagedDiskSkuDto.recommendedThroughputInMbps - = reader.getNullable(JsonReader::getFloat); - } else if ("recommendedIops".equals(fieldName)) { - deserializedAzureManagedDiskSkuDto.recommendedIops = reader.getNullable(JsonReader::getFloat); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureManagedDiskSkuDto; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureManagedDiskSkuDtoDiskRedundancy.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureManagedDiskSkuDtoDiskRedundancy.java deleted file mode 100644 index 495606d3b98c..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureManagedDiskSkuDtoDiskRedundancy.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AzureManagedDiskSkuDtoDiskRedundancy. - */ -public final class AzureManagedDiskSkuDtoDiskRedundancy - extends ExpandableStringEnum { - /** - * Static value Unknown for AzureManagedDiskSkuDtoDiskRedundancy. - */ - public static final AzureManagedDiskSkuDtoDiskRedundancy UNKNOWN = fromString("Unknown"); - - /** - * Static value LRS for AzureManagedDiskSkuDtoDiskRedundancy. - */ - public static final AzureManagedDiskSkuDtoDiskRedundancy LRS = fromString("LRS"); - - /** - * Static value ZRS for AzureManagedDiskSkuDtoDiskRedundancy. - */ - public static final AzureManagedDiskSkuDtoDiskRedundancy ZRS = fromString("ZRS"); - - /** - * Creates a new instance of AzureManagedDiskSkuDtoDiskRedundancy value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AzureManagedDiskSkuDtoDiskRedundancy() { - } - - /** - * Creates or finds a AzureManagedDiskSkuDtoDiskRedundancy from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureManagedDiskSkuDtoDiskRedundancy. - */ - public static AzureManagedDiskSkuDtoDiskRedundancy fromString(String name) { - return fromString(name, AzureManagedDiskSkuDtoDiskRedundancy.class); - } - - /** - * Gets known AzureManagedDiskSkuDtoDiskRedundancy values. - * - * @return known AzureManagedDiskSkuDtoDiskRedundancy values. - */ - public static Collection values() { - return values(AzureManagedDiskSkuDtoDiskRedundancy.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureManagedDiskSkuDtoDiskType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureManagedDiskSkuDtoDiskType.java deleted file mode 100644 index 20137048b6d1..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureManagedDiskSkuDtoDiskType.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AzureManagedDiskSkuDtoDiskType. - */ -public final class AzureManagedDiskSkuDtoDiskType extends ExpandableStringEnum { - /** - * Static value Unknown for AzureManagedDiskSkuDtoDiskType. - */ - public static final AzureManagedDiskSkuDtoDiskType UNKNOWN = fromString("Unknown"); - - /** - * Static value Standard for AzureManagedDiskSkuDtoDiskType. - */ - public static final AzureManagedDiskSkuDtoDiskType STANDARD = fromString("Standard"); - - /** - * Static value StandardSSD for AzureManagedDiskSkuDtoDiskType. - */ - public static final AzureManagedDiskSkuDtoDiskType STANDARD_SSD = fromString("StandardSSD"); - - /** - * Static value Premium for AzureManagedDiskSkuDtoDiskType. - */ - public static final AzureManagedDiskSkuDtoDiskType PREMIUM = fromString("Premium"); - - /** - * Static value StandardOrPremium for AzureManagedDiskSkuDtoDiskType. - */ - public static final AzureManagedDiskSkuDtoDiskType STANDARD_OR_PREMIUM = fromString("StandardOrPremium"); - - /** - * Static value Ultra for AzureManagedDiskSkuDtoDiskType. - */ - public static final AzureManagedDiskSkuDtoDiskType ULTRA = fromString("Ultra"); - - /** - * Static value PremiumV2 for AzureManagedDiskSkuDtoDiskType. - */ - public static final AzureManagedDiskSkuDtoDiskType PREMIUM_V2 = fromString("PremiumV2"); - - /** - * Creates a new instance of AzureManagedDiskSkuDtoDiskType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AzureManagedDiskSkuDtoDiskType() { - } - - /** - * Creates or finds a AzureManagedDiskSkuDtoDiskType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureManagedDiskSkuDtoDiskType. - */ - public static AzureManagedDiskSkuDtoDiskType fromString(String name) { - return fromString(name, AzureManagedDiskSkuDtoDiskType.class); - } - - /** - * Gets known AzureManagedDiskSkuDtoDiskType values. - * - * @return known AzureManagedDiskSkuDtoDiskType values. - */ - public static Collection values() { - return values(AzureManagedDiskSkuDtoDiskType.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureManagementOfferingType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureManagementOfferingType.java new file mode 100644 index 000000000000..b01f58dd1f16 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureManagementOfferingType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure management Offering type. + */ +public final class AzureManagementOfferingType extends ExpandableStringEnum { + /** + * Static value No for AzureManagementOfferingType. + */ + public static final AzureManagementOfferingType NO = fromString("No"); + + /** + * Static value SCOMMI for AzureManagementOfferingType. + */ + public static final AzureManagementOfferingType SCOMMI = fromString("SCOMMI"); + + /** + * Static value AzMon for AzureManagementOfferingType. + */ + public static final AzureManagementOfferingType AZ_MON = fromString("AzMon"); + + /** + * Static value AUM for AzureManagementOfferingType. + */ + public static final AzureManagementOfferingType AUM = fromString("AUM"); + + /** + * Static value AzureBackup for AzureManagementOfferingType. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureNetworkAdapterSuitabilityDetail.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureNetworkAdapterSuitabilityDetail.java deleted file mode 100644 index 28c0470ea0a4..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureNetworkAdapterSuitabilityDetail.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AzureNetworkAdapterSuitabilityDetail. - */ -public final class AzureNetworkAdapterSuitabilityDetail - extends ExpandableStringEnum { - /** - * Static value None for AzureNetworkAdapterSuitabilityDetail. - */ - public static final AzureNetworkAdapterSuitabilityDetail NONE = fromString("None"); - - /** - * Static value MegabytesOfDataTransmittedMissing for AzureNetworkAdapterSuitabilityDetail. - */ - public static final AzureNetworkAdapterSuitabilityDetail MEGABYTES_OF_DATA_TRANSMITTED_MISSING - = fromString("MegabytesOfDataTransmittedMissing"); - - /** - * Static value MegabytesOfDataTransmittedOutOfRange for AzureNetworkAdapterSuitabilityDetail. - */ - public static final AzureNetworkAdapterSuitabilityDetail MEGABYTES_OF_DATA_TRANSMITTED_OUT_OF_RANGE - = fromString("MegabytesOfDataTransmittedOutOfRange"); - - /** - * Static value MegabytesOfDataRecievedMissing for AzureNetworkAdapterSuitabilityDetail. - */ - public static final AzureNetworkAdapterSuitabilityDetail MEGABYTES_OF_DATA_RECIEVED_MISSING - = fromString("MegabytesOfDataRecievedMissing"); - - /** - * Static value MegabytesOfDataRecievedOutOfRange for AzureNetworkAdapterSuitabilityDetail. - */ - public static final AzureNetworkAdapterSuitabilityDetail MEGABYTES_OF_DATA_RECIEVED_OUT_OF_RANGE - = fromString("MegabytesOfDataRecievedOutOfRange"); - - /** - * Creates a new instance of AzureNetworkAdapterSuitabilityDetail value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AzureNetworkAdapterSuitabilityDetail() { - } - - /** - * Creates or finds a AzureNetworkAdapterSuitabilityDetail from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureNetworkAdapterSuitabilityDetail. - */ - public static AzureNetworkAdapterSuitabilityDetail fromString(String name) { - return fromString(name, AzureNetworkAdapterSuitabilityDetail.class); - } - - /** - * Gets known AzureNetworkAdapterSuitabilityDetail values. - * - * @return known AzureNetworkAdapterSuitabilityDetail values. - */ - public static Collection values() { - return values(AzureNetworkAdapterSuitabilityDetail.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureNetworkAdapterSuitabilityExplanation.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureNetworkAdapterSuitabilityExplanation.java deleted file mode 100644 index 6d53e8221056..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureNetworkAdapterSuitabilityExplanation.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AzureNetworkAdapterSuitabilityExplanation. - */ -public final class AzureNetworkAdapterSuitabilityExplanation - extends ExpandableStringEnum { - /** - * Static value Unknown for AzureNetworkAdapterSuitabilityExplanation. - */ - public static final AzureNetworkAdapterSuitabilityExplanation UNKNOWN = fromString("Unknown"); - - /** - * Static value NotApplicable for AzureNetworkAdapterSuitabilityExplanation. - */ - public static final AzureNetworkAdapterSuitabilityExplanation NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Static value InternalErrorOccurred for AzureNetworkAdapterSuitabilityExplanation. - */ - public static final AzureNetworkAdapterSuitabilityExplanation INTERNAL_ERROR_OCCURRED - = fromString("InternalErrorOccurred"); - - /** - * Creates a new instance of AzureNetworkAdapterSuitabilityExplanation value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AzureNetworkAdapterSuitabilityExplanation() { - } - - /** - * Creates or finds a AzureNetworkAdapterSuitabilityExplanation from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureNetworkAdapterSuitabilityExplanation. - */ - public static AzureNetworkAdapterSuitabilityExplanation fromString(String name) { - return fromString(name, AzureNetworkAdapterSuitabilityExplanation.class); - } - - /** - * Gets known AzureNetworkAdapterSuitabilityExplanation values. - * - * @return known AzureNetworkAdapterSuitabilityExplanation values. - */ - public static Collection values() { - return values(AzureNetworkAdapterSuitabilityExplanation.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureOffer.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureOffer.java new file mode 100644 index 000000000000..661508ee819e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureOffer.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure Offer. + */ +public final class AzureOffer extends ExpandableStringEnum { + /** + * Static value Unknown for AzureOffer. + */ + public static final AzureOffer UNKNOWN = fromString("Unknown"); + + /** + * Static value MSAZR0003P for AzureOffer. + */ + public static final AzureOffer MSAZR0003P = fromString("MSAZR0003P"); + + /** + * Static value MSAZR0023P for AzureOffer. + */ + public static final AzureOffer MSAZR0023P = fromString("MSAZR0023P"); + + /** + * Static value MSMCAZR0044P for AzureOffer. + */ + public static final AzureOffer MSMCAZR0044P = fromString("MSMCAZR0044P"); + + /** + * Static value MSMCAZR0059P for AzureOffer. + */ + public static final AzureOffer MSMCAZR0059P = fromString("MSMCAZR0059P"); + + /** + * Static value MSMCAZR0060P for AzureOffer. + */ + public static final AzureOffer MSMCAZR0060P = fromString("MSMCAZR0060P"); + + /** + * Static value MSMCAZR0063P for AzureOffer. + */ + public static final AzureOffer MSMCAZR0063P = fromString("MSMCAZR0063P"); + + /** + * Static value MSAZRUSGOV0003P for AzureOffer. + */ + public static final AzureOffer MSAZRUSGOV0003P = fromString("MSAZRUSGOV0003P"); + + /** + * Static value EA for AzureOffer. + */ + public static final AzureOffer EA = fromString("EA"); + + /** + * Static value SavingsPlan1Year for AzureOffer. + */ + public static final AzureOffer SAVINGS_PLAN1YEAR = fromString("SavingsPlan1Year"); + + /** + * Static value SavingsPlan3Year for AzureOffer. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureOfferCode.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureOfferCode.java deleted file mode 100644 index 58f8cd71a833..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureOfferCode.java +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AzureOfferCode. - */ -public final class AzureOfferCode extends ExpandableStringEnum { - /** - * Static value Unknown for AzureOfferCode. - */ - public static final AzureOfferCode UNKNOWN = fromString("Unknown"); - - /** - * Static value MSAZR0003P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0003P = fromString("MSAZR0003P"); - - /** - * Static value MSAZR0044P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0044P = fromString("MSAZR0044P"); - - /** - * Static value MSAZR0059P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0059P = fromString("MSAZR0059P"); - - /** - * Static value MSAZR0060P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0060P = fromString("MSAZR0060P"); - - /** - * Static value MSAZR0062P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0062P = fromString("MSAZR0062P"); - - /** - * Static value MSAZR0063P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0063P = fromString("MSAZR0063P"); - - /** - * Static value MSAZR0064P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0064P = fromString("MSAZR0064P"); - - /** - * Static value MSAZR0029P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0029P = fromString("MSAZR0029P"); - - /** - * Static value MSAZR0022P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0022P = fromString("MSAZR0022P"); - - /** - * Static value MSAZR0023P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0023P = fromString("MSAZR0023P"); - - /** - * Static value MSAZR0148P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0148P = fromString("MSAZR0148P"); - - /** - * Static value MSAZR0025P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0025P = fromString("MSAZR0025P"); - - /** - * Static value MSAZR0036P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0036P = fromString("MSAZR0036P"); - - /** - * Static value MSAZR0120P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0120P = fromString("MSAZR0120P"); - - /** - * Static value MSAZR0121P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0121P = fromString("MSAZR0121P"); - - /** - * Static value MSAZR0122P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0122P = fromString("MSAZR0122P"); - - /** - * Static value MSAZR0123P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0123P = fromString("MSAZR0123P"); - - /** - * Static value MSAZR0124P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0124P = fromString("MSAZR0124P"); - - /** - * Static value MSAZR0125P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0125P = fromString("MSAZR0125P"); - - /** - * Static value MSAZR0126P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0126P = fromString("MSAZR0126P"); - - /** - * Static value MSAZR0127P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0127P = fromString("MSAZR0127P"); - - /** - * Static value MSAZR0128P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0128P = fromString("MSAZR0128P"); - - /** - * Static value MSAZR0129P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0129P = fromString("MSAZR0129P"); - - /** - * Static value MSAZR0130P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0130P = fromString("MSAZR0130P"); - - /** - * Static value MSAZR0111P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0111P = fromString("MSAZR0111P"); - - /** - * Static value MSAZR0144P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0144P = fromString("MSAZR0144P"); - - /** - * Static value MSAZR0149P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0149P = fromString("MSAZR0149P"); - - /** - * Static value MSMCAZR0044P for AzureOfferCode. - */ - public static final AzureOfferCode MSMCAZR0044P = fromString("MSMCAZR0044P"); - - /** - * Static value MSMCAZR0059P for AzureOfferCode. - */ - public static final AzureOfferCode MSMCAZR0059P = fromString("MSMCAZR0059P"); - - /** - * Static value MSMCAZR0060P for AzureOfferCode. - */ - public static final AzureOfferCode MSMCAZR0060P = fromString("MSMCAZR0060P"); - - /** - * Static value MSMCAZR0063P for AzureOfferCode. - */ - public static final AzureOfferCode MSMCAZR0063P = fromString("MSMCAZR0063P"); - - /** - * Static value MSMCAZR0120P for AzureOfferCode. - */ - public static final AzureOfferCode MSMCAZR0120P = fromString("MSMCAZR0120P"); - - /** - * Static value MSMCAZR0121P for AzureOfferCode. - */ - public static final AzureOfferCode MSMCAZR0121P = fromString("MSMCAZR0121P"); - - /** - * Static value MSMCAZR0125P for AzureOfferCode. - */ - public static final AzureOfferCode MSMCAZR0125P = fromString("MSMCAZR0125P"); - - /** - * Static value MSMCAZR0128P for AzureOfferCode. - */ - public static final AzureOfferCode MSMCAZR0128P = fromString("MSMCAZR0128P"); - - /** - * Static value MSAZRDE0003P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZRDE0003P = fromString("MSAZRDE0003P"); - - /** - * Static value MSAZRDE0044P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZRDE0044P = fromString("MSAZRDE0044P"); - - /** - * Static value MSAZRUSGOV0003P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZRUSGOV0003P = fromString("MSAZRUSGOV0003P"); - - /** - * Static value EA for AzureOfferCode. - */ - public static final AzureOfferCode EA = fromString("EA"); - - /** - * Static value MSAZR0243P for AzureOfferCode. - */ - public static final AzureOfferCode MSAZR0243P = fromString("MSAZR0243P"); - - /** - * Static value SavingsPlan1Year for AzureOfferCode. - */ - public static final AzureOfferCode SAVINGS_PLAN1YEAR = fromString("SavingsPlan1Year"); - - /** - * Static value SavingsPlan3Year for AzureOfferCode. - */ - public static final AzureOfferCode SAVINGS_PLAN3YEAR = fromString("SavingsPlan3Year"); - - /** - * Creates a new instance of AzureOfferCode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AzureOfferCode() { - } - - /** - * Creates or finds a AzureOfferCode from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureOfferCode. - */ - public static AzureOfferCode fromString(String name) { - return fromString(name, AzureOfferCode.class); - } - - /** - * Gets known AzureOfferCode values. - * - * @return known AzureOfferCode values. - */ - public static Collection values() { - return values(AzureOfferCode.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzurePaasSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzurePaasSummary.java new file mode 100644 index 000000000000..1b402797336f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzurePaasSummary.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Shows the PaaS Azure summary. + */ +@Immutable +public final class AzurePaasSummary implements JsonSerializable { + /* + * Number of Sql instances. + */ + private Integer totalSqlEntities; + + /* + * Suitable Sql instances. + */ + private Integer suitableSqlEntities; + + /* + * Number of web applications. + */ + private Integer totalWebApps; + + /* + * Suitable web applications. + */ + private Integer suitableWebApps; + + /* + * Number of cores. + */ + private Integer cores; + + /* + * Memory Utilization. + */ + private Float memory; + + /* + * Storage Utilization. + */ + private Float storage; + + /* + * Shows the estimated cost by target. + */ + private EstimatedCostByTarget estimatedCostByTarget; + + /* + * estimated SQL Server licensing cost. + */ + private Float estimatedSqlServerLicensingCost; + + /* + * Shows the Azure SQL details. + */ + private AzureSqlSummary azureSqlSummary; + + /* + * Shows Azure App Service summary. + */ + private AzureAppServiceSummary azureAppServiceSummary; + + /* + * Shows Azure App Service Container summary. + */ + private AzureAppServiceContainerSummary azureAppServiceContainerSummary; + + /* + * Shows Azure Kubernetes Service summary. + */ + private AzureKubernetesServiceSummary azureKubernetesServiceSummary; + + /* + * The on premises PaaS cost. + */ + private CostDetails totalAzurePaasCost; + + /* + * The Azure PaaS Sustainability Emissions Details. + */ + private CarbonEmissionsDetails azurePaasSustainabilityDetails; + + /** + * Creates an instance of AzurePaasSummary class. + */ + public AzurePaasSummary() { + } + + /** + * Get the totalSqlEntities property: Number of Sql instances. + * + * @return the totalSqlEntities value. + */ + public Integer totalSqlEntities() { + return this.totalSqlEntities; + } + + /** + * Get the suitableSqlEntities property: Suitable Sql instances. + * + * @return the suitableSqlEntities value. + */ + public Integer suitableSqlEntities() { + return this.suitableSqlEntities; + } + + /** + * Get the totalWebApps property: Number of web applications. + * + * @return the totalWebApps value. + */ + public Integer totalWebApps() { + return this.totalWebApps; + } + + /** + * Get the suitableWebApps property: Suitable web applications. + * + * @return the suitableWebApps value. + */ + public Integer suitableWebApps() { + return this.suitableWebApps; + } + + /** + * Get the cores property: Number of cores. + * + * @return the cores value. + */ + public Integer cores() { + return this.cores; + } + + /** + * Get the memory property: Memory Utilization. + * + * @return the memory value. + */ + public Float memory() { + return this.memory; + } + + /** + * Get the storage property: Storage Utilization. + * + * @return the storage value. + */ + public Float storage() { + return this.storage; + } + + /** + * Get the estimatedCostByTarget property: Shows the estimated cost by target. + * + * @return the estimatedCostByTarget value. + */ + public EstimatedCostByTarget estimatedCostByTarget() { + return this.estimatedCostByTarget; + } + + /** + * Get the estimatedSqlServerLicensingCost property: estimated SQL Server licensing cost. + * + * @return the estimatedSqlServerLicensingCost value. + */ + public Float estimatedSqlServerLicensingCost() { + return this.estimatedSqlServerLicensingCost; + } + + /** + * Get the azureSqlSummary property: Shows the Azure SQL details. + * + * @return the azureSqlSummary value. + */ + public AzureSqlSummary azureSqlSummary() { + return this.azureSqlSummary; + } + + /** + * Get the azureAppServiceSummary property: Shows Azure App Service summary. + * + * @return the azureAppServiceSummary value. + */ + public AzureAppServiceSummary azureAppServiceSummary() { + return this.azureAppServiceSummary; + } + + /** + * Get the azureAppServiceContainerSummary property: Shows Azure App Service Container summary. + * + * @return the azureAppServiceContainerSummary value. + */ + public AzureAppServiceContainerSummary azureAppServiceContainerSummary() { + return this.azureAppServiceContainerSummary; + } + + /** + * Get the azureKubernetesServiceSummary property: Shows Azure Kubernetes Service summary. + * + * @return the azureKubernetesServiceSummary value. + */ + public AzureKubernetesServiceSummary azureKubernetesServiceSummary() { + return this.azureKubernetesServiceSummary; + } + + /** + * Get the totalAzurePaasCost property: The on premises PaaS cost. + * + * @return the totalAzurePaasCost value. + */ + public CostDetails totalAzurePaasCost() { + return this.totalAzurePaasCost; + } + + /** + * Get the azurePaasSustainabilityDetails property: The Azure PaaS Sustainability Emissions Details. + * + * @return the azurePaasSustainabilityDetails value. + */ + public CarbonEmissionsDetails azurePaasSustainabilityDetails() { + return this.azurePaasSustainabilityDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (estimatedCostByTarget() != null) { + estimatedCostByTarget().validate(); + } + if (azureSqlSummary() != null) { + azureSqlSummary().validate(); + } + if (azureAppServiceSummary() != null) { + azureAppServiceSummary().validate(); + } + if (azureAppServiceContainerSummary() != null) { + azureAppServiceContainerSummary().validate(); + } + if (azureKubernetesServiceSummary() != null) { + azureKubernetesServiceSummary().validate(); + } + if (totalAzurePaasCost() != null) { + totalAzurePaasCost().validate(); + } + if (azurePaasSustainabilityDetails() != null) { + azurePaasSustainabilityDetails().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzurePaasSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzurePaasSummary 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 AzurePaasSummary. + */ + public static AzurePaasSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzurePaasSummary deserializedAzurePaasSummary = new AzurePaasSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalSqlEntities".equals(fieldName)) { + deserializedAzurePaasSummary.totalSqlEntities = reader.getNullable(JsonReader::getInt); + } else if ("suitableSqlEntities".equals(fieldName)) { + deserializedAzurePaasSummary.suitableSqlEntities = reader.getNullable(JsonReader::getInt); + } else if ("totalWebApps".equals(fieldName)) { + deserializedAzurePaasSummary.totalWebApps = reader.getNullable(JsonReader::getInt); + } else if ("suitableWebApps".equals(fieldName)) { + deserializedAzurePaasSummary.suitableWebApps = reader.getNullable(JsonReader::getInt); + } else if ("cores".equals(fieldName)) { + deserializedAzurePaasSummary.cores = reader.getNullable(JsonReader::getInt); + } else if ("memory".equals(fieldName)) { + deserializedAzurePaasSummary.memory = reader.getNullable(JsonReader::getFloat); + } else if ("storage".equals(fieldName)) { + deserializedAzurePaasSummary.storage = reader.getNullable(JsonReader::getFloat); + } else if ("estimatedCostByTarget".equals(fieldName)) { + deserializedAzurePaasSummary.estimatedCostByTarget = EstimatedCostByTarget.fromJson(reader); + } else if ("estimatedSqlServerLicensingCost".equals(fieldName)) { + deserializedAzurePaasSummary.estimatedSqlServerLicensingCost + = reader.getNullable(JsonReader::getFloat); + } else if ("azureSqlSummary".equals(fieldName)) { + deserializedAzurePaasSummary.azureSqlSummary = AzureSqlSummary.fromJson(reader); + } else if ("azureAppServiceSummary".equals(fieldName)) { + deserializedAzurePaasSummary.azureAppServiceSummary = AzureAppServiceSummary.fromJson(reader); + } else if ("azureAppServiceContainerSummary".equals(fieldName)) { + deserializedAzurePaasSummary.azureAppServiceContainerSummary + = AzureAppServiceContainerSummary.fromJson(reader); + } else if ("azureKubernetesServiceSummary".equals(fieldName)) { + deserializedAzurePaasSummary.azureKubernetesServiceSummary + = AzureKubernetesServiceSummary.fromJson(reader); + } else if ("totalAzurePaasCost".equals(fieldName)) { + deserializedAzurePaasSummary.totalAzurePaasCost = CostDetails.fromJson(reader); + } else if ("azurePaasSustainabilityDetails".equals(fieldName)) { + deserializedAzurePaasSummary.azurePaasSustainabilityDetails + = CarbonEmissionsDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAzurePaasSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzurePricingTier.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzurePricingTier.java index 661b847399e8..07b30673ce7a 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzurePricingTier.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzurePricingTier.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for AzurePricingTier. + * Azure Pricing Tier. */ public final class AzurePricingTier extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureQuorumWitnessDto.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureQuorumWitnessDto.java deleted file mode 100644 index 1a67b71f2c06..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureQuorumWitnessDto.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Quorum Witness. - */ -@Immutable -public final class AzureQuorumWitnessDto implements JsonSerializable { - /* - * Gets quorum witness type. - */ - private AzureQuorumWitnessDtoQuorumWitnessType quorumWitnessType; - - /** - * Creates an instance of AzureQuorumWitnessDto class. - */ - public AzureQuorumWitnessDto() { - } - - /** - * Get the quorumWitnessType property: Gets quorum witness type. - * - * @return the quorumWitnessType value. - */ - public AzureQuorumWitnessDtoQuorumWitnessType quorumWitnessType() { - return this.quorumWitnessType; - } - - /** - * 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 AzureQuorumWitnessDto from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureQuorumWitnessDto 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 AzureQuorumWitnessDto. - */ - public static AzureQuorumWitnessDto fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureQuorumWitnessDto deserializedAzureQuorumWitnessDto = new AzureQuorumWitnessDto(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("quorumWitnessType".equals(fieldName)) { - deserializedAzureQuorumWitnessDto.quorumWitnessType - = AzureQuorumWitnessDtoQuorumWitnessType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureQuorumWitnessDto; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureQuorumWitnessDtoQuorumWitnessType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureQuorumWitnessDtoQuorumWitnessType.java deleted file mode 100644 index df0b6b0c2543..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureQuorumWitnessDtoQuorumWitnessType.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AzureQuorumWitnessDtoQuorumWitnessType. - */ -public final class AzureQuorumWitnessDtoQuorumWitnessType - extends ExpandableStringEnum { - /** - * Static value Unknown for AzureQuorumWitnessDtoQuorumWitnessType. - */ - public static final AzureQuorumWitnessDtoQuorumWitnessType UNKNOWN = fromString("Unknown"); - - /** - * Static value Cloud for AzureQuorumWitnessDtoQuorumWitnessType. - */ - public static final AzureQuorumWitnessDtoQuorumWitnessType CLOUD = fromString("Cloud"); - - /** - * Static value Disk for AzureQuorumWitnessDtoQuorumWitnessType. - */ - public static final AzureQuorumWitnessDtoQuorumWitnessType DISK = fromString("Disk"); - - /** - * Creates a new instance of AzureQuorumWitnessDtoQuorumWitnessType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AzureQuorumWitnessDtoQuorumWitnessType() { - } - - /** - * Creates or finds a AzureQuorumWitnessDtoQuorumWitnessType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureQuorumWitnessDtoQuorumWitnessType. - */ - public static AzureQuorumWitnessDtoQuorumWitnessType fromString(String name) { - return fromString(name, AzureQuorumWitnessDtoQuorumWitnessType.class); - } - - /** - * Gets known AzureQuorumWitnessDtoQuorumWitnessType values. - * - * @return known AzureQuorumWitnessDtoQuorumWitnessType values. - */ - public static Collection values() { - return values(AzureQuorumWitnessDtoQuorumWitnessType.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureReservedInstance.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureReservedInstance.java index d771988466af..47ba4ebd304e 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureReservedInstance.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureReservedInstance.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for AzureReservedInstance. + * Azure reserved Instance. */ public final class AzureReservedInstance extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureResourceManagerCommonTypesTrackedResourceUpdate.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureResourceManagerCommonTypesTrackedResourceUpdate.java new file mode 100644 index 000000000000..da3327b0fdd0 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureResourceManagerCommonTypesTrackedResourceUpdate.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 java.io.IOException; +import java.util.Map; + +/** + * The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a + * 'location'. + */ +@Fluent +public class AzureResourceManagerCommonTypesTrackedResourceUpdate extends ProxyResource { + /* + * Resource tags. + */ + private Map tags; + + /* + * 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 AzureResourceManagerCommonTypesTrackedResourceUpdate class. + */ + public AzureResourceManagerCommonTypesTrackedResourceUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the AzureResourceManagerCommonTypesTrackedResourceUpdate object itself. + */ + public AzureResourceManagerCommonTypesTrackedResourceUpdate withTags(Map tags) { + this.tags = tags; + 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; + } + + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the AzureResourceManagerCommonTypesTrackedResourceUpdate object itself. + */ + AzureResourceManagerCommonTypesTrackedResourceUpdate withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureResourceManagerCommonTypesTrackedResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureResourceManagerCommonTypesTrackedResourceUpdate 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 AzureResourceManagerCommonTypesTrackedResourceUpdate. + */ + public static AzureResourceManagerCommonTypesTrackedResourceUpdate fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AzureResourceManagerCommonTypesTrackedResourceUpdate deserializedAzureResourceManagerCommonTypesTrackedResourceUpdate + = new AzureResourceManagerCommonTypesTrackedResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAzureResourceManagerCommonTypesTrackedResourceUpdate.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAzureResourceManagerCommonTypesTrackedResourceUpdate.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAzureResourceManagerCommonTypesTrackedResourceUpdate.type = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureResourceManagerCommonTypesTrackedResourceUpdate.tags = tags; + } else if ("systemData".equals(fieldName)) { + deserializedAzureResourceManagerCommonTypesTrackedResourceUpdate.systemData + = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureResourceManagerCommonTypesTrackedResourceUpdate; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureResourceProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureResourceProperties.java deleted file mode 100644 index 57e7e76d4abb..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureResourceProperties.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Common properties for all azure tracked and proxy resources. - */ -@Fluent -public class AzureResourceProperties implements JsonSerializable { - /* - * The status of the last operation. - */ - private ProvisioningState provisioningState; - - /** - * Creates an instance of AzureResourceProperties class. - */ - public AzureResourceProperties() { - } - - /** - * Get the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The status of the last operation. - * - * @param provisioningState the provisioningState value to set. - * @return the AzureResourceProperties object itself. - */ - public AzureResourceProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - 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("provisioningState", - this.provisioningState == null ? null : this.provisioningState.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureResourceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureResourceProperties 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 AzureResourceProperties. - */ - public static AzureResourceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureResourceProperties deserializedAzureResourceProperties = new AzureResourceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedAzureResourceProperties.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureResourceProperties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSecurityOfferingType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSecurityOfferingType.java index 76c5aea4de2b..19d805db73f6 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSecurityOfferingType.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSecurityOfferingType.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for AzureSecurityOfferingType. + * Azure Security Offering Type. */ public final class AzureSecurityOfferingType extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSettings.java new file mode 100644 index 000000000000..7eac3e2d2715 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSettings.java @@ -0,0 +1,577 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Azure settings for a business case. + */ +@Fluent +public final class AzureSettings implements JsonSerializable { + /* + * Gets or sets azure location. + */ + private String targetLocation; + + /* + * Gets azure Discount percentage. + */ + private Float discountPercentage; + + /* + * Business case Currency. + */ + private BusinessCaseCurrency currency; + + /* + * Migration Strategy. + */ + private MigrationStrategy businessCaseType; + + /* + * Workload discovery source. + */ + private DiscoverySource workloadDiscoverySource; + + /* + * Gets start time to use for performance. + */ + private OffsetDateTime performanceDataStartTime; + + /* + * Gets end time to use for performance. + */ + private OffsetDateTime performanceDataEndTime; + + /* + * Gets comfort factor. + */ + private Float comfortFactor; + + /* + * Gets utilization percentile for performance. + */ + private Float performanceUtilizationPercentile; + + /* + * Gets migration completion percentage per year. + */ + private List perYearMigrationCompletionPercentage; + + /* + * Gets infrastructure growth rate. + */ + private Float infrastructureGrowthRate; + + /* + * Gets wACC percentage. + */ + private Float wacc; + + /* + * Gets network cost percentage. + */ + private Float networkCostPercentage; + + /* + * Gets IaaS labour cost percentage. + */ + private Float iaasLaborCostPercentage; + + /* + * Gets PaaS labour cost percentage. + */ + private Float paasLaborCostPercentage; + + /* + * Gets Avs labour cost percentage. + */ + private Float avsLaborCostPercentage; + + /* + * Gets the business case savings option type. + */ + private SavingsOption savingsOption; + + /** + * Creates an instance of AzureSettings class. + */ + public AzureSettings() { + } + + /** + * Get the targetLocation property: Gets or sets azure location. + * + * @return the targetLocation value. + */ + public String targetLocation() { + return this.targetLocation; + } + + /** + * Set the targetLocation property: Gets or sets azure location. + * + * @param targetLocation the targetLocation value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withTargetLocation(String targetLocation) { + this.targetLocation = targetLocation; + return this; + } + + /** + * Get the discountPercentage property: Gets azure Discount percentage. + * + * @return the discountPercentage value. + */ + public Float discountPercentage() { + return this.discountPercentage; + } + + /** + * Set the discountPercentage property: Gets azure Discount percentage. + * + * @param discountPercentage the discountPercentage value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withDiscountPercentage(Float discountPercentage) { + this.discountPercentage = discountPercentage; + return this; + } + + /** + * Get the currency property: Business case Currency. + * + * @return the currency value. + */ + public BusinessCaseCurrency currency() { + return this.currency; + } + + /** + * Set the currency property: Business case Currency. + * + * @param currency the currency value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withCurrency(BusinessCaseCurrency currency) { + this.currency = currency; + return this; + } + + /** + * Get the businessCaseType property: Migration Strategy. + * + * @return the businessCaseType value. + */ + public MigrationStrategy businessCaseType() { + return this.businessCaseType; + } + + /** + * Set the businessCaseType property: Migration Strategy. + * + * @param businessCaseType the businessCaseType value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withBusinessCaseType(MigrationStrategy businessCaseType) { + this.businessCaseType = businessCaseType; + return this; + } + + /** + * Get the workloadDiscoverySource property: Workload discovery source. + * + * @return the workloadDiscoverySource value. + */ + public DiscoverySource workloadDiscoverySource() { + return this.workloadDiscoverySource; + } + + /** + * Set the workloadDiscoverySource property: Workload discovery source. + * + * @param workloadDiscoverySource the workloadDiscoverySource value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withWorkloadDiscoverySource(DiscoverySource workloadDiscoverySource) { + this.workloadDiscoverySource = workloadDiscoverySource; + return this; + } + + /** + * Get the performanceDataStartTime property: Gets start time to use for performance. + * + * @return the performanceDataStartTime value. + */ + public OffsetDateTime performanceDataStartTime() { + return this.performanceDataStartTime; + } + + /** + * Set the performanceDataStartTime property: Gets start time to use for performance. + * + * @param performanceDataStartTime the performanceDataStartTime value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withPerformanceDataStartTime(OffsetDateTime performanceDataStartTime) { + this.performanceDataStartTime = performanceDataStartTime; + return this; + } + + /** + * Get the performanceDataEndTime property: Gets end time to use for performance. + * + * @return the performanceDataEndTime value. + */ + public OffsetDateTime performanceDataEndTime() { + return this.performanceDataEndTime; + } + + /** + * Set the performanceDataEndTime property: Gets end time to use for performance. + * + * @param performanceDataEndTime the performanceDataEndTime value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withPerformanceDataEndTime(OffsetDateTime performanceDataEndTime) { + this.performanceDataEndTime = performanceDataEndTime; + return this; + } + + /** + * Get the comfortFactor property: Gets comfort factor. + * + * @return the comfortFactor value. + */ + public Float comfortFactor() { + return this.comfortFactor; + } + + /** + * Set the comfortFactor property: Gets comfort factor. + * + * @param comfortFactor the comfortFactor value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withComfortFactor(Float comfortFactor) { + this.comfortFactor = comfortFactor; + return this; + } + + /** + * Get the performanceUtilizationPercentile property: Gets utilization percentile for performance. + * + * @return the performanceUtilizationPercentile value. + */ + public Float performanceUtilizationPercentile() { + return this.performanceUtilizationPercentile; + } + + /** + * Set the performanceUtilizationPercentile property: Gets utilization percentile for performance. + * + * @param performanceUtilizationPercentile the performanceUtilizationPercentile value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withPerformanceUtilizationPercentile(Float performanceUtilizationPercentile) { + this.performanceUtilizationPercentile = performanceUtilizationPercentile; + return this; + } + + /** + * Get the perYearMigrationCompletionPercentage property: Gets migration completion percentage per year. + * + * @return the perYearMigrationCompletionPercentage value. + */ + public List perYearMigrationCompletionPercentage() { + return this.perYearMigrationCompletionPercentage; + } + + /** + * Set the perYearMigrationCompletionPercentage property: Gets migration completion percentage per year. + * + * @param perYearMigrationCompletionPercentage the perYearMigrationCompletionPercentage value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withPerYearMigrationCompletionPercentage( + List perYearMigrationCompletionPercentage) { + this.perYearMigrationCompletionPercentage = perYearMigrationCompletionPercentage; + return this; + } + + /** + * Get the infrastructureGrowthRate property: Gets infrastructure growth rate. + * + * @return the infrastructureGrowthRate value. + */ + public Float infrastructureGrowthRate() { + return this.infrastructureGrowthRate; + } + + /** + * Set the infrastructureGrowthRate property: Gets infrastructure growth rate. + * + * @param infrastructureGrowthRate the infrastructureGrowthRate value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withInfrastructureGrowthRate(Float infrastructureGrowthRate) { + this.infrastructureGrowthRate = infrastructureGrowthRate; + return this; + } + + /** + * Get the wacc property: Gets wACC percentage. + * + * @return the wacc value. + */ + public Float wacc() { + return this.wacc; + } + + /** + * Set the wacc property: Gets wACC percentage. + * + * @param wacc the wacc value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withWacc(Float wacc) { + this.wacc = wacc; + return this; + } + + /** + * Get the networkCostPercentage property: Gets network cost percentage. + * + * @return the networkCostPercentage value. + */ + public Float networkCostPercentage() { + return this.networkCostPercentage; + } + + /** + * Set the networkCostPercentage property: Gets network cost percentage. + * + * @param networkCostPercentage the networkCostPercentage value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withNetworkCostPercentage(Float networkCostPercentage) { + this.networkCostPercentage = networkCostPercentage; + return this; + } + + /** + * Get the iaasLaborCostPercentage property: Gets IaaS labour cost percentage. + * + * @return the iaasLaborCostPercentage value. + */ + public Float iaasLaborCostPercentage() { + return this.iaasLaborCostPercentage; + } + + /** + * Set the iaasLaborCostPercentage property: Gets IaaS labour cost percentage. + * + * @param iaasLaborCostPercentage the iaasLaborCostPercentage value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withIaasLaborCostPercentage(Float iaasLaborCostPercentage) { + this.iaasLaborCostPercentage = iaasLaborCostPercentage; + return this; + } + + /** + * Get the paasLaborCostPercentage property: Gets PaaS labour cost percentage. + * + * @return the paasLaborCostPercentage value. + */ + public Float paasLaborCostPercentage() { + return this.paasLaborCostPercentage; + } + + /** + * Set the paasLaborCostPercentage property: Gets PaaS labour cost percentage. + * + * @param paasLaborCostPercentage the paasLaborCostPercentage value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withPaasLaborCostPercentage(Float paasLaborCostPercentage) { + this.paasLaborCostPercentage = paasLaborCostPercentage; + return this; + } + + /** + * Get the avsLaborCostPercentage property: Gets Avs labour cost percentage. + * + * @return the avsLaborCostPercentage value. + */ + public Float avsLaborCostPercentage() { + return this.avsLaborCostPercentage; + } + + /** + * Set the avsLaborCostPercentage property: Gets Avs labour cost percentage. + * + * @param avsLaborCostPercentage the avsLaborCostPercentage value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withAvsLaborCostPercentage(Float avsLaborCostPercentage) { + this.avsLaborCostPercentage = avsLaborCostPercentage; + return this; + } + + /** + * Get the savingsOption property: Gets the business case savings option type. + * + * @return the savingsOption value. + */ + public SavingsOption savingsOption() { + return this.savingsOption; + } + + /** + * Set the savingsOption property: Gets the business case savings option type. + * + * @param savingsOption the savingsOption value to set. + * @return the AzureSettings object itself. + */ + public AzureSettings withSavingsOption(SavingsOption savingsOption) { + this.savingsOption = savingsOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetLocation() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property targetLocation in model AzureSettings")); + } + if (currency() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property currency in model AzureSettings")); + } + if (perYearMigrationCompletionPercentage() != null) { + perYearMigrationCompletionPercentage().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetLocation", this.targetLocation); + jsonWriter.writeStringField("currency", this.currency == null ? null : this.currency.toString()); + jsonWriter.writeNumberField("discountPercentage", this.discountPercentage); + jsonWriter.writeStringField("businessCaseType", + this.businessCaseType == null ? null : this.businessCaseType.toString()); + jsonWriter.writeStringField("workloadDiscoverySource", + this.workloadDiscoverySource == null ? null : this.workloadDiscoverySource.toString()); + jsonWriter.writeStringField("performanceDataStartTime", + this.performanceDataStartTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.performanceDataStartTime)); + jsonWriter.writeStringField("performanceDataEndTime", + this.performanceDataEndTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.performanceDataEndTime)); + jsonWriter.writeNumberField("comfortFactor", this.comfortFactor); + jsonWriter.writeNumberField("performanceUtilizationPercentile", this.performanceUtilizationPercentile); + jsonWriter.writeArrayField("perYearMigrationCompletionPercentage", this.perYearMigrationCompletionPercentage, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("infrastructureGrowthRate", this.infrastructureGrowthRate); + jsonWriter.writeNumberField("wacc", this.wacc); + jsonWriter.writeNumberField("networkCostPercentage", this.networkCostPercentage); + jsonWriter.writeNumberField("iaasLaborCostPercentage", this.iaasLaborCostPercentage); + jsonWriter.writeNumberField("paasLaborCostPercentage", this.paasLaborCostPercentage); + jsonWriter.writeNumberField("avsLaborCostPercentage", this.avsLaborCostPercentage); + jsonWriter.writeStringField("savingsOption", this.savingsOption == null ? null : this.savingsOption.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureSettings 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 AzureSettings. + */ + public static AzureSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureSettings deserializedAzureSettings = new AzureSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetLocation".equals(fieldName)) { + deserializedAzureSettings.targetLocation = reader.getString(); + } else if ("currency".equals(fieldName)) { + deserializedAzureSettings.currency = BusinessCaseCurrency.fromString(reader.getString()); + } else if ("discountPercentage".equals(fieldName)) { + deserializedAzureSettings.discountPercentage = reader.getNullable(JsonReader::getFloat); + } else if ("businessCaseType".equals(fieldName)) { + deserializedAzureSettings.businessCaseType = MigrationStrategy.fromString(reader.getString()); + } else if ("workloadDiscoverySource".equals(fieldName)) { + deserializedAzureSettings.workloadDiscoverySource = DiscoverySource.fromString(reader.getString()); + } else if ("performanceDataStartTime".equals(fieldName)) { + deserializedAzureSettings.performanceDataStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("performanceDataEndTime".equals(fieldName)) { + deserializedAzureSettings.performanceDataEndTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("comfortFactor".equals(fieldName)) { + deserializedAzureSettings.comfortFactor = reader.getNullable(JsonReader::getFloat); + } else if ("performanceUtilizationPercentile".equals(fieldName)) { + deserializedAzureSettings.performanceUtilizationPercentile + = reader.getNullable(JsonReader::getFloat); + } else if ("perYearMigrationCompletionPercentage".equals(fieldName)) { + List perYearMigrationCompletionPercentage + = reader.readArray( + reader1 -> AzureSettingsPerYearMigrationCompletionPercentageItem.fromJson(reader1)); + deserializedAzureSettings.perYearMigrationCompletionPercentage + = perYearMigrationCompletionPercentage; + } else if ("infrastructureGrowthRate".equals(fieldName)) { + deserializedAzureSettings.infrastructureGrowthRate = reader.getNullable(JsonReader::getFloat); + } else if ("wacc".equals(fieldName)) { + deserializedAzureSettings.wacc = reader.getNullable(JsonReader::getFloat); + } else if ("networkCostPercentage".equals(fieldName)) { + deserializedAzureSettings.networkCostPercentage = reader.getNullable(JsonReader::getFloat); + } else if ("iaasLaborCostPercentage".equals(fieldName)) { + deserializedAzureSettings.iaasLaborCostPercentage = reader.getNullable(JsonReader::getFloat); + } else if ("paasLaborCostPercentage".equals(fieldName)) { + deserializedAzureSettings.paasLaborCostPercentage = reader.getNullable(JsonReader::getFloat); + } else if ("avsLaborCostPercentage".equals(fieldName)) { + deserializedAzureSettings.avsLaborCostPercentage = reader.getNullable(JsonReader::getFloat); + } else if ("savingsOption".equals(fieldName)) { + deserializedAzureSettings.savingsOption = SavingsOption.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSettingsPerYearMigrationCompletionPercentageItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSettingsPerYearMigrationCompletionPercentageItem.java new file mode 100644 index 000000000000..d29ec978d92c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSettingsPerYearMigrationCompletionPercentageItem.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * The generic name value pair. + */ +@Fluent +public final class AzureSettingsPerYearMigrationCompletionPercentageItem + implements JsonSerializable { + /* + * The name. + */ + private String name; + + /* + * The value. + */ + private Float value; + + /** + * Creates an instance of AzureSettingsPerYearMigrationCompletionPercentageItem class. + */ + public AzureSettingsPerYearMigrationCompletionPercentageItem() { + } + + /** + * Get the name property: The name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name. + * + * @param name the name value to set. + * @return the AzureSettingsPerYearMigrationCompletionPercentageItem object itself. + */ + public AzureSettingsPerYearMigrationCompletionPercentageItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value. + * + * @return the value value. + */ + public Float value() { + return this.value; + } + + /** + * Set the value property: The value. + * + * @param value the value value to set. + * @return the AzureSettingsPerYearMigrationCompletionPercentageItem object itself. + */ + public AzureSettingsPerYearMigrationCompletionPercentageItem withValue(Float value) { + this.value = value; + 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("name", this.name); + jsonWriter.writeNumberField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureSettingsPerYearMigrationCompletionPercentageItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureSettingsPerYearMigrationCompletionPercentageItem 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 AzureSettingsPerYearMigrationCompletionPercentageItem. + */ + public static AzureSettingsPerYearMigrationCompletionPercentageItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AzureSettingsPerYearMigrationCompletionPercentageItem deserializedAzureSettingsPerYearMigrationCompletionPercentageItem + = new AzureSettingsPerYearMigrationCompletionPercentageItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAzureSettingsPerYearMigrationCompletionPercentageItem.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedAzureSettingsPerYearMigrationCompletionPercentageItem.value + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureSettingsPerYearMigrationCompletionPercentageItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlDataBaseType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlDataBaseType.java index 940b4f054dee..e1b26ee64b42 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlDataBaseType.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlDataBaseType.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for AzureSqlDataBaseType. + * Azure Sql Data Base Type. */ public final class AzureSqlDataBaseType extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlIaasSkuDto.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlIaasSkuDto.java deleted file mode 100644 index 8ab6628fea29..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlIaasSkuDto.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Class representing Azure SQL IAAS SKU. - */ -@Immutable -public final class AzureSqlIaasSkuDto implements JsonSerializable { - /* - * Gets the The Azure Compute Virtual Machine. - */ - private AzureVirtualMachineSkuDto virtualMachineSize; - - /* - * Gets the The list of data disk sizes. - */ - private List dataDiskSizes; - - /* - * Gets the The list of log disk sizes. - */ - private List logDiskSizes; - - /* - * Gets the target type. - */ - private TargetType azureSqlTargetType; - - /** - * Creates an instance of AzureSqlIaasSkuDto class. - */ - public AzureSqlIaasSkuDto() { - } - - /** - * Get the virtualMachineSize property: Gets the The Azure Compute Virtual Machine. - * - * @return the virtualMachineSize value. - */ - public AzureVirtualMachineSkuDto virtualMachineSize() { - return this.virtualMachineSize; - } - - /** - * Get the dataDiskSizes property: Gets the The list of data disk sizes. - * - * @return the dataDiskSizes value. - */ - public List dataDiskSizes() { - return this.dataDiskSizes; - } - - /** - * Get the logDiskSizes property: Gets the The list of log disk sizes. - * - * @return the logDiskSizes value. - */ - public List logDiskSizes() { - return this.logDiskSizes; - } - - /** - * Get the azureSqlTargetType property: Gets the target type. - * - * @return the azureSqlTargetType value. - */ - public TargetType azureSqlTargetType() { - return this.azureSqlTargetType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualMachineSize() != null) { - virtualMachineSize().validate(); - } - if (dataDiskSizes() != null) { - dataDiskSizes().forEach(e -> e.validate()); - } - if (logDiskSizes() != null) { - logDiskSizes().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureSqlIaasSkuDto from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureSqlIaasSkuDto 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 AzureSqlIaasSkuDto. - */ - public static AzureSqlIaasSkuDto fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureSqlIaasSkuDto deserializedAzureSqlIaasSkuDto = new AzureSqlIaasSkuDto(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("virtualMachineSize".equals(fieldName)) { - deserializedAzureSqlIaasSkuDto.virtualMachineSize = AzureVirtualMachineSkuDto.fromJson(reader); - } else if ("dataDiskSizes".equals(fieldName)) { - List dataDiskSizes - = reader.readArray(reader1 -> AzureManagedDiskSkuDto.fromJson(reader1)); - deserializedAzureSqlIaasSkuDto.dataDiskSizes = dataDiskSizes; - } else if ("logDiskSizes".equals(fieldName)) { - List logDiskSizes - = reader.readArray(reader1 -> AzureManagedDiskSkuDto.fromJson(reader1)); - deserializedAzureSqlIaasSkuDto.logDiskSizes = logDiskSizes; - } else if ("azureSqlTargetType".equals(fieldName)) { - deserializedAzureSqlIaasSkuDto.azureSqlTargetType = TargetType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureSqlIaasSkuDto; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlInstanceType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlInstanceType.java index e6fe8cc14a11..a40550b9f35e 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlInstanceType.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlInstanceType.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for AzureSqlInstanceType. + * Azure Sql Instance Type. */ public final class AzureSqlInstanceType extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlPaasSkuDto.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlPaasSkuDto.java deleted file mode 100644 index f041c6a3ef67..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlPaasSkuDto.java +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Class representing Azure SQL PAAS SKU. - */ -@Immutable -public final class AzureSqlPaasSkuDto implements JsonSerializable { - /* - * Gets the service tier. - */ - private AzureSqlServiceTier azureSqlServiceTier; - - /* - * Gets the compute tier. - */ - private ComputeTier azureSqlComputeTier; - - /* - * Gets the hardware generation. - */ - private HardwareGeneration azureSqlHardwareGeneration; - - /* - * Gets the storage maximum size in megabytes. - */ - private Float storageMaxSizeInMB; - - /* - * Gets the predicted data size in megabytes in the Azure SQL, will impact the - * billing cost. - */ - private Float predictedDataSizeInMB; - - /* - * Gets the predicted log size in megabytes in the Azure SQL, will impact the - * billing cost. - */ - private Float predictedLogSizeInMB; - - /* - * Gets the number of cores. - */ - private Integer cores; - - /* - * Gets the target type. - */ - private TargetType azureSqlTargetType; - - /** - * Creates an instance of AzureSqlPaasSkuDto class. - */ - public AzureSqlPaasSkuDto() { - } - - /** - * Get the azureSqlServiceTier property: Gets the service tier. - * - * @return the azureSqlServiceTier value. - */ - public AzureSqlServiceTier azureSqlServiceTier() { - return this.azureSqlServiceTier; - } - - /** - * Get the azureSqlComputeTier property: Gets the compute tier. - * - * @return the azureSqlComputeTier value. - */ - public ComputeTier azureSqlComputeTier() { - return this.azureSqlComputeTier; - } - - /** - * Get the azureSqlHardwareGeneration property: Gets the hardware generation. - * - * @return the azureSqlHardwareGeneration value. - */ - public HardwareGeneration azureSqlHardwareGeneration() { - return this.azureSqlHardwareGeneration; - } - - /** - * Get the storageMaxSizeInMB property: Gets the storage maximum size in megabytes. - * - * @return the storageMaxSizeInMB value. - */ - public Float storageMaxSizeInMB() { - return this.storageMaxSizeInMB; - } - - /** - * Get the predictedDataSizeInMB property: Gets the predicted data size in megabytes in the Azure SQL, will impact - * the - * billing cost. - * - * @return the predictedDataSizeInMB value. - */ - public Float predictedDataSizeInMB() { - return this.predictedDataSizeInMB; - } - - /** - * Get the predictedLogSizeInMB property: Gets the predicted log size in megabytes in the Azure SQL, will impact the - * billing cost. - * - * @return the predictedLogSizeInMB value. - */ - public Float predictedLogSizeInMB() { - return this.predictedLogSizeInMB; - } - - /** - * Get the cores property: Gets the number of cores. - * - * @return the cores value. - */ - public Integer cores() { - return this.cores; - } - - /** - * Get the azureSqlTargetType property: Gets the target type. - * - * @return the azureSqlTargetType value. - */ - public TargetType azureSqlTargetType() { - return this.azureSqlTargetType; - } - - /** - * 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 AzureSqlPaasSkuDto from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureSqlPaasSkuDto 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 AzureSqlPaasSkuDto. - */ - public static AzureSqlPaasSkuDto fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureSqlPaasSkuDto deserializedAzureSqlPaasSkuDto = new AzureSqlPaasSkuDto(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("azureSqlServiceTier".equals(fieldName)) { - deserializedAzureSqlPaasSkuDto.azureSqlServiceTier - = AzureSqlServiceTier.fromString(reader.getString()); - } else if ("azureSqlComputeTier".equals(fieldName)) { - deserializedAzureSqlPaasSkuDto.azureSqlComputeTier = ComputeTier.fromString(reader.getString()); - } else if ("azureSqlHardwareGeneration".equals(fieldName)) { - deserializedAzureSqlPaasSkuDto.azureSqlHardwareGeneration - = HardwareGeneration.fromString(reader.getString()); - } else if ("storageMaxSizeInMB".equals(fieldName)) { - deserializedAzureSqlPaasSkuDto.storageMaxSizeInMB = reader.getNullable(JsonReader::getFloat); - } else if ("predictedDataSizeInMB".equals(fieldName)) { - deserializedAzureSqlPaasSkuDto.predictedDataSizeInMB = reader.getNullable(JsonReader::getFloat); - } else if ("predictedLogSizeInMB".equals(fieldName)) { - deserializedAzureSqlPaasSkuDto.predictedLogSizeInMB = reader.getNullable(JsonReader::getFloat); - } else if ("cores".equals(fieldName)) { - deserializedAzureSqlPaasSkuDto.cores = reader.getNullable(JsonReader::getInt); - } else if ("azureSqlTargetType".equals(fieldName)) { - deserializedAzureSqlPaasSkuDto.azureSqlTargetType = TargetType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureSqlPaasSkuDto; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlPurchaseModel.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlPurchaseModel.java index 724c7be29e48..25697ad4b3c6 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlPurchaseModel.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlPurchaseModel.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for AzureSqlPurchaseModel. + * Azure Sql Purchase Model. */ public final class AzureSqlPurchaseModel extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlServiceTier.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlServiceTier.java index 75d52a4733b1..82af29c0d4da 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlServiceTier.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlServiceTier.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for AzureSqlServiceTier. + * Azure Sql Service Tier. */ public final class AzureSqlServiceTier extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlServiceTierV3.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlServiceTierV3.java new file mode 100644 index 000000000000..290475e653eb --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlServiceTierV3.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure Sql Service Tier V3. + */ +public final class AzureSqlServiceTierV3 extends ExpandableStringEnum { + /** + * Static value SqlService_Unknown for AzureSqlServiceTierV3. + */ + public static final AzureSqlServiceTierV3 SQL_SERVICE_UNKNOWN = fromString("SqlService_Unknown"); + + /** + * Static value SqlService_Automatic for AzureSqlServiceTierV3. + */ + public static final AzureSqlServiceTierV3 SQL_SERVICE_AUTOMATIC = fromString("SqlService_Automatic"); + + /** + * Static value SqlService_GeneralPurpose for AzureSqlServiceTierV3. + */ + public static final AzureSqlServiceTierV3 SQL_SERVICE_GENERAL_PURPOSE = fromString("SqlService_GeneralPurpose"); + + /** + * Static value SqlService_BusinessCritical for AzureSqlServiceTierV3. + */ + public static final AzureSqlServiceTierV3 SQL_SERVICE_BUSINESS_CRITICAL = fromString("SqlService_BusinessCritical"); + + /** + * Static value SqlService_HyperScale for AzureSqlServiceTierV3. + */ + public static final AzureSqlServiceTierV3 SQL_SERVICE_HYPER_SCALE = fromString("SqlService_HyperScale"); + + /** + * Creates a new instance of AzureSqlServiceTierV3 value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureSqlServiceTierV3() { + } + + /** + * Creates or finds a AzureSqlServiceTierV3 from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureSqlServiceTierV3. + */ + public static AzureSqlServiceTierV3 fromString(String name) { + return fromString(name, AzureSqlServiceTierV3.class); + } + + /** + * Gets known AzureSqlServiceTierV3 values. + * + * @return known AzureSqlServiceTierV3 values. + */ + public static Collection values() { + return values(AzureSqlServiceTierV3.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlSummary.java new file mode 100644 index 000000000000..c419e05d9e47 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureSqlSummary.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Shows the Azure SQL details. + */ +@Immutable +public final class AzureSqlSummary implements JsonSerializable { + /* + * Estimated cost by recommended offer. + */ + private List estimatedCostByOffer; + + /* + * Distribution by service tiers, retaining just to support older Business cases. + */ + private List distributionByServiceTier; + + /* + * Distribution by service tiers for SQL MI. + */ + private List distributionByServiceTierForSqlMi; + + /* + * Distribution by service tiers for SQL DB. + */ + private List distributionByServiceTierForSqlDb; + + /** + * Creates an instance of AzureSqlSummary class. + */ + public AzureSqlSummary() { + } + + /** + * Get the estimatedCostByOffer property: Estimated cost by recommended offer. + * + * @return the estimatedCostByOffer value. + */ + public List estimatedCostByOffer() { + return this.estimatedCostByOffer; + } + + /** + * Get the distributionByServiceTier property: Distribution by service tiers, retaining just to support older + * Business cases. + * + * @return the distributionByServiceTier value. + */ + public List distributionByServiceTier() { + return this.distributionByServiceTier; + } + + /** + * Get the distributionByServiceTierForSqlMi property: Distribution by service tiers for SQL MI. + * + * @return the distributionByServiceTierForSqlMi value. + */ + public List distributionByServiceTierForSqlMi() { + return this.distributionByServiceTierForSqlMi; + } + + /** + * Get the distributionByServiceTierForSqlDb property: Distribution by service tiers for SQL DB. + * + * @return the distributionByServiceTierForSqlDb value. + */ + public List distributionByServiceTierForSqlDb() { + return this.distributionByServiceTierForSqlDb; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (estimatedCostByOffer() != null) { + estimatedCostByOffer().forEach(e -> e.validate()); + } + if (distributionByServiceTier() != null) { + distributionByServiceTier().forEach(e -> e.validate()); + } + if (distributionByServiceTierForSqlMi() != null) { + distributionByServiceTierForSqlMi().forEach(e -> e.validate()); + } + if (distributionByServiceTierForSqlDb() != null) { + distributionByServiceTierForSqlDb().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureSqlSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureSqlSummary 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 AzureSqlSummary. + */ + public static AzureSqlSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureSqlSummary deserializedAzureSqlSummary = new AzureSqlSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("estimatedCostByOffer".equals(fieldName)) { + List estimatedCostByOffer + = reader.readArray(reader1 -> EstimatedCostByOffer.fromJson(reader1)); + deserializedAzureSqlSummary.estimatedCostByOffer = estimatedCostByOffer; + } else if ("distributionByServiceTier".equals(fieldName)) { + List distributionByServiceTier + = reader.readArray(reader1 -> SqlServiceTier.fromJson(reader1)); + deserializedAzureSqlSummary.distributionByServiceTier = distributionByServiceTier; + } else if ("distributionByServiceTierForSqlMi".equals(fieldName)) { + List distributionByServiceTierForSqlMi + = reader.readArray(reader1 -> SqlServiceTier.fromJson(reader1)); + deserializedAzureSqlSummary.distributionByServiceTierForSqlMi = distributionByServiceTierForSqlMi; + } else if ("distributionByServiceTierForSqlDb".equals(fieldName)) { + List distributionByServiceTierForSqlDb + = reader.readArray(reader1 -> SqlServiceTier.fromJson(reader1)); + deserializedAzureSqlSummary.distributionByServiceTierForSqlDb = distributionByServiceTierForSqlDb; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureSqlSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureStorageRedundancy.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureStorageRedundancy.java index 2b01195310cb..43fb6c834095 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureStorageRedundancy.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureStorageRedundancy.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for AzureStorageRedundancy. + * Azure Storage Redundancy. */ public final class AzureStorageRedundancy extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureTarget.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureTarget.java new file mode 100644 index 000000000000..3a342f8fa787 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureTarget.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure Target. + */ +public final class AzureTarget extends ExpandableStringEnum { + /** + * Static value Unknown for AzureTarget. + */ + public static final AzureTarget UNKNOWN = fromString("Unknown"); + + /** + * Static value SqlDatabase for AzureTarget. + */ + public static final AzureTarget SQL_DATABASE = fromString("SqlDatabase"); + + /** + * Static value SqlMI for AzureTarget. + */ + public static final AzureTarget SQL_MI = fromString("SqlMI"); + + /** + * Static value FlexServerPG for AzureTarget. + */ + public static final AzureTarget FLEX_SERVER_PG = fromString("FlexServerPG"); + + /** + * Static value OracleIaasVM for AzureTarget. + */ + public static final AzureTarget ORACLE_IAAS_VM = fromString("OracleIaasVM"); + + /** + * Static value AzureSpringApps for AzureTarget. + */ + public static final AzureTarget AZURE_SPRING_APPS = fromString("AzureSpringApps"); + + /** + * Static value SAPAzureInstance for AzureTarget. + */ + public static final AzureTarget SAPAZURE_INSTANCE = fromString("SAPAzureInstance"); + + /** + * Static value AKS for AzureTarget. + */ + public static final AzureTarget AKS = fromString("AKS"); + + /** + * Static value MySQLAzureFlexServer for AzureTarget. + */ + public static final AzureTarget MY_SQLAZURE_FLEX_SERVER = fromString("MySQLAzureFlexServer"); + + /** + * Static value AzureSQLVM for AzureTarget. + */ + public static final AzureTarget AZURE_SQLVM = fromString("AzureSQLVM"); + + /** + * Static value AzureVM for AzureTarget. + */ + public static final AzureTarget AZURE_VM = fromString("AzureVM"); + + /** + * Static value AzureAppService for AzureTarget. + */ + public static final AzureTarget AZURE_APP_SERVICE = fromString("AzureAppService"); + + /** + * Static value AzureAppServiceContainer for AzureTarget. + */ + public static final AzureTarget AZURE_APP_SERVICE_CONTAINER = fromString("AzureAppServiceContainer"); + + /** + * Static value Avs for AzureTarget. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVirtualMachineSkuDto.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVirtualMachineSkuDto.java deleted file mode 100644 index ec95ec03a490..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVirtualMachineSkuDto.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Azure Virtual Machine SKU. - */ -@Immutable -public final class AzureVirtualMachineSkuDto implements JsonSerializable { - /* - * Gets the Virtual Machine Family, for example : standardMSFamily. - */ - private AzureVmFamily azureVmFamily; - - /* - * Gets the Compute Size in vCores. - */ - private Integer cores; - - /* - * Gets the Virtual Machine SKU name,: E.g. : Standard_F16s. - */ - private AzureVmSize azureSkuName; - - /* - * Gets the Available vCores. This can be less than the vCores in the Constrained - * vCPU VM Sizes. - */ - private Integer availableCores; - - /* - * Gets the Max network interfaces. - */ - private Integer maxNetworkInterfaces; - - /** - * Creates an instance of AzureVirtualMachineSkuDto class. - */ - public AzureVirtualMachineSkuDto() { - } - - /** - * Get the azureVmFamily property: Gets the Virtual Machine Family, for example : standardMSFamily. - * - * @return the azureVmFamily value. - */ - public AzureVmFamily azureVmFamily() { - return this.azureVmFamily; - } - - /** - * Get the cores property: Gets the Compute Size in vCores. - * - * @return the cores value. - */ - public Integer cores() { - return this.cores; - } - - /** - * Get the azureSkuName property: Gets the Virtual Machine SKU name,: E.g. : Standard_F16s. - * - * @return the azureSkuName value. - */ - public AzureVmSize azureSkuName() { - return this.azureSkuName; - } - - /** - * Get the availableCores property: Gets the Available vCores. This can be less than the vCores in the Constrained - * vCPU VM Sizes. - * - * @return the availableCores value. - */ - public Integer availableCores() { - return this.availableCores; - } - - /** - * Get the maxNetworkInterfaces property: Gets the Max network interfaces. - * - * @return the maxNetworkInterfaces value. - */ - public Integer maxNetworkInterfaces() { - return this.maxNetworkInterfaces; - } - - /** - * 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 AzureVirtualMachineSkuDto from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVirtualMachineSkuDto 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 AzureVirtualMachineSkuDto. - */ - public static AzureVirtualMachineSkuDto fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVirtualMachineSkuDto deserializedAzureVirtualMachineSkuDto = new AzureVirtualMachineSkuDto(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("azureVmFamily".equals(fieldName)) { - deserializedAzureVirtualMachineSkuDto.azureVmFamily = AzureVmFamily.fromString(reader.getString()); - } else if ("cores".equals(fieldName)) { - deserializedAzureVirtualMachineSkuDto.cores = reader.getNullable(JsonReader::getInt); - } else if ("azureSkuName".equals(fieldName)) { - deserializedAzureVirtualMachineSkuDto.azureSkuName = AzureVmSize.fromString(reader.getString()); - } else if ("availableCores".equals(fieldName)) { - deserializedAzureVirtualMachineSkuDto.availableCores = reader.getNullable(JsonReader::getInt); - } else if ("maxNetworkInterfaces".equals(fieldName)) { - deserializedAzureVirtualMachineSkuDto.maxNetworkInterfaces = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVirtualMachineSkuDto; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmCategory.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmCategory.java new file mode 100644 index 000000000000..225b2c6bd0cc --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmCategory.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure VM Category. + */ +public final class AzureVmCategory extends ExpandableStringEnum { + /** + * Static value All for AzureVmCategory. + */ + public static final AzureVmCategory ALL = fromString("All"); + + /** + * Static value ComputeOptimized for AzureVmCategory. + */ + public static final AzureVmCategory COMPUTE_OPTIMIZED = fromString("ComputeOptimized"); + + /** + * Static value GeneralPurpose for AzureVmCategory. + */ + public static final AzureVmCategory GENERAL_PURPOSE = fromString("GeneralPurpose"); + + /** + * Static value GpuOptimized for AzureVmCategory. + */ + public static final AzureVmCategory GPU_OPTIMIZED = fromString("GpuOptimized"); + + /** + * Static value HighPerformanceCompute for AzureVmCategory. + */ + public static final AzureVmCategory HIGH_PERFORMANCE_COMPUTE = fromString("HighPerformanceCompute"); + + /** + * Static value MemoryOptimized for AzureVmCategory. + */ + public static final AzureVmCategory MEMORY_OPTIMIZED = fromString("MemoryOptimized"); + + /** + * Static value StorageOptimized for AzureVmCategory. + */ + public static final AzureVmCategory STORAGE_OPTIMIZED = fromString("StorageOptimized"); + + /** + * Static value Isolated for AzureVmCategory. + */ + public static final AzureVmCategory ISOLATED = fromString("Isolated"); + + /** + * Creates a new instance of AzureVmCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureVmCategory() { + } + + /** + * Creates or finds a AzureVmCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureVmCategory. + */ + public static AzureVmCategory fromString(String name) { + return fromString(name, AzureVmCategory.class); + } + + /** + * Gets known AzureVmCategory values. + * + * @return known AzureVmCategory values. + */ + public static Collection values() { + return values(AzureVmCategory.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmFamily.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmFamily.java index 3b59bb72087a..ea8a28b60ca2 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmFamily.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmFamily.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for AzureVmFamily. + * Azure VM Family. */ public final class AzureVmFamily extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmSize.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmSize.java deleted file mode 100644 index e44f7552dcc7..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmSize.java +++ /dev/null @@ -1,2491 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AzureVmSize. - */ -public final class AzureVmSize extends ExpandableStringEnum { - /** - * Static value Unknown for AzureVmSize. - */ - public static final AzureVmSize UNKNOWN = fromString("Unknown"); - - /** - * Static value Basic_A0 for AzureVmSize. - */ - public static final AzureVmSize BASIC_A0 = fromString("Basic_A0"); - - /** - * Static value Basic_A1 for AzureVmSize. - */ - public static final AzureVmSize BASIC_A1 = fromString("Basic_A1"); - - /** - * Static value Basic_A2 for AzureVmSize. - */ - public static final AzureVmSize BASIC_A2 = fromString("Basic_A2"); - - /** - * Static value Basic_A3 for AzureVmSize. - */ - public static final AzureVmSize BASIC_A3 = fromString("Basic_A3"); - - /** - * Static value Basic_A4 for AzureVmSize. - */ - public static final AzureVmSize BASIC_A4 = fromString("Basic_A4"); - - /** - * Static value Standard_A0 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A0 = fromString("Standard_A0"); - - /** - * Static value Standard_A1 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A1 = fromString("Standard_A1"); - - /** - * Static value Standard_A2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A2 = fromString("Standard_A2"); - - /** - * Static value Standard_A3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A3 = fromString("Standard_A3"); - - /** - * Static value Standard_A4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A4 = fromString("Standard_A4"); - - /** - * Static value Standard_A5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A5 = fromString("Standard_A5"); - - /** - * Static value Standard_A6 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A6 = fromString("Standard_A6"); - - /** - * Static value Standard_A7 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A7 = fromString("Standard_A7"); - - /** - * Static value Standard_A8 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A8 = fromString("Standard_A8"); - - /** - * Static value Standard_A9 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A9 = fromString("Standard_A9"); - - /** - * Static value Standard_A10 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A10 = fromString("Standard_A10"); - - /** - * Static value Standard_A11 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A11 = fromString("Standard_A11"); - - /** - * Static value Standard_A1_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A1_V2 = fromString("Standard_A1_v2"); - - /** - * Static value Standard_A2_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A2_V2 = fromString("Standard_A2_v2"); - - /** - * Static value Standard_A4_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A4_V2 = fromString("Standard_A4_v2"); - - /** - * Static value Standard_A8_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A8_V2 = fromString("Standard_A8_v2"); - - /** - * Static value Standard_A2m_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A2M_V2 = fromString("Standard_A2m_v2"); - - /** - * Static value Standard_A4m_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A4M_V2 = fromString("Standard_A4m_v2"); - - /** - * Static value Standard_A8m_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_A8M_V2 = fromString("Standard_A8m_v2"); - - /** - * Static value Standard_D1 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D1 = fromString("Standard_D1"); - - /** - * Static value Standard_D2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2 = fromString("Standard_D2"); - - /** - * Static value Standard_D3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D3 = fromString("Standard_D3"); - - /** - * Static value Standard_D4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4 = fromString("Standard_D4"); - - /** - * Static value Standard_D11 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D11 = fromString("Standard_D11"); - - /** - * Static value Standard_D12 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D12 = fromString("Standard_D12"); - - /** - * Static value Standard_D13 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D13 = fromString("Standard_D13"); - - /** - * Static value Standard_D14 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D14 = fromString("Standard_D14"); - - /** - * Static value Standard_D1_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D1_V2 = fromString("Standard_D1_v2"); - - /** - * Static value Standard_D2_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2_V2 = fromString("Standard_D2_v2"); - - /** - * Static value Standard_D3_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D3_V2 = fromString("Standard_D3_v2"); - - /** - * Static value Standard_D4_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4_V2 = fromString("Standard_D4_v2"); - - /** - * Static value Standard_D5_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D5_V2 = fromString("Standard_D5_v2"); - - /** - * Static value Standard_D11_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D11_V2 = fromString("Standard_D11_v2"); - - /** - * Static value Standard_D12_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D12_V2 = fromString("Standard_D12_v2"); - - /** - * Static value Standard_D13_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D13_V2 = fromString("Standard_D13_v2"); - - /** - * Static value Standard_D14_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D14_V2 = fromString("Standard_D14_v2"); - - /** - * Static value Standard_D15_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D15_V2 = fromString("Standard_D15_v2"); - - /** - * Static value Standard_DS1 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS1 = fromString("Standard_DS1"); - - /** - * Static value Standard_DS2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS2 = fromString("Standard_DS2"); - - /** - * Static value Standard_DS3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS3 = fromString("Standard_DS3"); - - /** - * Static value Standard_DS4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS4 = fromString("Standard_DS4"); - - /** - * Static value Standard_DS11 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS11 = fromString("Standard_DS11"); - - /** - * Static value Standard_DS12 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS12 = fromString("Standard_DS12"); - - /** - * Static value Standard_DS13 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS13 = fromString("Standard_DS13"); - - /** - * Static value Standard_DS14 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS14 = fromString("Standard_DS14"); - - /** - * Static value Standard_DS1_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS1_V2 = fromString("Standard_DS1_v2"); - - /** - * Static value Standard_DS2_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS2_V2 = fromString("Standard_DS2_v2"); - - /** - * Static value Standard_DS3_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS3_V2 = fromString("Standard_DS3_v2"); - - /** - * Static value Standard_DS4_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS4_V2 = fromString("Standard_DS4_v2"); - - /** - * Static value Standard_DS5_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS5_V2 = fromString("Standard_DS5_v2"); - - /** - * Static value Standard_DS11_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS11_V2 = fromString("Standard_DS11_v2"); - - /** - * Static value Standard_DS12_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS12_V2 = fromString("Standard_DS12_v2"); - - /** - * Static value Standard_DS13_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS13_V2 = fromString("Standard_DS13_v2"); - - /** - * Static value Standard_DS14_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS14_V2 = fromString("Standard_DS14_v2"); - - /** - * Static value Standard_DS15_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS15_V2 = fromString("Standard_DS15_v2"); - - /** - * Static value Standard_F1 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F1 = fromString("Standard_F1"); - - /** - * Static value Standard_F2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F2 = fromString("Standard_F2"); - - /** - * Static value Standard_F4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F4 = fromString("Standard_F4"); - - /** - * Static value Standard_F8 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F8 = fromString("Standard_F8"); - - /** - * Static value Standard_F16 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F16 = fromString("Standard_F16"); - - /** - * Static value Standard_F1s for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F1S = fromString("Standard_F1s"); - - /** - * Static value Standard_F2s for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F2S = fromString("Standard_F2s"); - - /** - * Static value Standard_F4s for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F4S = fromString("Standard_F4s"); - - /** - * Static value Standard_F8s for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F8S = fromString("Standard_F8s"); - - /** - * Static value Standard_F16s for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F16S = fromString("Standard_F16s"); - - /** - * Static value Standard_G1 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_G1 = fromString("Standard_G1"); - - /** - * Static value Standard_G2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_G2 = fromString("Standard_G2"); - - /** - * Static value Standard_G3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_G3 = fromString("Standard_G3"); - - /** - * Static value Standard_G4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_G4 = fromString("Standard_G4"); - - /** - * Static value Standard_G5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_G5 = fromString("Standard_G5"); - - /** - * Static value Standard_GS1 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_GS1 = fromString("Standard_GS1"); - - /** - * Static value Standard_GS2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_GS2 = fromString("Standard_GS2"); - - /** - * Static value Standard_GS3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_GS3 = fromString("Standard_GS3"); - - /** - * Static value Standard_GS4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_GS4 = fromString("Standard_GS4"); - - /** - * Static value Standard_GS5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_GS5 = fromString("Standard_GS5"); - - /** - * Static value Standard_H8 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_H8 = fromString("Standard_H8"); - - /** - * Static value Standard_H16 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_H16 = fromString("Standard_H16"); - - /** - * Static value Standard_H8m for AzureVmSize. - */ - public static final AzureVmSize STANDARD_H8M = fromString("Standard_H8m"); - - /** - * Static value Standard_H16m for AzureVmSize. - */ - public static final AzureVmSize STANDARD_H16M = fromString("Standard_H16m"); - - /** - * Static value Standard_H16r for AzureVmSize. - */ - public static final AzureVmSize STANDARD_H16R = fromString("Standard_H16r"); - - /** - * Static value Standard_H16mr for AzureVmSize. - */ - public static final AzureVmSize STANDARD_H16MR = fromString("Standard_H16mr"); - - /** - * Static value Standard_L4s for AzureVmSize. - */ - public static final AzureVmSize STANDARD_L4S = fromString("Standard_L4s"); - - /** - * Static value Standard_L8s for AzureVmSize. - */ - public static final AzureVmSize STANDARD_L8S = fromString("Standard_L8s"); - - /** - * Static value Standard_L16s for AzureVmSize. - */ - public static final AzureVmSize STANDARD_L16S = fromString("Standard_L16s"); - - /** - * Static value Standard_L32s for AzureVmSize. - */ - public static final AzureVmSize STANDARD_L32S = fromString("Standard_L32s"); - - /** - * Static value Standard_D2s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2S_V3 = fromString("Standard_D2s_v3"); - - /** - * Static value Standard_D4s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4S_V3 = fromString("Standard_D4s_v3"); - - /** - * Static value Standard_D8s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D8S_V3 = fromString("Standard_D8s_v3"); - - /** - * Static value Standard_D16s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D16S_V3 = fromString("Standard_D16s_v3"); - - /** - * Static value Standard_D32s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D32S_V3 = fromString("Standard_D32s_v3"); - - /** - * Static value Standard_D64s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D64S_V3 = fromString("Standard_D64s_v3"); - - /** - * Static value Standard_D2_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2_V3 = fromString("Standard_D2_v3"); - - /** - * Static value Standard_D4_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4_V3 = fromString("Standard_D4_v3"); - - /** - * Static value Standard_D8_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D8_V3 = fromString("Standard_D8_v3"); - - /** - * Static value Standard_D16_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D16_V3 = fromString("Standard_D16_v3"); - - /** - * Static value Standard_D32_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D32_V3 = fromString("Standard_D32_v3"); - - /** - * Static value Standard_D64_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D64_V3 = fromString("Standard_D64_v3"); - - /** - * Static value Standard_F2s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F2S_V2 = fromString("Standard_F2s_v2"); - - /** - * Static value Standard_F4s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F4S_V2 = fromString("Standard_F4s_v2"); - - /** - * Static value Standard_F8s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F8S_V2 = fromString("Standard_F8s_v2"); - - /** - * Static value Standard_F16s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F16S_V2 = fromString("Standard_F16s_v2"); - - /** - * Static value Standard_F32s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F32S_V2 = fromString("Standard_F32s_v2"); - - /** - * Static value Standard_F64s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F64S_V2 = fromString("Standard_F64s_v2"); - - /** - * Static value Standard_F72s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F72S_V2 = fromString("Standard_F72s_v2"); - - /** - * Static value Standard_E2_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2_V3 = fromString("Standard_E2_v3"); - - /** - * Static value Standard_E4_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4_V3 = fromString("Standard_E4_v3"); - - /** - * Static value Standard_E8_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_V3 = fromString("Standard_E8_v3"); - - /** - * Static value Standard_E16_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_V3 = fromString("Standard_E16_v3"); - - /** - * Static value Standard_E32_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_V3 = fromString("Standard_E32_v3"); - - /** - * Static value Standard_E64_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_V3 = fromString("Standard_E64_v3"); - - /** - * Static value Standard_E2s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2S_V3 = fromString("Standard_E2s_v3"); - - /** - * Static value Standard_E4s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4S_V3 = fromString("Standard_E4s_v3"); - - /** - * Static value Standard_E8s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8S_V3 = fromString("Standard_E8s_v3"); - - /** - * Static value Standard_E16s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16S_V3 = fromString("Standard_E16s_v3"); - - /** - * Static value Standard_E32s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32S_V3 = fromString("Standard_E32s_v3"); - - /** - * Static value Standard_E64s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64S_V3 = fromString("Standard_E64s_v3"); - - /** - * Static value Standard_M64s for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M64S = fromString("Standard_M64s"); - - /** - * Static value Standard_M64ms for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M64MS = fromString("Standard_M64ms"); - - /** - * Static value Standard_M128s for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M128S = fromString("Standard_M128s"); - - /** - * Static value Standard_M128ms for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M128MS = fromString("Standard_M128ms"); - - /** - * Static value Standard_DC2s for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DC2S = fromString("Standard_DC2s"); - - /** - * Static value Standard_DC4s for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DC4S = fromString("Standard_DC4s"); - - /** - * Static value Standard_E20_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E20_V3 = fromString("Standard_E20_v3"); - - /** - * Static value Standard_E20s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E20S_V3 = fromString("Standard_E20s_v3"); - - /** - * Static value Standard_E64i_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64I_V3 = fromString("Standard_E64i_v3"); - - /** - * Static value Standard_E64is_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64IS_V3 = fromString("Standard_E64is_v3"); - - /** - * Static value Standard_M8ms for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M8MS = fromString("Standard_M8ms"); - - /** - * Static value Standard_M16ms for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M16MS = fromString("Standard_M16ms"); - - /** - * Static value Standard_M32ls for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M32LS = fromString("Standard_M32ls"); - - /** - * Static value Standard_M32ms for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M32MS = fromString("Standard_M32ms"); - - /** - * Static value Standard_M32ts for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M32TS = fromString("Standard_M32ts"); - - /** - * Static value Standard_M64 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M64 = fromString("Standard_M64"); - - /** - * Static value Standard_M64ls for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M64LS = fromString("Standard_M64ls"); - - /** - * Static value Standard_M64m for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M64M = fromString("Standard_M64m"); - - /** - * Static value Standard_M128 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M128 = fromString("Standard_M128"); - - /** - * Static value Standard_M128m for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M128M = fromString("Standard_M128m"); - - /** - * Static value Standard_L8s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_L8S_V2 = fromString("Standard_L8s_v2"); - - /** - * Static value Standard_L16s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_L16S_V2 = fromString("Standard_L16s_v2"); - - /** - * Static value Standard_L32s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_L32S_V2 = fromString("Standard_L32s_v2"); - - /** - * Static value Standard_L48s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_L48S_V2 = fromString("Standard_L48s_v2"); - - /** - * Static value Standard_L64s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_L64S_V2 = fromString("Standard_L64s_v2"); - - /** - * Static value Standard_L80s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_L80S_V2 = fromString("Standard_L80s_v2"); - - /** - * Static value Standard_D2_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2_V4 = fromString("Standard_D2_v4"); - - /** - * Static value Standard_D4_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4_V4 = fromString("Standard_D4_v4"); - - /** - * Static value Standard_D8_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D8_V4 = fromString("Standard_D8_v4"); - - /** - * Static value Standard_D16_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D16_V4 = fromString("Standard_D16_v4"); - - /** - * Static value Standard_D32_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D32_V4 = fromString("Standard_D32_v4"); - - /** - * Static value Standard_D48_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D48_V4 = fromString("Standard_D48_v4"); - - /** - * Static value Standard_D64_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D64_V4 = fromString("Standard_D64_v4"); - - /** - * Static value Standard_D2s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2S_V4 = fromString("Standard_D2s_v4"); - - /** - * Static value Standard_D4s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4S_V4 = fromString("Standard_D4s_v4"); - - /** - * Static value Standard_D8s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D8S_V4 = fromString("Standard_D8s_v4"); - - /** - * Static value Standard_D16s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D16S_V4 = fromString("Standard_D16s_v4"); - - /** - * Static value Standard_D32s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D32S_V4 = fromString("Standard_D32s_v4"); - - /** - * Static value Standard_D48s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D48S_V4 = fromString("Standard_D48s_v4"); - - /** - * Static value Standard_D64s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D64S_V4 = fromString("Standard_D64s_v4"); - - /** - * Static value Standard_D2d_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2D_V4 = fromString("Standard_D2d_v4"); - - /** - * Static value Standard_D4d_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4D_V4 = fromString("Standard_D4d_v4"); - - /** - * Static value Standard_D8d_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D8D_V4 = fromString("Standard_D8d_v4"); - - /** - * Static value Standard_D16d_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D16D_V4 = fromString("Standard_D16d_v4"); - - /** - * Static value Standard_D32d_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D32D_V4 = fromString("Standard_D32d_v4"); - - /** - * Static value Standard_D48d_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D48D_V4 = fromString("Standard_D48d_v4"); - - /** - * Static value Standard_D64d_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D64D_V4 = fromString("Standard_D64d_v4"); - - /** - * Static value Standard_D2ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2DS_V4 = fromString("Standard_D2ds_v4"); - - /** - * Static value Standard_D4ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4DS_V4 = fromString("Standard_D4ds_v4"); - - /** - * Static value Standard_D8ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D8DS_V4 = fromString("Standard_D8ds_v4"); - - /** - * Static value Standard_D16ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D16DS_V4 = fromString("Standard_D16ds_v4"); - - /** - * Static value Standard_D32ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D32DS_V4 = fromString("Standard_D32ds_v4"); - - /** - * Static value Standard_D48ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D48DS_V4 = fromString("Standard_D48ds_v4"); - - /** - * Static value Standard_D64ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D64DS_V4 = fromString("Standard_D64ds_v4"); - - /** - * Static value Standard_E2_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2_V4 = fromString("Standard_E2_v4"); - - /** - * Static value Standard_E4_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4_V4 = fromString("Standard_E4_v4"); - - /** - * Static value Standard_E8_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_V4 = fromString("Standard_E8_v4"); - - /** - * Static value Standard_E16_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_V4 = fromString("Standard_E16_v4"); - - /** - * Static value Standard_E20_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E20_V4 = fromString("Standard_E20_v4"); - - /** - * Static value Standard_E32_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_V4 = fromString("Standard_E32_v4"); - - /** - * Static value Standard_E48_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48_V4 = fromString("Standard_E48_v4"); - - /** - * Static value Standard_E64_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_V4 = fromString("Standard_E64_v4"); - - /** - * Static value Standard_E2s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2S_V4 = fromString("Standard_E2s_v4"); - - /** - * Static value Standard_E4s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4S_V4 = fromString("Standard_E4s_v4"); - - /** - * Static value Standard_E8s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8S_V4 = fromString("Standard_E8s_v4"); - - /** - * Static value Standard_E16s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16S_V4 = fromString("Standard_E16s_v4"); - - /** - * Static value Standard_E20s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E20S_V4 = fromString("Standard_E20s_v4"); - - /** - * Static value Standard_E32s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32S_V4 = fromString("Standard_E32s_v4"); - - /** - * Static value Standard_E48s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48S_V4 = fromString("Standard_E48s_v4"); - - /** - * Static value Standard_E64s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64S_V4 = fromString("Standard_E64s_v4"); - - /** - * Static value Standard_E2d_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2D_V4 = fromString("Standard_E2d_v4"); - - /** - * Static value Standard_E4d_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4D_V4 = fromString("Standard_E4d_v4"); - - /** - * Static value Standard_E8d_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8D_V4 = fromString("Standard_E8d_v4"); - - /** - * Static value Standard_E16d_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16D_V4 = fromString("Standard_E16d_v4"); - - /** - * Static value Standard_E20d_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E20D_V4 = fromString("Standard_E20d_v4"); - - /** - * Static value Standard_E32d_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32D_V4 = fromString("Standard_E32d_v4"); - - /** - * Static value Standard_E48d_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48D_V4 = fromString("Standard_E48d_v4"); - - /** - * Static value Standard_E64d_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64D_V4 = fromString("Standard_E64d_v4"); - - /** - * Static value Standard_E2ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2DS_V4 = fromString("Standard_E2ds_v4"); - - /** - * Static value Standard_E4ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4DS_V4 = fromString("Standard_E4ds_v4"); - - /** - * Static value Standard_E8ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8DS_V4 = fromString("Standard_E8ds_v4"); - - /** - * Static value Standard_E16ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16DS_V4 = fromString("Standard_E16ds_v4"); - - /** - * Static value Standard_E20ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E20DS_V4 = fromString("Standard_E20ds_v4"); - - /** - * Static value Standard_E32ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32DS_V4 = fromString("Standard_E32ds_v4"); - - /** - * Static value Standard_E48ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48DS_V4 = fromString("Standard_E48ds_v4"); - - /** - * Static value Standard_E64ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64DS_V4 = fromString("Standard_E64ds_v4"); - - /** - * Static value Standard_E2as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2AS_V4 = fromString("Standard_E2as_v4"); - - /** - * Static value Standard_E4as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4AS_V4 = fromString("Standard_E4as_v4"); - - /** - * Static value Standard_E8as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8AS_V4 = fromString("Standard_E8as_v4"); - - /** - * Static value Standard_E16as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16AS_V4 = fromString("Standard_E16as_v4"); - - /** - * Static value Standard_E20as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E20AS_V4 = fromString("Standard_E20as_v4"); - - /** - * Static value Standard_E32as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32AS_V4 = fromString("Standard_E32as_v4"); - - /** - * Static value Standard_E48as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48AS_V4 = fromString("Standard_E48as_v4"); - - /** - * Static value Standard_E64as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64AS_V4 = fromString("Standard_E64as_v4"); - - /** - * Static value Standard_E96as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96AS_V4 = fromString("Standard_E96as_v4"); - - /** - * Static value Standard_D2as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2AS_V4 = fromString("Standard_D2as_v4"); - - /** - * Static value Standard_D4as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4AS_V4 = fromString("Standard_D4as_v4"); - - /** - * Static value Standard_D8as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D8AS_V4 = fromString("Standard_D8as_v4"); - - /** - * Static value Standard_D16as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D16AS_V4 = fromString("Standard_D16as_v4"); - - /** - * Static value Standard_D32as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D32AS_V4 = fromString("Standard_D32as_v4"); - - /** - * Static value Standard_D48as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D48AS_V4 = fromString("Standard_D48as_v4"); - - /** - * Static value Standard_D64as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D64AS_V4 = fromString("Standard_D64as_v4"); - - /** - * Static value Standard_D96as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D96AS_V4 = fromString("Standard_D96as_v4"); - - /** - * Static value Standard_M208ms_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M208MS_V2 = fromString("Standard_M208ms_v2"); - - /** - * Static value Standard_M208s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M208S_V2 = fromString("Standard_M208s_v2"); - - /** - * Static value Standard_M416ms_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M416MS_V2 = fromString("Standard_M416ms_v2"); - - /** - * Static value Standard_M416s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M416S_V2 = fromString("Standard_M416s_v2"); - - /** - * Static value Standard_F48s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_F48S_V2 = fromString("Standard_F48s_v2"); - - /** - * Static value Standard_E48_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48_V3 = fromString("Standard_E48_v3"); - - /** - * Static value Standard_E48s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48S_V3 = fromString("Standard_E48s_v3"); - - /** - * Static value Standard_E80is_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E80IS_V4 = fromString("Standard_E80is_v4"); - - /** - * Static value Standard_E80ids_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E80IDS_V4 = fromString("Standard_E80ids_v4"); - - /** - * Static value Standard_E2a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2A_V4 = fromString("Standard_E2a_v4"); - - /** - * Static value Standard_E4a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4A_V4 = fromString("Standard_E4a_v4"); - - /** - * Static value Standard_E8a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8A_V4 = fromString("Standard_E8a_v4"); - - /** - * Static value Standard_E16a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16A_V4 = fromString("Standard_E16a_v4"); - - /** - * Static value Standard_E20a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E20A_V4 = fromString("Standard_E20a_v4"); - - /** - * Static value Standard_E32a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32A_V4 = fromString("Standard_E32a_v4"); - - /** - * Static value Standard_E48a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48A_V4 = fromString("Standard_E48a_v4"); - - /** - * Static value Standard_E64a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64A_V4 = fromString("Standard_E64a_v4"); - - /** - * Static value Standard_E96a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96A_V4 = fromString("Standard_E96a_v4"); - - /** - * Static value Standard_D2a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2A_V4 = fromString("Standard_D2a_v4"); - - /** - * Static value Standard_D4a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4A_V4 = fromString("Standard_D4a_v4"); - - /** - * Static value Standard_D8a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D8A_V4 = fromString("Standard_D8a_v4"); - - /** - * Static value Standard_D16a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D16A_V4 = fromString("Standard_D16a_v4"); - - /** - * Static value Standard_D32a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D32A_V4 = fromString("Standard_D32a_v4"); - - /** - * Static value Standard_D48a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D48A_V4 = fromString("Standard_D48a_v4"); - - /** - * Static value Standard_D64a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D64A_V4 = fromString("Standard_D64a_v4"); - - /** - * Static value Standard_D96a_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D96A_V4 = fromString("Standard_D96a_v4"); - - /** - * Static value Standard_M32ms_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M32MS_V2 = fromString("Standard_M32ms_v2"); - - /** - * Static value Standard_M64s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M64S_V2 = fromString("Standard_M64s_v2"); - - /** - * Static value Standard_M64ms_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M64MS_V2 = fromString("Standard_M64ms_v2"); - - /** - * Static value Standard_M128s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M128S_V2 = fromString("Standard_M128s_v2"); - - /** - * Static value Standard_M128ms_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M128MS_V2 = fromString("Standard_M128ms_v2"); - - /** - * Static value Standard_M192is_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M192IS_V2 = fromString("Standard_M192is_v2"); - - /** - * Static value Standard_M192ims_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M192IMS_V2 = fromString("Standard_M192ims_v2"); - - /** - * Static value Standard_M32dms_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M32DMS_V2 = fromString("Standard_M32dms_v2"); - - /** - * Static value Standard_M64ds_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M64DS_V2 = fromString("Standard_M64ds_v2"); - - /** - * Static value Standard_M64dms_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M64DMS_V2 = fromString("Standard_M64dms_v2"); - - /** - * Static value Standard_M128ds_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M128DS_V2 = fromString("Standard_M128ds_v2"); - - /** - * Static value Standard_M128dms_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M128DMS_V2 = fromString("Standard_M128dms_v2"); - - /** - * Static value Standard_M192ids_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M192IDS_V2 = fromString("Standard_M192ids_v2"); - - /** - * Static value Standard_M192idms_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M192IDMS_V2 = fromString("Standard_M192idms_v2"); - - /** - * Static value Standard_D2_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2_V5 = fromString("Standard_D2_v5"); - - /** - * Static value Standard_D4_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4_V5 = fromString("Standard_D4_v5"); - - /** - * Static value Standard_D8_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D8_V5 = fromString("Standard_D8_v5"); - - /** - * Static value Standard_D16_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D16_V5 = fromString("Standard_D16_v5"); - - /** - * Static value Standard_D32_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D32_V5 = fromString("Standard_D32_v5"); - - /** - * Static value Standard_D48_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D48_V5 = fromString("Standard_D48_v5"); - - /** - * Static value Standard_D64_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D64_V5 = fromString("Standard_D64_v5"); - - /** - * Static value Standard_D96_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D96_V5 = fromString("Standard_D96_v5"); - - /** - * Static value Standard_D2s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2S_V5 = fromString("Standard_D2s_v5"); - - /** - * Static value Standard_D4s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4S_V5 = fromString("Standard_D4s_v5"); - - /** - * Static value Standard_D8s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D8S_V5 = fromString("Standard_D8s_v5"); - - /** - * Static value Standard_D16s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D16S_V5 = fromString("Standard_D16s_v5"); - - /** - * Static value Standard_D32s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D32S_V5 = fromString("Standard_D32s_v5"); - - /** - * Static value Standard_D48s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D48S_V5 = fromString("Standard_D48s_v5"); - - /** - * Static value Standard_D64s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D64S_V5 = fromString("Standard_D64s_v5"); - - /** - * Static value Standard_D96s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D96S_V5 = fromString("Standard_D96s_v5"); - - /** - * Static value Standard_D2d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2D_V5 = fromString("Standard_D2d_v5"); - - /** - * Static value Standard_D4d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4D_V5 = fromString("Standard_D4d_v5"); - - /** - * Static value Standard_D8d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D8D_V5 = fromString("Standard_D8d_v5"); - - /** - * Static value Standard_D16d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D16D_V5 = fromString("Standard_D16d_v5"); - - /** - * Static value Standard_D32d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D32D_V5 = fromString("Standard_D32d_v5"); - - /** - * Static value Standard_D48d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D48D_V5 = fromString("Standard_D48d_v5"); - - /** - * Static value Standard_D64d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D64D_V5 = fromString("Standard_D64d_v5"); - - /** - * Static value Standard_D96d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D96D_V5 = fromString("Standard_D96d_v5"); - - /** - * Static value Standard_D2ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2DS_V5 = fromString("Standard_D2ds_v5"); - - /** - * Static value Standard_D4ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4DS_V5 = fromString("Standard_D4ds_v5"); - - /** - * Static value Standard_D8ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D8DS_V5 = fromString("Standard_D8ds_v5"); - - /** - * Static value Standard_D16ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D16DS_V5 = fromString("Standard_D16ds_v5"); - - /** - * Static value Standard_D32ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D32DS_V5 = fromString("Standard_D32ds_v5"); - - /** - * Static value Standard_D48ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D48DS_V5 = fromString("Standard_D48ds_v5"); - - /** - * Static value Standard_D64ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D64DS_V5 = fromString("Standard_D64ds_v5"); - - /** - * Static value Standard_D96ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D96DS_V5 = fromString("Standard_D96ds_v5"); - - /** - * Static value Standard_D2as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2AS_V5 = fromString("Standard_D2as_v5"); - - /** - * Static value Standard_D4as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4AS_V5 = fromString("Standard_D4as_v5"); - - /** - * Static value Standard_D8as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D8AS_V5 = fromString("Standard_D8as_v5"); - - /** - * Static value Standard_D16as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D16AS_V5 = fromString("Standard_D16as_v5"); - - /** - * Static value Standard_D32as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D32AS_V5 = fromString("Standard_D32as_v5"); - - /** - * Static value Standard_D48as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D48AS_V5 = fromString("Standard_D48as_v5"); - - /** - * Static value Standard_D64as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D64AS_V5 = fromString("Standard_D64as_v5"); - - /** - * Static value Standard_D96as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D96AS_V5 = fromString("Standard_D96as_v5"); - - /** - * Static value Standard_D2ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D2ADS_V5 = fromString("Standard_D2ads_v5"); - - /** - * Static value Standard_D4ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D4ADS_V5 = fromString("Standard_D4ads_v5"); - - /** - * Static value Standard_D8ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D8ADS_V5 = fromString("Standard_D8ads_v5"); - - /** - * Static value Standard_D16ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D16ADS_V5 = fromString("Standard_D16ads_v5"); - - /** - * Static value Standard_D32ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D32ADS_V5 = fromString("Standard_D32ads_v5"); - - /** - * Static value Standard_D48ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D48ADS_V5 = fromString("Standard_D48ads_v5"); - - /** - * Static value Standard_D64ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D64ADS_V5 = fromString("Standard_D64ads_v5"); - - /** - * Static value Standard_D96ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_D96ADS_V5 = fromString("Standard_D96ads_v5"); - - /** - * Static value Standard_E2_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2_V5 = fromString("Standard_E2_v5"); - - /** - * Static value Standard_E4_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4_V5 = fromString("Standard_E4_v5"); - - /** - * Static value Standard_E8_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_V5 = fromString("Standard_E8_v5"); - - /** - * Static value Standard_E16_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_V5 = fromString("Standard_E16_v5"); - - /** - * Static value Standard_E20_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E20_V5 = fromString("Standard_E20_v5"); - - /** - * Static value Standard_E32_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_V5 = fromString("Standard_E32_v5"); - - /** - * Static value Standard_E48_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48_V5 = fromString("Standard_E48_v5"); - - /** - * Static value Standard_E64_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_V5 = fromString("Standard_E64_v5"); - - /** - * Static value Standard_E96_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96_V5 = fromString("Standard_E96_v5"); - - /** - * Static value Standard_E104i_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E104I_V5 = fromString("Standard_E104i_v5"); - - /** - * Static value Standard_E2s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2S_V5 = fromString("Standard_E2s_v5"); - - /** - * Static value Standard_E4s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4S_V5 = fromString("Standard_E4s_v5"); - - /** - * Static value Standard_E8s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8S_V5 = fromString("Standard_E8s_v5"); - - /** - * Static value Standard_E16s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16S_V5 = fromString("Standard_E16s_v5"); - - /** - * Static value Standard_E20s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E20S_V5 = fromString("Standard_E20s_v5"); - - /** - * Static value Standard_E32s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32S_V5 = fromString("Standard_E32s_v5"); - - /** - * Static value Standard_E48s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48S_V5 = fromString("Standard_E48s_v5"); - - /** - * Static value Standard_E64s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64S_V5 = fromString("Standard_E64s_v5"); - - /** - * Static value Standard_E96s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96S_V5 = fromString("Standard_E96s_v5"); - - /** - * Static value Standard_E104is_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E104IS_V5 = fromString("Standard_E104is_v5"); - - /** - * Static value Standard_E2d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2D_V5 = fromString("Standard_E2d_v5"); - - /** - * Static value Standard_E4d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4D_V5 = fromString("Standard_E4d_v5"); - - /** - * Static value Standard_E8d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8D_V5 = fromString("Standard_E8d_v5"); - - /** - * Static value Standard_E16d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16D_V5 = fromString("Standard_E16d_v5"); - - /** - * Static value Standard_E20d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E20D_V5 = fromString("Standard_E20d_v5"); - - /** - * Static value Standard_E32d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32D_V5 = fromString("Standard_E32d_v5"); - - /** - * Static value Standard_E48d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48D_V5 = fromString("Standard_E48d_v5"); - - /** - * Static value Standard_E64d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64D_V5 = fromString("Standard_E64d_v5"); - - /** - * Static value Standard_E96d_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96D_V5 = fromString("Standard_E96d_v5"); - - /** - * Static value Standard_E104id_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E104ID_V5 = fromString("Standard_E104id_v5"); - - /** - * Static value Standard_E2ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2DS_V5 = fromString("Standard_E2ds_v5"); - - /** - * Static value Standard_E4ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4DS_V5 = fromString("Standard_E4ds_v5"); - - /** - * Static value Standard_E8ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8DS_V5 = fromString("Standard_E8ds_v5"); - - /** - * Static value Standard_E16ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16DS_V5 = fromString("Standard_E16ds_v5"); - - /** - * Static value Standard_E20ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E20DS_V5 = fromString("Standard_E20ds_v5"); - - /** - * Static value Standard_E32ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32DS_V5 = fromString("Standard_E32ds_v5"); - - /** - * Static value Standard_E48ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48DS_V5 = fromString("Standard_E48ds_v5"); - - /** - * Static value Standard_E64ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64DS_V5 = fromString("Standard_E64ds_v5"); - - /** - * Static value Standard_E96ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96DS_V5 = fromString("Standard_E96ds_v5"); - - /** - * Static value Standard_E104ids_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E104IDS_V5 = fromString("Standard_E104ids_v5"); - - /** - * Static value Standard_E2as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2AS_V5 = fromString("Standard_E2as_v5"); - - /** - * Static value Standard_E4as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4AS_V5 = fromString("Standard_E4as_v5"); - - /** - * Static value Standard_E8as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8AS_V5 = fromString("Standard_E8as_v5"); - - /** - * Static value Standard_E16as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16AS_V5 = fromString("Standard_E16as_v5"); - - /** - * Static value Standard_E20as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E20AS_V5 = fromString("Standard_E20as_v5"); - - /** - * Static value Standard_E32as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32AS_V5 = fromString("Standard_E32as_v5"); - - /** - * Static value Standard_E48as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48AS_V5 = fromString("Standard_E48as_v5"); - - /** - * Static value Standard_E64as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64AS_V5 = fromString("Standard_E64as_v5"); - - /** - * Static value Standard_E96as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96AS_V5 = fromString("Standard_E96as_v5"); - - /** - * Static value Standard_E2ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2ADS_V5 = fromString("Standard_E2ads_v5"); - - /** - * Static value Standard_E4ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4ADS_V5 = fromString("Standard_E4ads_v5"); - - /** - * Static value Standard_E8ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8ADS_V5 = fromString("Standard_E8ads_v5"); - - /** - * Static value Standard_E16ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16ADS_V5 = fromString("Standard_E16ads_v5"); - - /** - * Static value Standard_E20ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E20ADS_V5 = fromString("Standard_E20ads_v5"); - - /** - * Static value Standard_E32ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32ADS_V5 = fromString("Standard_E32ads_v5"); - - /** - * Static value Standard_E48ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48ADS_V5 = fromString("Standard_E48ads_v5"); - - /** - * Static value Standard_E64ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64ADS_V5 = fromString("Standard_E64ads_v5"); - - /** - * Static value Standard_E96ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96ADS_V5 = fromString("Standard_E96ads_v5"); - - /** - * Static value Standard_M8_2ms for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M8_2MS = fromString("Standard_M8_2ms"); - - /** - * Static value Standard_M8_4ms for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M8_4MS = fromString("Standard_M8_4ms"); - - /** - * Static value Standard_M16_4ms for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M16_4MS = fromString("Standard_M16_4ms"); - - /** - * Static value Standard_M16_8ms for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M16_8MS = fromString("Standard_M16_8ms"); - - /** - * Static value Standard_M32_8ms for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M32_8MS = fromString("Standard_M32_8ms"); - - /** - * Static value Standard_M32_16ms for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M32_16MS = fromString("Standard_M32_16ms"); - - /** - * Static value Standard_M64_32ms for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M64_32MS = fromString("Standard_M64_32ms"); - - /** - * Static value Standard_M64_16ms for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M64_16MS = fromString("Standard_M64_16ms"); - - /** - * Static value Standard_M128_64ms for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M128_64MS = fromString("Standard_M128_64ms"); - - /** - * Static value Standard_M128_32ms for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M128_32MS = fromString("Standard_M128_32ms"); - - /** - * Static value Standard_E4_2s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4_2S_V3 = fromString("Standard_E4_2s_v3"); - - /** - * Static value Standard_E8_4s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_4S_V3 = fromString("Standard_E8_4s_v3"); - - /** - * Static value Standard_E8_2s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_2S_V3 = fromString("Standard_E8_2s_v3"); - - /** - * Static value Standard_E16_8s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_8S_V3 = fromString("Standard_E16_8s_v3"); - - /** - * Static value Standard_E16_4s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_4S_V3 = fromString("Standard_E16_4s_v3"); - - /** - * Static value Standard_E32_16s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_16S_V3 = fromString("Standard_E32_16s_v3"); - - /** - * Static value Standard_E32_8s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_8S_V3 = fromString("Standard_E32_8s_v3"); - - /** - * Static value Standard_E64_32s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_32S_V3 = fromString("Standard_E64_32s_v3"); - - /** - * Static value Standard_E64_16s_v3 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_16S_V3 = fromString("Standard_E64_16s_v3"); - - /** - * Static value Standard_E4_2s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4_2S_V4 = fromString("Standard_E4_2s_v4"); - - /** - * Static value Standard_E8_4s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_4S_V4 = fromString("Standard_E8_4s_v4"); - - /** - * Static value Standard_E8_2s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_2S_V4 = fromString("Standard_E8_2s_v4"); - - /** - * Static value Standard_E16_8s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_8S_V4 = fromString("Standard_E16_8s_v4"); - - /** - * Static value Standard_E16_4s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_4S_V4 = fromString("Standard_E16_4s_v4"); - - /** - * Static value Standard_E32_16s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_16S_V4 = fromString("Standard_E32_16s_v4"); - - /** - * Static value Standard_E32_8s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_8S_V4 = fromString("Standard_E32_8s_v4"); - - /** - * Static value Standard_E64_32s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_32S_V4 = fromString("Standard_E64_32s_v4"); - - /** - * Static value Standard_E64_16s_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_16S_V4 = fromString("Standard_E64_16s_v4"); - - /** - * Static value Standard_E4_2ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4_2DS_V4 = fromString("Standard_E4_2ds_v4"); - - /** - * Static value Standard_E8_4ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_4DS_V4 = fromString("Standard_E8_4ds_v4"); - - /** - * Static value Standard_E8_2ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_2DS_V4 = fromString("Standard_E8_2ds_v4"); - - /** - * Static value Standard_E16_8ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_8DS_V4 = fromString("Standard_E16_8ds_v4"); - - /** - * Static value Standard_E16_4ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_4DS_V4 = fromString("Standard_E16_4ds_v4"); - - /** - * Static value Standard_E32_16ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_16DS_V4 = fromString("Standard_E32_16ds_v4"); - - /** - * Static value Standard_E32_8ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_8DS_V4 = fromString("Standard_E32_8ds_v4"); - - /** - * Static value Standard_E64_32ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_32DS_V4 = fromString("Standard_E64_32ds_v4"); - - /** - * Static value Standard_E64_16ds_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_16DS_V4 = fromString("Standard_E64_16ds_v4"); - - /** - * Static value Standard_E4_2as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4_2AS_V4 = fromString("Standard_E4_2as_v4"); - - /** - * Static value Standard_E8_4as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_4AS_V4 = fromString("Standard_E8_4as_v4"); - - /** - * Static value Standard_E8_2as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_2AS_V4 = fromString("Standard_E8_2as_v4"); - - /** - * Static value Standard_E16_8as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_8AS_V4 = fromString("Standard_E16_8as_v4"); - - /** - * Static value Standard_E16_4as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_4AS_V4 = fromString("Standard_E16_4as_v4"); - - /** - * Static value Standard_E32_16as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_16AS_V4 = fromString("Standard_E32_16as_v4"); - - /** - * Static value Standard_E32_8as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_8AS_V4 = fromString("Standard_E32_8as_v4"); - - /** - * Static value Standard_E64_32as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_32AS_V4 = fromString("Standard_E64_32as_v4"); - - /** - * Static value Standard_E64_16as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_16AS_V4 = fromString("Standard_E64_16as_v4"); - - /** - * Static value Standard_E96_48as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96_48AS_V4 = fromString("Standard_E96_48as_v4"); - - /** - * Static value Standard_E96_24as_v4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96_24AS_V4 = fromString("Standard_E96_24as_v4"); - - /** - * Static value Standard_E4_2ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4_2ADS_V5 = fromString("Standard_E4_2ads_v5"); - - /** - * Static value Standard_E8_4ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_4ADS_V5 = fromString("Standard_E8_4ads_v5"); - - /** - * Static value Standard_E8_2ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_2ADS_V5 = fromString("Standard_E8_2ads_v5"); - - /** - * Static value Standard_E16_8ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_8ADS_V5 = fromString("Standard_E16_8ads_v5"); - - /** - * Static value Standard_E16_4ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_4ADS_V5 = fromString("Standard_E16_4ads_v5"); - - /** - * Static value Standard_E32_16ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_16ADS_V5 = fromString("Standard_E32_16ads_v5"); - - /** - * Static value Standard_E32_8ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_8ADS_V5 = fromString("Standard_E32_8ads_v5"); - - /** - * Static value Standard_E64_32ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_32ADS_V5 = fromString("Standard_E64_32ads_v5"); - - /** - * Static value Standard_E64_16ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_16ADS_V5 = fromString("Standard_E64_16ads_v5"); - - /** - * Static value Standard_E96_48ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96_48ADS_V5 = fromString("Standard_E96_48ads_v5"); - - /** - * Static value Standard_E96_24ads_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96_24ADS_V5 = fromString("Standard_E96_24ads_v5"); - - /** - * Static value Standard_E4_2s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4_2S_V5 = fromString("Standard_E4_2s_v5"); - - /** - * Static value Standard_E8_4s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_4S_V5 = fromString("Standard_E8_4s_v5"); - - /** - * Static value Standard_E8_2s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_2S_V5 = fromString("Standard_E8_2s_v5"); - - /** - * Static value Standard_E16_8s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_8S_V5 = fromString("Standard_E16_8s_v5"); - - /** - * Static value Standard_E16_4s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_4S_V5 = fromString("Standard_E16_4s_v5"); - - /** - * Static value Standard_E32_16s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_16S_V5 = fromString("Standard_E32_16s_v5"); - - /** - * Static value Standard_E32_8s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_8S_V5 = fromString("Standard_E32_8s_v5"); - - /** - * Static value Standard_E64_32s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_32S_V5 = fromString("Standard_E64_32s_v5"); - - /** - * Static value Standard_E64_16s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_16S_V5 = fromString("Standard_E64_16s_v5"); - - /** - * Static value Standard_E96_48s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96_48S_V5 = fromString("Standard_E96_48s_v5"); - - /** - * Static value Standard_E96_24s_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96_24S_V5 = fromString("Standard_E96_24s_v5"); - - /** - * Static value Standard_E4_2ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4_2DS_V5 = fromString("Standard_E4_2ds_v5"); - - /** - * Static value Standard_E8_4ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_4DS_V5 = fromString("Standard_E8_4ds_v5"); - - /** - * Static value Standard_E8_2ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_2DS_V5 = fromString("Standard_E8_2ds_v5"); - - /** - * Static value Standard_E16_8ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_8DS_V5 = fromString("Standard_E16_8ds_v5"); - - /** - * Static value Standard_E16_4ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_4DS_V5 = fromString("Standard_E16_4ds_v5"); - - /** - * Static value Standard_E32_16ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_16DS_V5 = fromString("Standard_E32_16ds_v5"); - - /** - * Static value Standard_E32_8ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_8DS_V5 = fromString("Standard_E32_8ds_v5"); - - /** - * Static value Standard_E64_32ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_32DS_V5 = fromString("Standard_E64_32ds_v5"); - - /** - * Static value Standard_E64_16ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_16DS_V5 = fromString("Standard_E64_16ds_v5"); - - /** - * Static value Standard_E96_48ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96_48DS_V5 = fromString("Standard_E96_48ds_v5"); - - /** - * Static value Standard_E96_24ds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96_24DS_V5 = fromString("Standard_E96_24ds_v5"); - - /** - * Static value Standard_E4_2as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4_2AS_V5 = fromString("Standard_E4_2as_v5"); - - /** - * Static value Standard_E8_4as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_4AS_V5 = fromString("Standard_E8_4as_v5"); - - /** - * Static value Standard_E8_2as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8_2AS_V5 = fromString("Standard_E8_2as_v5"); - - /** - * Static value Standard_E16_8as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_8AS_V5 = fromString("Standard_E16_8as_v5"); - - /** - * Static value Standard_E16_4as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16_4AS_V5 = fromString("Standard_E16_4as_v5"); - - /** - * Static value Standard_E32_16as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_16AS_V5 = fromString("Standard_E32_16as_v5"); - - /** - * Static value Standard_E32_8as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32_8AS_V5 = fromString("Standard_E32_8as_v5"); - - /** - * Static value Standard_E64_32as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_32AS_V5 = fromString("Standard_E64_32as_v5"); - - /** - * Static value Standard_E64_16as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64_16AS_V5 = fromString("Standard_E64_16as_v5"); - - /** - * Static value Standard_E96_48as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96_48AS_V5 = fromString("Standard_E96_48as_v5"); - - /** - * Static value Standard_E96_24as_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E96_24AS_V5 = fromString("Standard_E96_24as_v5"); - - /** - * Static value Standard_GS4_8 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_GS4_8 = fromString("Standard_GS4_8"); - - /** - * Static value Standard_GS4_4 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_GS4_4 = fromString("Standard_GS4_4"); - - /** - * Static value Standard_GS5_16 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_GS5_16 = fromString("Standard_GS5_16"); - - /** - * Static value Standard_GS5_8 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_GS5_8 = fromString("Standard_GS5_8"); - - /** - * Static value Standard_DS11_1_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS11_1_V2 = fromString("Standard_DS11_1_v2"); - - /** - * Static value Standard_DS12_2_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS12_2_V2 = fromString("Standard_DS12_2_v2"); - - /** - * Static value Standard_DS12_1_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS12_1_V2 = fromString("Standard_DS12_1_v2"); - - /** - * Static value Standard_DS13_4_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS13_4_V2 = fromString("Standard_DS13_4_v2"); - - /** - * Static value Standard_DS13_2_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS13_2_V2 = fromString("Standard_DS13_2_v2"); - - /** - * Static value Standard_DS14_8_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS14_8_V2 = fromString("Standard_DS14_8_v2"); - - /** - * Static value Standard_DS14_4_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_DS14_4_V2 = fromString("Standard_DS14_4_v2"); - - /** - * Static value Standard_M416_208s_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M416_208S_V2 = fromString("Standard_M416_208s_v2"); - - /** - * Static value Standard_M416_208ms_v2 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_M416_208MS_V2 = fromString("Standard_M416_208ms_v2"); - - /** - * Static value Standard_E2bs_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2BS_V5 = fromString("Standard_E2bs_v5"); - - /** - * Static value Standard_E4bs_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4BS_V5 = fromString("Standard_E4bs_v5"); - - /** - * Static value Standard_E8bs_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8BS_V5 = fromString("Standard_E8bs_v5"); - - /** - * Static value Standard_E16bs_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16BS_V5 = fromString("Standard_E16bs_v5"); - - /** - * Static value Standard_E32bs_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32BS_V5 = fromString("Standard_E32bs_v5"); - - /** - * Static value Standard_E48bs_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48BS_V5 = fromString("Standard_E48bs_v5"); - - /** - * Static value Standard_E64bs_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64BS_V5 = fromString("Standard_E64bs_v5"); - - /** - * Static value Standard_E2bds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E2BDS_V5 = fromString("Standard_E2bds_v5"); - - /** - * Static value Standard_E4bds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E4BDS_V5 = fromString("Standard_E4bds_v5"); - - /** - * Static value Standard_E8bds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E8BDS_V5 = fromString("Standard_E8bds_v5"); - - /** - * Static value Standard_E16bds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E16BDS_V5 = fromString("Standard_E16bds_v5"); - - /** - * Static value Standard_E32bds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E32BDS_V5 = fromString("Standard_E32bds_v5"); - - /** - * Static value Standard_E48bds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E48BDS_V5 = fromString("Standard_E48bds_v5"); - - /** - * Static value Standard_E64bds_v5 for AzureVmSize. - */ - public static final AzureVmSize STANDARD_E64BDS_V5 = fromString("Standard_E64bds_v5"); - - /** - * Creates a new instance of AzureVmSize value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AzureVmSize() { - } - - /** - * Creates or finds a AzureVmSize from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureVmSize. - */ - public static AzureVmSize fromString(String name) { - return fromString(name, AzureVmSize.class); - } - - /** - * Gets known AzureVmSize values. - * - * @return known AzureVmSize values. - */ - public static Collection values() { - return values(AzureVmSize.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmSuitabilityDetail.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmSuitabilityDetail.java deleted file mode 100644 index 1df1bcf544b2..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmSuitabilityDetail.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AzureVmSuitabilityDetail. - */ -public final class AzureVmSuitabilityDetail extends ExpandableStringEnum { - /** - * Static value None for AzureVmSuitabilityDetail. - */ - public static final AzureVmSuitabilityDetail NONE = fromString("None"); - - /** - * Static value RecommendedSizeHasLessNetworkAdapters for AzureVmSuitabilityDetail. - */ - public static final AzureVmSuitabilityDetail RECOMMENDED_SIZE_HAS_LESS_NETWORK_ADAPTERS - = fromString("RecommendedSizeHasLessNetworkAdapters"); - - /** - * Static value CannotReportComputeCost for AzureVmSuitabilityDetail. - */ - public static final AzureVmSuitabilityDetail CANNOT_REPORT_COMPUTE_COST = fromString("CannotReportComputeCost"); - - /** - * Static value CannotReportStorageCost for AzureVmSuitabilityDetail. - */ - public static final AzureVmSuitabilityDetail CANNOT_REPORT_STORAGE_COST = fromString("CannotReportStorageCost"); - - /** - * Static value CannotReportBandwidthCosts for AzureVmSuitabilityDetail. - */ - public static final AzureVmSuitabilityDetail CANNOT_REPORT_BANDWIDTH_COSTS - = fromString("CannotReportBandwidthCosts"); - - /** - * Static value PercentageOfCoresUtilizedMissing for AzureVmSuitabilityDetail. - */ - public static final AzureVmSuitabilityDetail PERCENTAGE_OF_CORES_UTILIZED_MISSING - = fromString("PercentageOfCoresUtilizedMissing"); - - /** - * Static value PercentageOfMemoryUtilizedMissing for AzureVmSuitabilityDetail. - */ - public static final AzureVmSuitabilityDetail PERCENTAGE_OF_MEMORY_UTILIZED_MISSING - = fromString("PercentageOfMemoryUtilizedMissing"); - - /** - * Static value PercentageOfCoresUtilizedOutOfRange for AzureVmSuitabilityDetail. - */ - public static final AzureVmSuitabilityDetail PERCENTAGE_OF_CORES_UTILIZED_OUT_OF_RANGE - = fromString("PercentageOfCoresUtilizedOutOfRange"); - - /** - * Static value PercentageOfMemoryUtilizedOutOfRange for AzureVmSuitabilityDetail. - */ - public static final AzureVmSuitabilityDetail PERCENTAGE_OF_MEMORY_UTILIZED_OUT_OF_RANGE - = fromString("PercentageOfMemoryUtilizedOutOfRange"); - - /** - * Creates a new instance of AzureVmSuitabilityDetail value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AzureVmSuitabilityDetail() { - } - - /** - * Creates or finds a AzureVmSuitabilityDetail from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureVmSuitabilityDetail. - */ - public static AzureVmSuitabilityDetail fromString(String name) { - return fromString(name, AzureVmSuitabilityDetail.class); - } - - /** - * Gets known AzureVmSuitabilityDetail values. - * - * @return known AzureVmSuitabilityDetail values. - */ - public static Collection values() { - return values(AzureVmSuitabilityDetail.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmSuitabilityExplanation.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmSuitabilityExplanation.java deleted file mode 100644 index 1b778db3f7e4..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureVmSuitabilityExplanation.java +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AzureVmSuitabilityExplanation. - */ -public final class AzureVmSuitabilityExplanation extends ExpandableStringEnum { - /** - * Static value Unknown for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation UNKNOWN = fromString("Unknown"); - - /** - * Static value NotApplicable for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Static value GuestOperatingSystemArchitectureNotSupported for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation GUEST_OPERATING_SYSTEM_ARCHITECTURE_NOT_SUPPORTED - = fromString("GuestOperatingSystemArchitectureNotSupported"); - - /** - * Static value GuestOperatingSystemNotSupported for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation GUEST_OPERATING_SYSTEM_NOT_SUPPORTED - = fromString("GuestOperatingSystemNotSupported"); - - /** - * Static value BootTypeNotSupported for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation BOOT_TYPE_NOT_SUPPORTED = fromString("BootTypeNotSupported"); - - /** - * Static value MoreDisksThanSupported for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation MORE_DISKS_THAN_SUPPORTED = fromString("MoreDisksThanSupported"); - - /** - * Static value NoSuitableVmSizeFound for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation NO_SUITABLE_VM_SIZE_FOUND = fromString("NoSuitableVmSizeFound"); - - /** - * Static value OneOrMoreDisksNotSuitable for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation ONE_OR_MORE_DISKS_NOT_SUITABLE - = fromString("OneOrMoreDisksNotSuitable"); - - /** - * Static value OneOrMoreAdaptersNotSuitable for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation ONE_OR_MORE_ADAPTERS_NOT_SUITABLE - = fromString("OneOrMoreAdaptersNotSuitable"); - - /** - * Static value InternalErrorOccurredDuringComputeEvaluation for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation INTERNAL_ERROR_OCCURRED_DURING_COMPUTE_EVALUATION - = fromString("InternalErrorOccurredDuringComputeEvaluation"); - - /** - * Static value InternalErrorOccurredDuringStorageEvaluation for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation INTERNAL_ERROR_OCCURRED_DURING_STORAGE_EVALUATION - = fromString("InternalErrorOccurredDuringStorageEvaluation"); - - /** - * Static value InternalErrorOccurredDuringNetworkEvaluation for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation INTERNAL_ERROR_OCCURRED_DURING_NETWORK_EVALUATION - = fromString("InternalErrorOccurredDuringNetworkEvaluation"); - - /** - * Static value NoVmSizeSupportsStoragePerformance for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation NO_VM_SIZE_SUPPORTS_STORAGE_PERFORMANCE - = fromString("NoVmSizeSupportsStoragePerformance"); - - /** - * Static value NoVmSizeSupportsNetworkPerformance for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation NO_VM_SIZE_SUPPORTS_NETWORK_PERFORMANCE - = fromString("NoVmSizeSupportsNetworkPerformance"); - - /** - * Static value NoVmSizeForSelectedPricingTier for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation NO_VM_SIZE_FOR_SELECTED_PRICING_TIER - = fromString("NoVmSizeForSelectedPricingTier"); - - /** - * Static value NoVmSizeForSelectedAzureLocation for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation NO_VM_SIZE_FOR_SELECTED_AZURE_LOCATION - = fromString("NoVmSizeForSelectedAzureLocation"); - - /** - * Static value CheckRedHatLinuxVersion for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation CHECK_RED_HAT_LINUX_VERSION - = fromString("CheckRedHatLinuxVersion"); - - /** - * Static value CheckOpenSuseLinuxVersion for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation CHECK_OPEN_SUSE_LINUX_VERSION - = fromString("CheckOpenSuseLinuxVersion"); - - /** - * Static value CheckWindowsServer2008R2Version for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation CHECK_WINDOWS_SERVER2008R2VERSION - = fromString("CheckWindowsServer2008R2Version"); - - /** - * Static value CheckCentOsVersion for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation CHECK_CENT_OS_VERSION = fromString("CheckCentOsVersion"); - - /** - * Static value CheckDebianLinuxVersion for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation CHECK_DEBIAN_LINUX_VERSION - = fromString("CheckDebianLinuxVersion"); - - /** - * Static value CheckSuseLinuxVersion for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation CHECK_SUSE_LINUX_VERSION = fromString("CheckSuseLinuxVersion"); - - /** - * Static value CheckOracleLinuxVersion for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation CHECK_ORACLE_LINUX_VERSION - = fromString("CheckOracleLinuxVersion"); - - /** - * Static value CheckUbuntuLinuxVersion for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation CHECK_UBUNTU_LINUX_VERSION - = fromString("CheckUbuntuLinuxVersion"); - - /** - * Static value CheckCoreOsLinuxVersion for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation CHECK_CORE_OS_LINUX_VERSION - = fromString("CheckCoreOsLinuxVersion"); - - /** - * Static value WindowsServerVersionConditionallySupported for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation WINDOWS_SERVER_VERSION_CONDITIONALLY_SUPPORTED - = fromString("WindowsServerVersionConditionallySupported"); - - /** - * Static value NoGuestOperatingSystemConditionallySupported for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation NO_GUEST_OPERATING_SYSTEM_CONDITIONALLY_SUPPORTED - = fromString("NoGuestOperatingSystemConditionallySupported"); - - /** - * Static value WindowsClientVersionsConditionallySupported for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation WINDOWS_CLIENT_VERSIONS_CONDITIONALLY_SUPPORTED - = fromString("WindowsClientVersionsConditionallySupported"); - - /** - * Static value BootTypeUnknown for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation BOOT_TYPE_UNKNOWN = fromString("BootTypeUnknown"); - - /** - * Static value GuestOperatingSystemUnknown for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation GUEST_OPERATING_SYSTEM_UNKNOWN - = fromString("GuestOperatingSystemUnknown"); - - /** - * Static value WindowsServerVersionsSupportedWithCaveat for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation WINDOWS_SERVER_VERSIONS_SUPPORTED_WITH_CAVEAT - = fromString("WindowsServerVersionsSupportedWithCaveat"); - - /** - * Static value WindowsOSNoLongerUnderMSSupport for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation WINDOWS_OSNO_LONGER_UNDER_MSSUPPORT - = fromString("WindowsOSNoLongerUnderMSSupport"); - - /** - * Static value EndorsedWithConditionsLinuxDistributions for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation ENDORSED_WITH_CONDITIONS_LINUX_DISTRIBUTIONS - = fromString("EndorsedWithConditionsLinuxDistributions"); - - /** - * Static value UnendorsedLinuxDistributions for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation UNENDORSED_LINUX_DISTRIBUTIONS - = fromString("UnendorsedLinuxDistributions"); - - /** - * Static value NoVmSizeForStandardPricingTier for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation NO_VM_SIZE_FOR_STANDARD_PRICING_TIER - = fromString("NoVmSizeForStandardPricingTier"); - - /** - * Static value NoVmSizeForBasicPricingTier for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation NO_VM_SIZE_FOR_BASIC_PRICING_TIER - = fromString("NoVmSizeForBasicPricingTier"); - - /** - * Static value NoVmSizeInSelectedFamilyFound for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation NO_VM_SIZE_IN_SELECTED_FAMILY_FOUND - = fromString("NoVmSizeInSelectedFamilyFound"); - - /** - * Static value NoEaPriceFoundForVmSize for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation NO_EA_PRICE_FOUND_FOR_VM_SIZE - = fromString("NoEaPriceFoundForVmSize"); - - /** - * Static value NoVmSizeFoundForOfferCurrencyReservedInstance for AzureVmSuitabilityExplanation. - */ - public static final AzureVmSuitabilityExplanation NO_VM_SIZE_FOUND_FOR_OFFER_CURRENCY_RESERVED_INSTANCE - = fromString("NoVmSizeFoundForOfferCurrencyReservedInstance"); - - /** - * Creates a new instance of AzureVmSuitabilityExplanation value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AzureVmSuitabilityExplanation() { - } - - /** - * Creates or finds a AzureVmSuitabilityExplanation from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureVmSuitabilityExplanation. - */ - public static AzureVmSuitabilityExplanation fromString(String name) { - return fromString(name, AzureVmSuitabilityExplanation.class); - } - - /** - * Gets known AzureVmSuitabilityExplanation values. - * - * @return known AzureVmSuitabilityExplanation values. - */ - public static Collection values() { - return values(AzureVmSuitabilityExplanation.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureWebAppTier.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureWebAppTier.java new file mode 100644 index 000000000000..75c2272070f0 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/AzureWebAppTier.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Wep App Tier. + */ +public final class AzureWebAppTier extends ExpandableStringEnum { + /** + * Static value Unknown for AzureWebAppTier. + */ + public static final AzureWebAppTier UNKNOWN = fromString("Unknown"); + + /** + * Static value Free for AzureWebAppTier. + */ + public static final AzureWebAppTier FREE = fromString("Free"); + + /** + * Static value Shared for AzureWebAppTier. + */ + public static final AzureWebAppTier SHARED = fromString("Shared"); + + /** + * Static value Basic for AzureWebAppTier. + */ + public static final AzureWebAppTier BASIC = fromString("Basic"); + + /** + * Static value Standard for AzureWebAppTier. + */ + public static final AzureWebAppTier STANDARD = fromString("Standard"); + + /** + * Static value Premium for AzureWebAppTier. + */ + public static final AzureWebAppTier PREMIUM = fromString("Premium"); + + /** + * Static value PremiumV2 for AzureWebAppTier. + */ + public static final AzureWebAppTier PREMIUM_V2 = fromString("PremiumV2"); + + /** + * Static value Isolated for AzureWebAppTier. + */ + public static final AzureWebAppTier ISOLATED = fromString("Isolated"); + + /** + * Creates a new instance of AzureWebAppTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureWebAppTier() { + } + + /** + * Creates or finds a AzureWebAppTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureWebAppTier. + */ + public static AzureWebAppTier fromString(String name) { + return fromString(name, AzureWebAppTier.class); + } + + /** + * Gets known AzureWebAppTier values. + * + * @return known AzureWebAppTier values. + */ + public static Collection values() { + return values(AzureWebAppTier.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BillingSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BillingSettings.java new file mode 100644 index 000000000000..a5770fd291c8 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BillingSettings.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCase.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCase.java new file mode 100644 index 000000000000..f04bee135629 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCase.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.BusinessCaseInner; + +/** + * An immutable client-side representation of BusinessCase. + */ +public interface BusinessCase { + /** + * 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. + */ + BusinessCaseProperties 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.migration.assessment.fluent.models.BusinessCaseInner object. + * + * @return the inner object. + */ + BusinessCaseInner innerModel(); + + /** + * The entirety of the BusinessCase definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The BusinessCase definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the BusinessCase definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the BusinessCase 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 BusinessCase 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. + */ + BusinessCase create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BusinessCase create(Context context); + } + + /** + * The stage of the BusinessCase 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(BusinessCaseProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BusinessCase refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BusinessCase refresh(Context context); + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @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 compare summary class. + */ + CompareSummary compareSummary(Object body); + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @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 compare summary class. + */ + CompareSummary compareSummary(Object body, Context context); + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case 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 the URL for downloading the business case in a report format. + */ + ReportDownloadUrl getReportDownloadUrl(Object body); + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case 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 the URL for downloading the business case in a report format. + */ + ReportDownloadUrl getReportDownloadUrl(Object body, Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseAvsSummaryOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseAvsSummaryOperations.java new file mode 100644 index 000000000000..a0e29cc578fb --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseAvsSummaryOperations.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 BusinessCaseAvsSummaryOperations. + */ +public interface BusinessCaseAvsSummaryOperations { + /** + * List AvsSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 AvsSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName); + + /** + * List AvsSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 AvsSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName, + Context context); + + /** + * Get a AvsSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param avsSummaryName Gets the Name of the Avs 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 AvsSummary along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + String avsSummaryName, Context context); + + /** + * Get a AvsSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param avsSummaryName Gets the Name of the Avs 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 AvsSummary. + */ + AvsSummary get(String resourceGroupName, String projectName, String businessCaseName, String avsSummaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseCurrency.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseCurrency.java new file mode 100644 index 000000000000..1a2fd4b70765 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseCurrency.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Business case Currency. + */ +public final class BusinessCaseCurrency extends ExpandableStringEnum { + /** + * Static value Unknown for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency UNKNOWN = fromString("Unknown"); + + /** + * Static value USD for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency USD = fromString("USD"); + + /** + * Static value DKK for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency DKK = fromString("DKK"); + + /** + * Static value CAD for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency CAD = fromString("CAD"); + + /** + * Static value IDR for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency IDR = fromString("IDR"); + + /** + * Static value JPY for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency JPY = fromString("JPY"); + + /** + * Static value KRW for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency KRW = fromString("KRW"); + + /** + * Static value NZD for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency NZD = fromString("NZD"); + + /** + * Static value NOK for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency NOK = fromString("NOK"); + + /** + * Static value RUB for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency RUB = fromString("RUB"); + + /** + * Static value SAR for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency SAR = fromString("SAR"); + + /** + * Static value ZAR for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency ZAR = fromString("ZAR"); + + /** + * Static value SEK for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency SEK = fromString("SEK"); + + /** + * Static value TRY for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency TRY = fromString("TRY"); + + /** + * Static value GBP for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency GBP = fromString("GBP"); + + /** + * Static value MXN for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency MXN = fromString("MXN"); + + /** + * Static value MYR for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency MYR = fromString("MYR"); + + /** + * Static value INR for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency INR = fromString("INR"); + + /** + * Static value HKD for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency HKD = fromString("HKD"); + + /** + * Static value BRL for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency BRL = fromString("BRL"); + + /** + * Static value TWD for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency TWD = fromString("TWD"); + + /** + * Static value EUR for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency EUR = fromString("EUR"); + + /** + * Static value CHF for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency CHF = fromString("CHF"); + + /** + * Static value ARS for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency ARS = fromString("ARS"); + + /** + * Static value AUD for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency AUD = fromString("AUD"); + + /** + * Static value CNY for BusinessCaseCurrency. + */ + public static final BusinessCaseCurrency CNY = fromString("CNY"); + + /** + * Creates a new instance of BusinessCaseCurrency value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BusinessCaseCurrency() { + } + + /** + * Creates or finds a BusinessCaseCurrency from its string representation. + * + * @param name a name to look for. + * @return the corresponding BusinessCaseCurrency. + */ + public static BusinessCaseCurrency fromString(String name) { + return fromString(name, BusinessCaseCurrency.class); + } + + /** + * Gets known BusinessCaseCurrency values. + * + * @return known BusinessCaseCurrency values. + */ + public static Collection values() { + return values(BusinessCaseCurrency.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseIaasSummaryOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseIaasSummaryOperations.java new file mode 100644 index 000000000000..542353c3a8aa --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseIaasSummaryOperations.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 BusinessCaseIaasSummaryOperations. + */ +public interface BusinessCaseIaasSummaryOperations { + /** + * List IaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 IaasSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName); + + /** + * List IaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 IaasSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName, + Context context); + + /** + * Get a IaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param iaasSummaryName Gets the Name of the Iaas 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 IaasSummary along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + String iaasSummaryName, Context context); + + /** + * Get a IaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param iaasSummaryName Gets the Name of the Iaas 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 IaasSummary. + */ + IaasSummary get(String resourceGroupName, String projectName, String businessCaseName, String iaasSummaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseListResult.java new file mode 100644 index 000000000000..1b2e6ff26d68 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.BusinessCaseInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a BusinessCase list operation. + */ +@Fluent +public final class BusinessCaseListResult implements JsonSerializable { + /* + * The BusinessCase items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of BusinessCaseListResult class. + */ + public BusinessCaseListResult() { + } + + /** + * Get the value property: The BusinessCase items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The BusinessCase items on this page. + * + * @param value the value value to set. + * @return the BusinessCaseListResult object itself. + */ + public BusinessCaseListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the BusinessCaseListResult object itself. + */ + public BusinessCaseListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 BusinessCaseListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BusinessCaseListResult.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 BusinessCaseListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BusinessCaseListResult 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 BusinessCaseListResult. + */ + public static BusinessCaseListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BusinessCaseListResult deserializedBusinessCaseListResult = new BusinessCaseListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> BusinessCaseInner.fromJson(reader1)); + deserializedBusinessCaseListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedBusinessCaseListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBusinessCaseListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseOperations.java new file mode 100644 index 000000000000..2fb73eea830b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseOperations.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 BusinessCaseOperations. + */ +public interface BusinessCaseOperations { + /** + * List BusinessCase 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 BusinessCase list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List BusinessCase 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 BusinessCase list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 BusinessCase along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + Context context); + + /** + * Get a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 BusinessCase. + */ + BusinessCase get(String resourceGroupName, String projectName, String businessCaseName); + + /** + * Delete a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 businessCaseName, + Context context); + + /** + * Delete a BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 businessCaseName); + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class. + */ + CompareSummary compareSummary(String resourceGroupName, String projectName, String businessCaseName, Object body); + + /** + * Get Compare summary report for Business case. + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 compare summary class. + */ + CompareSummary compareSummary(String resourceGroupName, String projectName, String businessCaseName, Object body, + Context context); + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 URL for downloading the business case in a report format. + */ + ReportDownloadUrl getReportDownloadUrl(String resourceGroupName, String projectName, String businessCaseName, + Object body); + + /** + * Get download URL for the business case report. + * + * Get the URL for downloading the business case in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 URL for downloading the business case in a report format. + */ + ReportDownloadUrl getReportDownloadUrl(String resourceGroupName, String projectName, String businessCaseName, + Object body, Context context); + + /** + * Get a BusinessCase. + * + * @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 BusinessCase along with {@link Response}. + */ + BusinessCase getById(String id); + + /** + * Get a BusinessCase. + * + * @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 BusinessCase along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a BusinessCase. + * + * @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 BusinessCase. + * + * @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 BusinessCase resource. + * + * @param name resource name. + * @return the first stage of the new BusinessCase definition. + */ + BusinessCase.DefinitionStages.Blank define(String name); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseOverviewSummaryOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseOverviewSummaryOperations.java new file mode 100644 index 000000000000..1531e4f9dc4d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseOverviewSummaryOperations.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 BusinessCaseOverviewSummaryOperations. + */ +public interface BusinessCaseOverviewSummaryOperations { + /** + * List OverviewSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 OverviewSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName); + + /** + * List OverviewSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 OverviewSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName, + Context context); + + /** + * Get a OverviewSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param overviewSummaryName Gets the Name of the Overview 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 OverviewSummary along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + String overviewSummaryName, Context context); + + /** + * Get a OverviewSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param overviewSummaryName Gets the Name of the Overview 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 OverviewSummary. + */ + OverviewSummary get(String resourceGroupName, String projectName, String businessCaseName, + String overviewSummaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCasePaasSummaryOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCasePaasSummaryOperations.java new file mode 100644 index 000000000000..7bb9c6ab09e4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCasePaasSummaryOperations.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 BusinessCasePaasSummaryOperations. + */ +public interface BusinessCasePaasSummaryOperations { + /** + * List PaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 PaasSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName); + + /** + * List PaasSummary resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 PaasSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName, + Context context); + + /** + * Get a PaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param paasSummaryName Gets the Name of the Paas 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 PaasSummary along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + String paasSummaryName, Context context); + + /** + * Get a PaasSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param paasSummaryName Gets the Name of the Paas 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 PaasSummary. + */ + PaasSummary get(String resourceGroupName, String projectName, String businessCaseName, String paasSummaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseProperties.java new file mode 100644 index 000000000000..7b1f40f9a303 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseProperties.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Property bag for an + * Microsoft.Azure.Migrate.BusinessCaseService.Api.V20220202_preview.Resources.BusinessCase + * resource. + */ +@Fluent +public final class BusinessCaseProperties implements JsonSerializable { + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /* + * Business case settings. + */ + private Settings settings; + + /* + * Business case state. + */ + private BusinessCaseState state; + + /* + * Gets the state of business case reports. + */ + private List reportStatusDetails; + + /* + * Gets the business case scope. + */ + private BusinessCaseScope businessCaseScope; + + /** + * Creates an instance of BusinessCaseProperties class. + */ + public BusinessCaseProperties() { + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the settings property: Business case settings. + * + * @return the settings value. + */ + public Settings settings() { + return this.settings; + } + + /** + * Set the settings property: Business case settings. + * + * @param settings the settings value to set. + * @return the BusinessCaseProperties object itself. + */ + public BusinessCaseProperties withSettings(Settings settings) { + this.settings = settings; + return this; + } + + /** + * Get the state property: Business case state. + * + * @return the state value. + */ + public BusinessCaseState state() { + return this.state; + } + + /** + * Get the reportStatusDetails property: Gets the state of business case reports. + * + * @return the reportStatusDetails value. + */ + public List reportStatusDetails() { + return this.reportStatusDetails; + } + + /** + * Get the businessCaseScope property: Gets the business case scope. + * + * @return the businessCaseScope value. + */ + public BusinessCaseScope businessCaseScope() { + return this.businessCaseScope; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (settings() != null) { + settings().validate(); + } + if (reportStatusDetails() != null) { + reportStatusDetails().forEach(e -> e.validate()); + } + if (businessCaseScope() != null) { + businessCaseScope().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("settings", this.settings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BusinessCaseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BusinessCaseProperties 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 BusinessCaseProperties. + */ + public static BusinessCaseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BusinessCaseProperties deserializedBusinessCaseProperties = new BusinessCaseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedBusinessCaseProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("settings".equals(fieldName)) { + deserializedBusinessCaseProperties.settings = Settings.fromJson(reader); + } else if ("state".equals(fieldName)) { + deserializedBusinessCaseProperties.state = BusinessCaseState.fromString(reader.getString()); + } else if ("reportStatusDetails".equals(fieldName)) { + List reportStatusDetails + = reader.readArray(reader1 -> ReportDetails.fromJson(reader1)); + deserializedBusinessCaseProperties.reportStatusDetails = reportStatusDetails; + } else if ("businessCaseScope".equals(fieldName)) { + deserializedBusinessCaseProperties.businessCaseScope = BusinessCaseScope.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBusinessCaseProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseScope.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseScope.java new file mode 100644 index 000000000000..13f2326c248d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseScope.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Business case scope. + */ +@Immutable +public final class BusinessCaseScope implements JsonSerializable { + /* + * Scope type. + */ + private ScopeType scopeType; + + /* + * ARG query. + */ + private String azureResourceGraphQuery; + + /** + * Creates an instance of BusinessCaseScope class. + */ + public BusinessCaseScope() { + } + + /** + * Get the scopeType property: Scope type. + * + * @return the scopeType value. + */ + public ScopeType scopeType() { + return this.scopeType; + } + + /** + * Get the azureResourceGraphQuery property: ARG query. + * + * @return the azureResourceGraphQuery value. + */ + public String azureResourceGraphQuery() { + return this.azureResourceGraphQuery; + } + + /** + * 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 BusinessCaseScope from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BusinessCaseScope 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 BusinessCaseScope. + */ + public static BusinessCaseScope fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BusinessCaseScope deserializedBusinessCaseScope = new BusinessCaseScope(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scopeType".equals(fieldName)) { + deserializedBusinessCaseScope.scopeType = ScopeType.fromString(reader.getString()); + } else if ("azureResourceGraphQuery".equals(fieldName)) { + deserializedBusinessCaseScope.azureResourceGraphQuery = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBusinessCaseScope; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseState.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseState.java new file mode 100644 index 000000000000..dd309bd55cfd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/BusinessCaseState.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Business case supported state types. + */ +public final class BusinessCaseState extends ExpandableStringEnum { + /** + * Static value Unknown for BusinessCaseState. + */ + public static final BusinessCaseState UNKNOWN = fromString("Unknown"); + + /** + * Static value InProgress for BusinessCaseState. + */ + public static final BusinessCaseState IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Completed for BusinessCaseState. + */ + public static final BusinessCaseState COMPLETED = fromString("Completed"); + + /** + * Static value OutDated for BusinessCaseState. + */ + public static final BusinessCaseState OUT_DATED = fromString("OutDated"); + + /** + * Static value Invalid for BusinessCaseState. + */ + public static final BusinessCaseState INVALID = fromString("Invalid"); + + /** + * Static value OutOfSync for BusinessCaseState. + */ + public static final BusinessCaseState OUT_OF_SYNC = fromString("OutOfSync"); + + /** + * Static value Failed for BusinessCaseState. + */ + public static final BusinessCaseState FAILED = fromString("Failed"); + + /** + * Creates a new instance of BusinessCaseState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BusinessCaseState() { + } + + /** + * Creates or finds a BusinessCaseState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BusinessCaseState. + */ + public static BusinessCaseState fromString(String name) { + return fromString(name, BusinessCaseState.class); + } + + /** + * Gets known BusinessCaseState values. + * + * @return known BusinessCaseState values. + */ + public static Collection values() { + return values(BusinessCaseState.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CarbonEmissionsDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CarbonEmissionsDetails.java new file mode 100644 index 000000000000..43003c17dc5d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CarbonEmissionsDetails.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Details of carbon emissions. + */ +@Immutable +public final class CarbonEmissionsDetails implements JsonSerializable { + /* + * Scope 1 emissions in metric tons of CO2 equivalent (MTCO2e). + */ + private CarbonEmissionsScopeDetails scope1; + + /* + * Scope 2 emissions in metric tons of CO2 equivalent (MTCO2e). + */ + private CarbonEmissionsScopeDetails scope2; + + /* + * Scope 3 emissions in metric tons of CO2 equivalent (MTCO2e). + */ + private CarbonEmissionsScopeDetails scope3; + + /** + * Creates an instance of CarbonEmissionsDetails class. + */ + public CarbonEmissionsDetails() { + } + + /** + * Get the scope1 property: Scope 1 emissions in metric tons of CO2 equivalent (MTCO2e). + * + * @return the scope1 value. + */ + public CarbonEmissionsScopeDetails scope1() { + return this.scope1; + } + + /** + * Get the scope2 property: Scope 2 emissions in metric tons of CO2 equivalent (MTCO2e). + * + * @return the scope2 value. + */ + public CarbonEmissionsScopeDetails scope2() { + return this.scope2; + } + + /** + * Get the scope3 property: Scope 3 emissions in metric tons of CO2 equivalent (MTCO2e). + * + * @return the scope3 value. + */ + public CarbonEmissionsScopeDetails scope3() { + return this.scope3; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scope1() != null) { + scope1().validate(); + } + if (scope2() != null) { + scope2().validate(); + } + if (scope3() != null) { + scope3().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CarbonEmissionsDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CarbonEmissionsDetails 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 CarbonEmissionsDetails. + */ + public static CarbonEmissionsDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CarbonEmissionsDetails deserializedCarbonEmissionsDetails = new CarbonEmissionsDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scope1".equals(fieldName)) { + deserializedCarbonEmissionsDetails.scope1 = CarbonEmissionsScopeDetails.fromJson(reader); + } else if ("scope2".equals(fieldName)) { + deserializedCarbonEmissionsDetails.scope2 = CarbonEmissionsScopeDetails.fromJson(reader); + } else if ("scope3".equals(fieldName)) { + deserializedCarbonEmissionsDetails.scope3 = CarbonEmissionsScopeDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCarbonEmissionsDetails; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CarbonEmissionsScopeDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CarbonEmissionsScopeDetails.java new file mode 100644 index 000000000000..eb7fd0d8800c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CarbonEmissionsScopeDetails.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Details of carbon emissions scope. + */ +@Immutable +public final class CarbonEmissionsScopeDetails implements JsonSerializable { + /* + * The compute emissions in metric tons of CO2 equivalent (MTCO2e). + */ + private float compute; + + /* + * The storage emissions in metric tons of CO2 equivalent (MTCO2e). + */ + private float storage; + + /** + * Creates an instance of CarbonEmissionsScopeDetails class. + */ + public CarbonEmissionsScopeDetails() { + } + + /** + * Get the compute property: The compute emissions in metric tons of CO2 equivalent (MTCO2e). + * + * @return the compute value. + */ + public float compute() { + return this.compute; + } + + /** + * Get the storage property: The storage emissions in metric tons of CO2 equivalent (MTCO2e). + * + * @return the storage value. + */ + public float storage() { + return this.storage; + } + + /** + * 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 CarbonEmissionsScopeDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CarbonEmissionsScopeDetails 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 CarbonEmissionsScopeDetails. + */ + public static CarbonEmissionsScopeDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CarbonEmissionsScopeDetails deserializedCarbonEmissionsScopeDetails = new CarbonEmissionsScopeDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("compute".equals(fieldName)) { + deserializedCarbonEmissionsScopeDetails.compute = reader.getFloat(); + } else if ("storage".equals(fieldName)) { + deserializedCarbonEmissionsScopeDetails.storage = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedCarbonEmissionsScopeDetails; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CloudSuitabilityCommon.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CloudSuitabilityCommon.java new file mode 100644 index 000000000000..5fac352ad442 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CloudSuitabilityCommon.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Cloud Suitability Common. + */ +public final class CloudSuitabilityCommon extends ExpandableStringEnum { + /** + * Static value Unknown for CloudSuitabilityCommon. + */ + public static final CloudSuitabilityCommon UNKNOWN = fromString("Unknown"); + + /** + * Static value NotSuitable for CloudSuitabilityCommon. + */ + public static final CloudSuitabilityCommon NOT_SUITABLE = fromString("NotSuitable"); + + /** + * Static value Suitable for CloudSuitabilityCommon. + */ + public static final CloudSuitabilityCommon SUITABLE = fromString("Suitable"); + + /** + * Static value ConditionallySuitable for CloudSuitabilityCommon. + */ + public static final CloudSuitabilityCommon CONDITIONALLY_SUITABLE = fromString("ConditionallySuitable"); + + /** + * Static value ReadinessUnknown for CloudSuitabilityCommon. + */ + public static final CloudSuitabilityCommon READINESS_UNKNOWN = fromString("ReadinessUnknown"); + + /** + * Static value SuitableWithWarnings for CloudSuitabilityCommon. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CollectorPropertiesBase.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CollectorPropertiesBase.java index f02a9c4a7a78..f65ea58c2375 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CollectorPropertiesBase.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CollectorPropertiesBase.java @@ -7,6 +7,7 @@ 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; @@ -16,7 +17,12 @@ * Collector properties class. */ @Fluent -public final class CollectorPropertiesBase extends AzureResourceProperties { +public final class CollectorPropertiesBase implements JsonSerializable { + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + /* * Gets the discovery site id. */ @@ -38,6 +44,15 @@ public final class CollectorPropertiesBase extends AzureResourceProperties { public CollectorPropertiesBase() { } + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + /** * Get the discoverySiteId property: Gets the discovery site id. * @@ -76,21 +91,11 @@ public OffsetDateTime updatedTimestamp() { return this.updatedTimestamp; } - /** - * {@inheritDoc} - */ - @Override - public CollectorPropertiesBase withProvisioningState(ProvisioningState provisioningState) { - super.withProvisioningState(provisioningState); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { } @@ -100,8 +105,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provisioningState", - provisioningState() == null ? null : provisioningState().toString()); jsonWriter.writeStringField("discoverySiteId", this.discoverySiteId); return jsonWriter.writeEndObject(); } @@ -122,8 +125,8 @@ public static CollectorPropertiesBase fromJson(JsonReader jsonReader) throws IOE reader.nextToken(); if ("provisioningState".equals(fieldName)) { - deserializedCollectorPropertiesBase - .withProvisioningState(ProvisioningState.fromString(reader.getString())); + deserializedCollectorPropertiesBase.provisioningState + = ProvisioningState.fromString(reader.getString()); } else if ("discoverySiteId".equals(fieldName)) { deserializedCollectorPropertiesBase.discoverySiteId = reader.getString(); } else if ("createdTimestamp".equals(fieldName)) { diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CollectorPropertiesBaseWithAgent.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CollectorPropertiesBaseWithAgent.java index 9b7bb06026c7..abee5dd5da07 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CollectorPropertiesBaseWithAgent.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CollectorPropertiesBaseWithAgent.java @@ -7,6 +7,7 @@ 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; @@ -16,7 +17,12 @@ * Collector properties class. */ @Fluent -public final class CollectorPropertiesBaseWithAgent extends AzureResourceProperties { +public final class CollectorPropertiesBaseWithAgent implements JsonSerializable { + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + /* * Gets or sets the collector agent properties. */ @@ -43,6 +49,15 @@ public final class CollectorPropertiesBaseWithAgent extends AzureResourcePropert public CollectorPropertiesBaseWithAgent() { } + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + /** * Get the agentProperties property: Gets or sets the collector agent properties. * @@ -101,21 +116,11 @@ public OffsetDateTime updatedTimestamp() { return this.updatedTimestamp; } - /** - * {@inheritDoc} - */ - @Override - public CollectorPropertiesBaseWithAgent withProvisioningState(ProvisioningState provisioningState) { - super.withProvisioningState(provisioningState); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (agentProperties() != null) { agentProperties().validate(); @@ -128,8 +133,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provisioningState", - provisioningState() == null ? null : provisioningState().toString()); jsonWriter.writeJsonField("agentProperties", this.agentProperties); jsonWriter.writeStringField("discoverySiteId", this.discoverySiteId); return jsonWriter.writeEndObject(); @@ -152,8 +155,8 @@ public static CollectorPropertiesBaseWithAgent fromJson(JsonReader jsonReader) t reader.nextToken(); if ("provisioningState".equals(fieldName)) { - deserializedCollectorPropertiesBaseWithAgent - .withProvisioningState(ProvisioningState.fromString(reader.getString())); + deserializedCollectorPropertiesBaseWithAgent.provisioningState + = ProvisioningState.fromString(reader.getString()); } else if ("agentProperties".equals(fieldName)) { deserializedCollectorPropertiesBaseWithAgent.agentProperties = CollectorAgentPropertiesBase.fromJson(reader); diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompareSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompareSummary.java new file mode 100644 index 000000000000..eef8fb5328b0 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompareSummary.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.resourcemanager.migration.assessment.fluent.models.CompareSummaryInner; + +/** + * An immutable client-side representation of CompareSummary. + */ +public interface CompareSummary { + /** + * Gets the azurePaasCostDetails property: The azure PaaS cost. + * + * @return the azurePaasCostDetails value. + */ + CostDetails azurePaasCostDetails(); + + /** + * Gets the azureIaasCostDetails property: The azure IaaS cost. + * + * @return the azureIaasCostDetails value. + */ + CostDetails azureIaasCostDetails(); + + /** + * Gets the azureAvsCostDetails property: The AVS cost. + * + * @return the azureAvsCostDetails value. + */ + CostDetails azureAvsCostDetails(); + + /** + * Gets the onPremisesPaasCostDetails property: The on premises PaaS cost. + * + * @return the onPremisesPaasCostDetails value. + */ + CostDetails onPremisesPaasCostDetails(); + + /** + * Gets the onPremisesIaasCostDetails property: The on premises IaaS cost. + * + * @return the onPremisesIaasCostDetails value. + */ + CostDetails onPremisesIaasCostDetails(); + + /** + * Gets the onPremisesAvsCostDetails property: The on premises AVS cost. + * + * @return the onPremisesAvsCostDetails value. + */ + CostDetails onPremisesAvsCostDetails(); + + /** + * Gets the onPremisesPaasDecommissionedCostDetails property: The on premises PaaS decommissioned cost. + * + * @return the onPremisesPaasDecommissionedCostDetails value. + */ + CostDetails onPremisesPaasDecommissionedCostDetails(); + + /** + * Gets the onPremisesIaasDecommissionedCostDetails property: The on premises IaaS decommissioned cost. + * + * @return the onPremisesIaasDecommissionedCostDetails value. + */ + CostDetails onPremisesIaasDecommissionedCostDetails(); + + /** + * Gets the onPremisesAvsDecommissionedCostDetails property: The on premises AVS decommissioned cost. + * + * @return the onPremisesAvsDecommissionedCostDetails value. + */ + CostDetails onPremisesAvsDecommissionedCostDetails(); + + /** + * Gets the futureCostDetails property: Future state cost which includes Azure cost and Arc enabled on-premises cost + * based on the final migration percentage. + * + * @return the futureCostDetails value. + */ + CostDetails futureCostDetails(); + + /** + * Gets the azureArcEnabledOnPremisesCostDetails property: The Azure arc enabled on-premises cost. + * + * @return the azureArcEnabledOnPremisesCostDetails value. + */ + CostDetails azureArcEnabledOnPremisesCostDetails(); + + /** + * Gets the futureAzureArcEnabledOnPremisesCostDetails property: The final azure arc enabled on-premises cost based + * on the final migration percentage. + * + * @return the futureAzureArcEnabledOnPremisesCostDetails value. + */ + CostDetails futureAzureArcEnabledOnPremisesCostDetails(); + + /** + * Gets the azurePaasCarbonEmissionsDetails property: The Azure PaaS Carbon Emissions details. + * + * @return the azurePaasCarbonEmissionsDetails value. + */ + CarbonEmissionsDetails azurePaasCarbonEmissionsDetails(); + + /** + * Gets the azureIaasCarbonEmissionsDetails property: The Azure IaaS Carbon Emissions details. + * + * @return the azureIaasCarbonEmissionsDetails value. + */ + CarbonEmissionsDetails azureIaasCarbonEmissionsDetails(); + + /** + * Gets the azureAvsCarbonEmissionsDetails property: The Azure AvS Carbon Emissions details. + * + * @return the azureAvsCarbonEmissionsDetails value. + */ + CarbonEmissionsDetails azureAvsCarbonEmissionsDetails(); + + /** + * Gets the onPremisesPaasCarbonEmissionsDetails property: The on premises PaaS Carbon Emissions details. + * + * @return the onPremisesPaasCarbonEmissionsDetails value. + */ + CarbonEmissionsDetails onPremisesPaasCarbonEmissionsDetails(); + + /** + * Gets the onPremisesIaasCarbonEmissionsDetails property: The on premises IaaS Carbon Emissions details. + * + * @return the onPremisesIaasCarbonEmissionsDetails value. + */ + CarbonEmissionsDetails onPremisesIaasCarbonEmissionsDetails(); + + /** + * Gets the onPremisesAvsCarbonEmissionsDetails property: The on premises Avs Carbon Emissions details. + * + * @return the onPremisesAvsCarbonEmissionsDetails value. + */ + CarbonEmissionsDetails onPremisesAvsCarbonEmissionsDetails(); + + /** + * Gets the onPremisesPaasDecommissionedCarbonEmissionsDetails property: The on premises PaaS decommissioned Carbon + * Emissions details. + * + * @return the onPremisesPaasDecommissionedCarbonEmissionsDetails value. + */ + CarbonEmissionsDetails onPremisesPaasDecommissionedCarbonEmissionsDetails(); + + /** + * Gets the onPremisesIaasDecommissionedCarbonEmissionsDetails property: The on premises IaaS decommissioned Carbon + * Emissions details. + * + * @return the onPremisesIaasDecommissionedCarbonEmissionsDetails value. + */ + CarbonEmissionsDetails onPremisesIaasDecommissionedCarbonEmissionsDetails(); + + /** + * Gets the onPremisesAvsDecommissionedCarbonEmissionsDetails property: The on premises Avs decommissioned Carbon + * Emissions details. + * + * @return the onPremisesAvsDecommissionedCarbonEmissionsDetails value. + */ + CarbonEmissionsDetails onPremisesAvsDecommissionedCarbonEmissionsDetails(); + + /** + * Gets the inner com.azure.resourcemanager.migration.assessment.fluent.models.CompareSummaryInner object. + * + * @return the inner object. + */ + CompareSummaryInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompatibilityLevel.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompatibilityLevel.java index e97b6f2b703a..be8c4c20cde6 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompatibilityLevel.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompatibilityLevel.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for CompatibilityLevel. + * Compatibility Level. */ public final class CompatibilityLevel extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessment.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessment.java new file mode 100644 index 000000000000..e9d4c6f3f91c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessment.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.CompoundAssessmentInner; + +/** + * An immutable client-side representation of CompoundAssessment. + */ +public interface CompoundAssessment { + /** + * 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. + */ + CompoundAssessmentProperties 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.migration.assessment.fluent.models.CompoundAssessmentInner object. + * + * @return the inner object. + */ + CompoundAssessmentInner innerModel(); + + /** + * The entirety of the CompoundAssessment definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The CompoundAssessment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the CompoundAssessment definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the CompoundAssessment 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 CompoundAssessment 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. + */ + CompoundAssessment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CompoundAssessment create(Context context); + } + + /** + * The stage of the CompoundAssessment 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(CompoundAssessmentProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CompoundAssessment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CompoundAssessment refresh(Context context); + + /** + * A long-running resource action. + * + * @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 data model of Download URL for assessment report. + */ + DownloadUrl downloadUrl(Object body); + + /** + * A long-running resource action. + * + * @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 data model of Download URL for assessment report. + */ + DownloadUrl downloadUrl(Object body, Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessmentDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessmentDetails.java new file mode 100644 index 000000000000..e86df741d1e3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessmentDetails.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Details of the compound assessment. + */ +@Fluent +public final class CompoundAssessmentDetails implements JsonSerializable { + /* + * Timestamp when the assessment was created. + */ + private OffsetDateTime createdTimestamp; + + /* + * Timestamp when the assessment was last updated. + */ + private OffsetDateTime updatedTimestamp; + + /* + * Status of the assessment. + */ + private AssessmentStatus status; + + /** + * Creates an instance of CompoundAssessmentDetails class. + */ + public CompoundAssessmentDetails() { + } + + /** + * Get the createdTimestamp property: Timestamp when the assessment was created. + * + * @return the createdTimestamp value. + */ + public OffsetDateTime createdTimestamp() { + return this.createdTimestamp; + } + + /** + * Set the createdTimestamp property: Timestamp when the assessment was created. + * + * @param createdTimestamp the createdTimestamp value to set. + * @return the CompoundAssessmentDetails object itself. + */ + public CompoundAssessmentDetails withCreatedTimestamp(OffsetDateTime createdTimestamp) { + this.createdTimestamp = createdTimestamp; + return this; + } + + /** + * Get the updatedTimestamp property: Timestamp when the assessment was last updated. + * + * @return the updatedTimestamp value. + */ + public OffsetDateTime updatedTimestamp() { + return this.updatedTimestamp; + } + + /** + * Set the updatedTimestamp property: Timestamp when the assessment was last updated. + * + * @param updatedTimestamp the updatedTimestamp value to set. + * @return the CompoundAssessmentDetails object itself. + */ + public CompoundAssessmentDetails withUpdatedTimestamp(OffsetDateTime updatedTimestamp) { + this.updatedTimestamp = updatedTimestamp; + return this; + } + + /** + * Get the status property: Status of the assessment. + * + * @return the status value. + */ + public AssessmentStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the assessment. + * + * @param status the status value to set. + * @return the CompoundAssessmentDetails object itself. + */ + public CompoundAssessmentDetails withStatus(AssessmentStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property status in model CompoundAssessmentDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CompoundAssessmentDetails.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("createdTimestamp", + this.createdTimestamp == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdTimestamp)); + jsonWriter.writeStringField("updatedTimestamp", + this.updatedTimestamp == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updatedTimestamp)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CompoundAssessmentDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CompoundAssessmentDetails 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 CompoundAssessmentDetails. + */ + public static CompoundAssessmentDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CompoundAssessmentDetails deserializedCompoundAssessmentDetails = new CompoundAssessmentDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedCompoundAssessmentDetails.status = AssessmentStatus.fromString(reader.getString()); + } else if ("createdTimestamp".equals(fieldName)) { + deserializedCompoundAssessmentDetails.createdTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedTimestamp".equals(fieldName)) { + deserializedCompoundAssessmentDetails.updatedTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedCompoundAssessmentDetails; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessmentListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessmentListResult.java new file mode 100644 index 000000000000..6c78237a6ad5 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessmentListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.CompoundAssessmentInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a CompoundAssessment list operation. + */ +@Fluent +public final class CompoundAssessmentListResult implements JsonSerializable { + /* + * The CompoundAssessment items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of CompoundAssessmentListResult class. + */ + public CompoundAssessmentListResult() { + } + + /** + * Get the value property: The CompoundAssessment items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The CompoundAssessment items on this page. + * + * @param value the value value to set. + * @return the CompoundAssessmentListResult object itself. + */ + public CompoundAssessmentListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the CompoundAssessmentListResult object itself. + */ + public CompoundAssessmentListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 CompoundAssessmentListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CompoundAssessmentListResult.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 CompoundAssessmentListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CompoundAssessmentListResult 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 CompoundAssessmentListResult. + */ + public static CompoundAssessmentListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CompoundAssessmentListResult deserializedCompoundAssessmentListResult = new CompoundAssessmentListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CompoundAssessmentInner.fromJson(reader1)); + deserializedCompoundAssessmentListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCompoundAssessmentListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCompoundAssessmentListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessmentOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessmentOperations.java new file mode 100644 index 000000000000..f8c3779e12b3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessmentOperations.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 CompoundAssessmentOperations. + */ +public interface CompoundAssessmentOperations { + /** + * List CompoundAssessment 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 CompoundAssessment list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List CompoundAssessment 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 CompoundAssessment list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 CompoundAssessment along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, + String compoundAssessmentName, Context context); + + /** + * Get a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 CompoundAssessment. + */ + CompoundAssessment get(String resourceGroupName, String projectName, String compoundAssessmentName); + + /** + * Delete a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compoundAssessmentName, + Context context); + + /** + * Delete a CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 compoundAssessmentName); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report. + */ + DownloadUrl downloadUrl(String resourceGroupName, String projectName, String compoundAssessmentName, Object body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 data model of Download URL for assessment report. + */ + DownloadUrl downloadUrl(String resourceGroupName, String projectName, String compoundAssessmentName, Object body, + Context context); + + /** + * Get a CompoundAssessment. + * + * @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 CompoundAssessment along with {@link Response}. + */ + CompoundAssessment getById(String id); + + /** + * Get a CompoundAssessment. + * + * @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 CompoundAssessment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a CompoundAssessment. + * + * @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 CompoundAssessment. + * + * @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 CompoundAssessment resource. + * + * @param name resource name. + * @return the first stage of the new CompoundAssessment definition. + */ + CompoundAssessment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessmentProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessmentProperties.java new file mode 100644 index 000000000000..762d75ad6720 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessmentProperties.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Properties of a compound assessment. + */ +@Fluent +public final class CompoundAssessmentProperties implements JsonSerializable { + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /* + * ARM IDs of the target assessments. + */ + private TargetAssessmentArmIds targetAssessmentArmIds; + + /* + * Fallback machine assessment ARM ID. + */ + private String fallbackMachineAssessmentArmId; + + /* + * Details of the compound assessment. + */ + private CompoundAssessmentDetails details; + + /** + * Creates an instance of CompoundAssessmentProperties class. + */ + public CompoundAssessmentProperties() { + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the targetAssessmentArmIds property: ARM IDs of the target assessments. + * + * @return the targetAssessmentArmIds value. + */ + public TargetAssessmentArmIds targetAssessmentArmIds() { + return this.targetAssessmentArmIds; + } + + /** + * Set the targetAssessmentArmIds property: ARM IDs of the target assessments. + * + * @param targetAssessmentArmIds the targetAssessmentArmIds value to set. + * @return the CompoundAssessmentProperties object itself. + */ + public CompoundAssessmentProperties withTargetAssessmentArmIds(TargetAssessmentArmIds targetAssessmentArmIds) { + this.targetAssessmentArmIds = targetAssessmentArmIds; + return this; + } + + /** + * Get the fallbackMachineAssessmentArmId property: Fallback machine assessment ARM ID. + * + * @return the fallbackMachineAssessmentArmId value. + */ + public String fallbackMachineAssessmentArmId() { + return this.fallbackMachineAssessmentArmId; + } + + /** + * Set the fallbackMachineAssessmentArmId property: Fallback machine assessment ARM ID. + * + * @param fallbackMachineAssessmentArmId the fallbackMachineAssessmentArmId value to set. + * @return the CompoundAssessmentProperties object itself. + */ + public CompoundAssessmentProperties withFallbackMachineAssessmentArmId(String fallbackMachineAssessmentArmId) { + this.fallbackMachineAssessmentArmId = fallbackMachineAssessmentArmId; + return this; + } + + /** + * Get the details property: Details of the compound assessment. + * + * @return the details value. + */ + public CompoundAssessmentDetails details() { + return this.details; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetAssessmentArmIds() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetAssessmentArmIds in model CompoundAssessmentProperties")); + } else { + targetAssessmentArmIds().validate(); + } + if (details() != null) { + details().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CompoundAssessmentProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("targetAssessmentArmIds", this.targetAssessmentArmIds); + jsonWriter.writeStringField("fallbackMachineAssessmentArmId", this.fallbackMachineAssessmentArmId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CompoundAssessmentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CompoundAssessmentProperties 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 CompoundAssessmentProperties. + */ + public static CompoundAssessmentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CompoundAssessmentProperties deserializedCompoundAssessmentProperties = new CompoundAssessmentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetAssessmentArmIds".equals(fieldName)) { + deserializedCompoundAssessmentProperties.targetAssessmentArmIds + = TargetAssessmentArmIds.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedCompoundAssessmentProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("fallbackMachineAssessmentArmId".equals(fieldName)) { + deserializedCompoundAssessmentProperties.fallbackMachineAssessmentArmId = reader.getString(); + } else if ("details".equals(fieldName)) { + deserializedCompoundAssessmentProperties.details = CompoundAssessmentDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCompoundAssessmentProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessmentSummaryOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessmentSummaryOperations.java new file mode 100644 index 000000000000..3047cb7e2f4d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CompoundAssessmentSummaryOperations.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 CompoundAssessmentSummaryOperations. + */ +public interface CompoundAssessmentSummaryOperations { + /** + * List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 WebAppCompoundAssessmentSummary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String compoundAssessmentName); + + /** + * List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment 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 WebAppCompoundAssessmentSummary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String compoundAssessmentName, Context context); + + /** + * Get a WebAppCompoundAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment ARM name. + * @param summaryName Gets the Name of the WebApp compound assessment 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 WebAppCompoundAssessmentSummary along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, + String compoundAssessmentName, String summaryName, Context context); + + /** + * Get a WebAppCompoundAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param compoundAssessmentName Compound Assessment ARM name. + * @param summaryName Gets the Name of the WebApp compound assessment 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 WebAppCompoundAssessmentSummary. + */ + WebAppCompoundAssessmentSummary get(String resourceGroupName, String projectName, String compoundAssessmentName, + String summaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ComputeResource.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ComputeResource.java new file mode 100644 index 000000000000..bca3cc7664d3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ComputeResource.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Data model of Cores and Memory Compute Resource. + */ +@Immutable +public final class ComputeResource implements JsonSerializable { + /* + * Gets cores. + */ + private float cores; + + /* + * Gets memory. + */ + private float memory; + + /** + * Creates an instance of ComputeResource class. + */ + public ComputeResource() { + } + + /** + * Get the cores property: Gets cores. + * + * @return the cores value. + */ + public float cores() { + return this.cores; + } + + /** + * Get the memory property: Gets memory. + * + * @return the memory value. + */ + public float memory() { + return this.memory; + } + + /** + * 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 ComputeResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeResource 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 ComputeResource. + */ + public static ComputeResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeResource deserializedComputeResource = new ComputeResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cores".equals(fieldName)) { + deserializedComputeResource.cores = reader.getFloat(); + } else if ("memory".equals(fieldName)) { + deserializedComputeResource.memory = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeResource; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ComputeSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ComputeSettings.java new file mode 100644 index 000000000000..e4be6419f1d6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ComputeSettings.java @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Compute settings. + */ +@Fluent +public final class ComputeSettings implements JsonSerializable { + /* + * Hyperthread core to memory ratio. + */ + private float hyperthreadCoreToMemoryRatio; + + /* + * Compute Price. + */ + private float price; + + /* + * Compute Hardware Maintenance Cost. + */ + private float computeHardwareMaintenanceCost; + + /* + * VM Oversubscription Ratio. + */ + private float vmOversubscriptionRatio; + + /* + * CPU Oversubscription Ratio. + */ + private float cpuOversubscriptionRatio; + + /* + * SQL Server licensing settings. + */ + private List sqlServerLicensing; + + /* + * Windows Server licensing settings. + */ + private WindowsServerLicensingSettings windowsServerLicensing; + + /* + * Linux Rhel Server licensing settings. + */ + private LinuxServerLicensingSettings rhelLinuxServerLicensing; + + /* + * Linux Suse Server licensing settings. + */ + private LinuxServerLicensingSettings suseLinuxServerLicensing; + + /* + * Virtualization software settings. + */ + private VirtualizationSoftwareSettings virtualizationSoftwareSettings; + + /** + * Creates an instance of ComputeSettings class. + */ + public ComputeSettings() { + } + + /** + * Get the hyperthreadCoreToMemoryRatio property: Hyperthread core to memory ratio. + * + * @return the hyperthreadCoreToMemoryRatio value. + */ + public float hyperthreadCoreToMemoryRatio() { + return this.hyperthreadCoreToMemoryRatio; + } + + /** + * Set the hyperthreadCoreToMemoryRatio property: Hyperthread core to memory ratio. + * + * @param hyperthreadCoreToMemoryRatio the hyperthreadCoreToMemoryRatio value to set. + * @return the ComputeSettings object itself. + */ + public ComputeSettings withHyperthreadCoreToMemoryRatio(float hyperthreadCoreToMemoryRatio) { + this.hyperthreadCoreToMemoryRatio = hyperthreadCoreToMemoryRatio; + return this; + } + + /** + * Get the price property: Compute Price. + * + * @return the price value. + */ + public float price() { + return this.price; + } + + /** + * Set the price property: Compute Price. + * + * @param price the price value to set. + * @return the ComputeSettings object itself. + */ + public ComputeSettings withPrice(float price) { + this.price = price; + return this; + } + + /** + * Get the computeHardwareMaintenanceCost property: Compute Hardware Maintenance Cost. + * + * @return the computeHardwareMaintenanceCost value. + */ + public float computeHardwareMaintenanceCost() { + return this.computeHardwareMaintenanceCost; + } + + /** + * Set the computeHardwareMaintenanceCost property: Compute Hardware Maintenance Cost. + * + * @param computeHardwareMaintenanceCost the computeHardwareMaintenanceCost value to set. + * @return the ComputeSettings object itself. + */ + public ComputeSettings withComputeHardwareMaintenanceCost(float computeHardwareMaintenanceCost) { + this.computeHardwareMaintenanceCost = computeHardwareMaintenanceCost; + return this; + } + + /** + * Get the vmOversubscriptionRatio property: VM Oversubscription Ratio. + * + * @return the vmOversubscriptionRatio value. + */ + public float vmOversubscriptionRatio() { + return this.vmOversubscriptionRatio; + } + + /** + * Set the vmOversubscriptionRatio property: VM Oversubscription Ratio. + * + * @param vmOversubscriptionRatio the vmOversubscriptionRatio value to set. + * @return the ComputeSettings object itself. + */ + public ComputeSettings withVmOversubscriptionRatio(float vmOversubscriptionRatio) { + this.vmOversubscriptionRatio = vmOversubscriptionRatio; + return this; + } + + /** + * Get the cpuOversubscriptionRatio property: CPU Oversubscription Ratio. + * + * @return the cpuOversubscriptionRatio value. + */ + public float cpuOversubscriptionRatio() { + return this.cpuOversubscriptionRatio; + } + + /** + * Set the cpuOversubscriptionRatio property: CPU Oversubscription Ratio. + * + * @param cpuOversubscriptionRatio the cpuOversubscriptionRatio value to set. + * @return the ComputeSettings object itself. + */ + public ComputeSettings withCpuOversubscriptionRatio(float cpuOversubscriptionRatio) { + this.cpuOversubscriptionRatio = cpuOversubscriptionRatio; + return this; + } + + /** + * Get the sqlServerLicensing property: SQL Server licensing settings. + * + * @return the sqlServerLicensing value. + */ + public List sqlServerLicensing() { + return this.sqlServerLicensing; + } + + /** + * Set the sqlServerLicensing property: SQL Server licensing settings. + * + * @param sqlServerLicensing the sqlServerLicensing value to set. + * @return the ComputeSettings object itself. + */ + public ComputeSettings withSqlServerLicensing(List sqlServerLicensing) { + this.sqlServerLicensing = sqlServerLicensing; + return this; + } + + /** + * Get the windowsServerLicensing property: Windows Server licensing settings. + * + * @return the windowsServerLicensing value. + */ + public WindowsServerLicensingSettings windowsServerLicensing() { + return this.windowsServerLicensing; + } + + /** + * Set the windowsServerLicensing property: Windows Server licensing settings. + * + * @param windowsServerLicensing the windowsServerLicensing value to set. + * @return the ComputeSettings object itself. + */ + public ComputeSettings withWindowsServerLicensing(WindowsServerLicensingSettings windowsServerLicensing) { + this.windowsServerLicensing = windowsServerLicensing; + return this; + } + + /** + * Get the rhelLinuxServerLicensing property: Linux Rhel Server licensing settings. + * + * @return the rhelLinuxServerLicensing value. + */ + public LinuxServerLicensingSettings rhelLinuxServerLicensing() { + return this.rhelLinuxServerLicensing; + } + + /** + * Set the rhelLinuxServerLicensing property: Linux Rhel Server licensing settings. + * + * @param rhelLinuxServerLicensing the rhelLinuxServerLicensing value to set. + * @return the ComputeSettings object itself. + */ + public ComputeSettings withRhelLinuxServerLicensing(LinuxServerLicensingSettings rhelLinuxServerLicensing) { + this.rhelLinuxServerLicensing = rhelLinuxServerLicensing; + return this; + } + + /** + * Get the suseLinuxServerLicensing property: Linux Suse Server licensing settings. + * + * @return the suseLinuxServerLicensing value. + */ + public LinuxServerLicensingSettings suseLinuxServerLicensing() { + return this.suseLinuxServerLicensing; + } + + /** + * Set the suseLinuxServerLicensing property: Linux Suse Server licensing settings. + * + * @param suseLinuxServerLicensing the suseLinuxServerLicensing value to set. + * @return the ComputeSettings object itself. + */ + public ComputeSettings withSuseLinuxServerLicensing(LinuxServerLicensingSettings suseLinuxServerLicensing) { + this.suseLinuxServerLicensing = suseLinuxServerLicensing; + return this; + } + + /** + * Get the virtualizationSoftwareSettings property: Virtualization software settings. + * + * @return the virtualizationSoftwareSettings value. + */ + public VirtualizationSoftwareSettings virtualizationSoftwareSettings() { + return this.virtualizationSoftwareSettings; + } + + /** + * Set the virtualizationSoftwareSettings property: Virtualization software settings. + * + * @param virtualizationSoftwareSettings the virtualizationSoftwareSettings value to set. + * @return the ComputeSettings object itself. + */ + public ComputeSettings + withVirtualizationSoftwareSettings(VirtualizationSoftwareSettings virtualizationSoftwareSettings) { + this.virtualizationSoftwareSettings = virtualizationSoftwareSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sqlServerLicensing() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sqlServerLicensing in model ComputeSettings")); + } else { + sqlServerLicensing().forEach(e -> e.validate()); + } + if (windowsServerLicensing() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property windowsServerLicensing in model ComputeSettings")); + } else { + windowsServerLicensing().validate(); + } + if (rhelLinuxServerLicensing() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property rhelLinuxServerLicensing in model ComputeSettings")); + } else { + rhelLinuxServerLicensing().validate(); + } + if (suseLinuxServerLicensing() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property suseLinuxServerLicensing in model ComputeSettings")); + } else { + suseLinuxServerLicensing().validate(); + } + if (virtualizationSoftwareSettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property virtualizationSoftwareSettings in model ComputeSettings")); + } else { + virtualizationSoftwareSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ComputeSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeFloatField("hyperthreadCoreToMemoryRatio", this.hyperthreadCoreToMemoryRatio); + jsonWriter.writeFloatField("price", this.price); + jsonWriter.writeFloatField("computeHardwareMaintenanceCost", this.computeHardwareMaintenanceCost); + jsonWriter.writeFloatField("vmOversubscriptionRatio", this.vmOversubscriptionRatio); + jsonWriter.writeFloatField("cpuOversubscriptionRatio", this.cpuOversubscriptionRatio); + jsonWriter.writeArrayField("sqlServerLicensing", this.sqlServerLicensing, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("windowsServerLicensing", this.windowsServerLicensing); + jsonWriter.writeJsonField("rhelLinuxServerLicensing", this.rhelLinuxServerLicensing); + jsonWriter.writeJsonField("suseLinuxServerLicensing", this.suseLinuxServerLicensing); + jsonWriter.writeJsonField("virtualizationSoftwareSettings", this.virtualizationSoftwareSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeSettings 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 ComputeSettings. + */ + public static ComputeSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeSettings deserializedComputeSettings = new ComputeSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hyperthreadCoreToMemoryRatio".equals(fieldName)) { + deserializedComputeSettings.hyperthreadCoreToMemoryRatio = reader.getFloat(); + } else if ("price".equals(fieldName)) { + deserializedComputeSettings.price = reader.getFloat(); + } else if ("computeHardwareMaintenanceCost".equals(fieldName)) { + deserializedComputeSettings.computeHardwareMaintenanceCost = reader.getFloat(); + } else if ("vmOversubscriptionRatio".equals(fieldName)) { + deserializedComputeSettings.vmOversubscriptionRatio = reader.getFloat(); + } else if ("cpuOversubscriptionRatio".equals(fieldName)) { + deserializedComputeSettings.cpuOversubscriptionRatio = reader.getFloat(); + } else if ("sqlServerLicensing".equals(fieldName)) { + List sqlServerLicensing + = reader.readArray(reader1 -> SqlServerLicensingSettings.fromJson(reader1)); + deserializedComputeSettings.sqlServerLicensing = sqlServerLicensing; + } else if ("windowsServerLicensing".equals(fieldName)) { + deserializedComputeSettings.windowsServerLicensing + = WindowsServerLicensingSettings.fromJson(reader); + } else if ("rhelLinuxServerLicensing".equals(fieldName)) { + deserializedComputeSettings.rhelLinuxServerLicensing + = LinuxServerLicensingSettings.fromJson(reader); + } else if ("suseLinuxServerLicensing".equals(fieldName)) { + deserializedComputeSettings.suseLinuxServerLicensing + = LinuxServerLicensingSettings.fromJson(reader); + } else if ("virtualizationSoftwareSettings".equals(fieldName)) { + deserializedComputeSettings.virtualizationSoftwareSettings + = VirtualizationSoftwareSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ComputeTier.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ComputeTier.java index cbd82f4f8827..9c2c54ac4b9c 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ComputeTier.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ComputeTier.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for ComputeTier. + * Compute Tier. */ public final class ComputeTier extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Configuration.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Configuration.java new file mode 100644 index 000000000000..b5f34574e77e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Configuration.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ConsolidationType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ConsolidationType.java new file mode 100644 index 000000000000..5e94a3f0b80d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ConsolidationType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Consolidation Type. + */ +public final class ConsolidationType extends ExpandableStringEnum { + /** + * Static value Full for ConsolidationType. + */ + public static final ConsolidationType FULL = fromString("Full"); + + /** + * Static value AsOnSource for ConsolidationType. + */ + public static final ConsolidationType AS_ON_SOURCE = fromString("AsOnSource"); + + /** + * Creates a new instance of ConsolidationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConsolidationType() { + } + + /** + * Creates or finds a ConsolidationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConsolidationType. + */ + public static ConsolidationType fromString(String name) { + return fromString(name, ConsolidationType.class); + } + + /** + * Gets known ConsolidationType values. + * + * @return known ConsolidationType values. + */ + public static Collection values() { + return values(ConsolidationType.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostByStorageType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostByStorageType.java new file mode 100644 index 000000000000..defaf4b71f09 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostByStorageType.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 cost by storage type. + */ +@Immutable +public final class CostByStorageType implements JsonSerializable { + /* + * The storage type. + */ + private String storageType; + + /* + * Cost per storage type. + */ + private Float cost; + + /** + * Creates an instance of CostByStorageType class. + */ + public CostByStorageType() { + } + + /** + * Get the storageType property: The storage type. + * + * @return the storageType value. + */ + public String storageType() { + return this.storageType; + } + + /** + * Get the cost property: Cost per storage type. + * + * @return the cost value. + */ + public Float cost() { + return this.cost; + } + + /** + * 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 CostByStorageType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CostByStorageType 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 CostByStorageType. + */ + public static CostByStorageType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CostByStorageType deserializedCostByStorageType = new CostByStorageType(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageType".equals(fieldName)) { + deserializedCostByStorageType.storageType = reader.getString(); + } else if ("cost".equals(fieldName)) { + deserializedCostByStorageType.cost = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedCostByStorageType; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostComponentName.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostComponentName.java index 9e0c4454c89d..dde51daa412f 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostComponentName.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostComponentName.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Enum to represent component name. + * Cost Component Name. */ public final class CostComponentName extends ExpandableStringEnum { /** @@ -32,6 +32,32 @@ public final class CostComponentName extends ExpandableStringEnum { + /* + * The storage cost. + */ + private Float storageCost; + + /* + * The compute cost. + */ + private Float computeCost; + + /* + * The IT labor cost. + */ + private Float itLaborCost; + + /* + * The network cost. + */ + private Float networkCost; + + /* + * The windows AhubSavings. + */ + private Float ahubSavings; + + /* + * The linux AhubSavings. + */ + private Float linuxAhubSavings; + + /* + * Security Cost. + */ + private Float securityCost; + + /* + * Management Cost Details. + */ + private ManagementCostDetails managementCostDetails; + + /* + * esu savings. + */ + private Float esuSavings; + + /* + * The facilities cost. + */ + private Float facilitiesCost; + + /** + * Creates an instance of CostDetails class. + */ + public CostDetails() { + } + + /** + * Get the storageCost property: The storage cost. + * + * @return the storageCost value. + */ + public Float storageCost() { + return this.storageCost; + } + + /** + * Get the computeCost property: The compute cost. + * + * @return the computeCost value. + */ + public Float computeCost() { + return this.computeCost; + } + + /** + * Get the itLaborCost property: The IT labor cost. + * + * @return the itLaborCost value. + */ + public Float itLaborCost() { + return this.itLaborCost; + } + + /** + * Get the networkCost property: The network cost. + * + * @return the networkCost value. + */ + public Float networkCost() { + return this.networkCost; + } + + /** + * Get the ahubSavings property: The windows AhubSavings. + * + * @return the ahubSavings value. + */ + public Float ahubSavings() { + return this.ahubSavings; + } + + /** + * Get the linuxAhubSavings property: The linux AhubSavings. + * + * @return the linuxAhubSavings value. + */ + public Float linuxAhubSavings() { + return this.linuxAhubSavings; + } + + /** + * Get the securityCost property: Security Cost. + * + * @return the securityCost value. + */ + public Float securityCost() { + return this.securityCost; + } + + /** + * Get the managementCostDetails property: Management Cost Details. + * + * @return the managementCostDetails value. + */ + public ManagementCostDetails managementCostDetails() { + return this.managementCostDetails; + } + + /** + * Get the esuSavings property: esu savings. + * + * @return the esuSavings value. + */ + public Float esuSavings() { + return this.esuSavings; + } + + /** + * Get the facilitiesCost property: The facilities cost. + * + * @return the facilitiesCost value. + */ + public Float facilitiesCost() { + return this.facilitiesCost; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managementCostDetails() != null) { + managementCostDetails().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CostDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CostDetails 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 CostDetails. + */ + public static CostDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CostDetails deserializedCostDetails = new CostDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageCost".equals(fieldName)) { + deserializedCostDetails.storageCost = reader.getNullable(JsonReader::getFloat); + } else if ("computeCost".equals(fieldName)) { + deserializedCostDetails.computeCost = reader.getNullable(JsonReader::getFloat); + } else if ("itLaborCost".equals(fieldName)) { + deserializedCostDetails.itLaborCost = reader.getNullable(JsonReader::getFloat); + } else if ("networkCost".equals(fieldName)) { + deserializedCostDetails.networkCost = reader.getNullable(JsonReader::getFloat); + } else if ("ahubSavings".equals(fieldName)) { + deserializedCostDetails.ahubSavings = reader.getNullable(JsonReader::getFloat); + } else if ("linuxAhubSavings".equals(fieldName)) { + deserializedCostDetails.linuxAhubSavings = reader.getNullable(JsonReader::getFloat); + } else if ("securityCost".equals(fieldName)) { + deserializedCostDetails.securityCost = reader.getNullable(JsonReader::getFloat); + } else if ("managementCostDetails".equals(fieldName)) { + deserializedCostDetails.managementCostDetails = ManagementCostDetails.fromJson(reader); + } else if ("esuSavings".equals(fieldName)) { + deserializedCostDetails.esuSavings = reader.getNullable(JsonReader::getFloat); + } else if ("facilitiesCost".equals(fieldName)) { + deserializedCostDetails.facilitiesCost = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedCostDetails; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostDetailsCommon.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostDetailsCommon.java new file mode 100644 index 000000000000..234a5d1b2272 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostDetailsCommon.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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 -> CostDetailsCommonCostDetailItem.fromJson(reader1)); + deserializedCostDetailsCommon.costDetail = costDetail; + } else { + reader.skipChildren(); + } + } + + return deserializedCostDetailsCommon; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostDetailsCommonCostDetailItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostDetailsCommonCostDetailItem.java new file mode 100644 index 000000000000..5496e73501f6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostDetailsCommonCostDetailItem.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 CostDetailsCommonCostDetailItem implements JsonSerializable { + /* + * The name. + */ + private CostType name; + + /* + * The value. + */ + private Float value; + + /** + * Creates an instance of CostDetailsCommonCostDetailItem class. + */ + public CostDetailsCommonCostDetailItem() { + } + + /** + * 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 Float 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 CostDetailsCommonCostDetailItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CostDetailsCommonCostDetailItem 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 CostDetailsCommonCostDetailItem. + */ + public static CostDetailsCommonCostDetailItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CostDetailsCommonCostDetailItem deserializedCostDetailsCommonCostDetailItem + = new CostDetailsCommonCostDetailItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCostDetailsCommonCostDetailItem.name = CostType.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedCostDetailsCommonCostDetailItem.value = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedCostDetailsCommonCostDetailItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostType.java new file mode 100644 index 000000000000..abb57642d68d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/CostType.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Cost type. + */ +public final class CostType extends ExpandableStringEnum { + /** + * Static value MonthlyStorageCost for CostType. + */ + public static final CostType MONTHLY_STORAGE_COST = fromString("MonthlyStorageCost"); + + /** + * Static value MonthlyComputeCost for CostType. + */ + public static final CostType MONTHLY_COMPUTE_COST = fromString("MonthlyComputeCost"); + + /** + * Static value MonthlyLicensingCost for CostType. + */ + public static final CostType MONTHLY_LICENSING_COST = fromString("MonthlyLicensingCost"); + + /** + * Static value MonthlySecurityCost for CostType. + */ + public static final CostType MONTHLY_SECURITY_COST = fromString("MonthlySecurityCost"); + + /** + * Static value MonthlyManagementCost for CostType. + */ + public static final CostType MONTHLY_MANAGEMENT_COST = fromString("MonthlyManagementCost"); + + /** + * Static value MonitoringService for CostType. + */ + public static final CostType MONITORING_SERVICE = fromString("MonitoringService"); + + /** + * Static value DataProtectionService for CostType. + */ + public static final CostType DATA_PROTECTION_SERVICE = fromString("DataProtectionService"); + + /** + * Static value PatchingService for CostType. + */ + public static final CostType PATCHING_SERVICE = fromString("PatchingService"); + + /** + * Static value MonthlyAzureHybridCost for CostType. + */ + public static final CostType MONTHLY_AZURE_HYBRID_COST = fromString("MonthlyAzureHybridCost"); + + /** + * Static value MonthlyPremiumV2StorageCost for CostType. + */ + public static final CostType MONTHLY_PREMIUM_V2STORAGE_COST = fromString("MonthlyPremiumV2StorageCost"); + + /** + * Static value MonthlyLinuxAzureHybridCost for CostType. + */ + public static final CostType MONTHLY_LINUX_AZURE_HYBRID_COST = fromString("MonthlyLinuxAzureHybridCost"); + + /** + * Static value MonthlyUltraStorageCost for CostType. + */ + public static final CostType MONTHLY_ULTRA_STORAGE_COST = fromString("MonthlyUltraStorageCost"); + + /** + * Static value MonthlyStandardSsdStorageCost for CostType. + */ + public static final CostType MONTHLY_STANDARD_SSD_STORAGE_COST = fromString("MonthlyStandardSsdStorageCost"); + + /** + * Static value MonthlyBandwidthCost for CostType. + */ + public static final CostType MONTHLY_BANDWIDTH_COST = fromString("MonthlyBandwidthCost"); + + /** + * Static value MonthlyPremiumStorageCost for CostType. + */ + public static final CostType MONTHLY_PREMIUM_STORAGE_COST = fromString("MonthlyPremiumStorageCost"); + + /** + * Static value MonthlyUltraDiskCost for CostType. + */ + public static final CostType MONTHLY_ULTRA_DISK_COST = fromString("MonthlyUltraDiskCost"); + + /** + * Static value MonthlyStandardHddStorageCost for CostType. + */ + public static final CostType MONTHLY_STANDARD_HDD_STORAGE_COST = fromString("MonthlyStandardHddStorageCost"); + + /** + * Static value MonthlyAvsExternalStorageCost for CostType. + */ + public static final CostType MONTHLY_AVS_EXTERNAL_STORAGE_COST = fromString("MonthlyAvsExternalStorageCost"); + + /** + * Static value MonthlyAvsNetworkCost for CostType. + */ + public static final CostType MONTHLY_AVS_NETWORK_COST = fromString("MonthlyAvsNetworkCost"); + + /** + * Static value MonthlyAvsNodeCost for CostType. + */ + public static final CostType MONTHLY_AVS_NODE_COST = fromString("MonthlyAvsNodeCost"); + + /** + * Static value TotalMonthlyCost for CostType. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DiscoveredEntityLightSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DiscoveredEntityLightSummary.java new file mode 100644 index 000000000000..c349b048f404 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DiscoveredEntityLightSummary.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Discovered entity light summary. + */ +@Fluent +public final class DiscoveredEntityLightSummary implements JsonSerializable { + /* + * Gets or sets the number of servers. + */ + private int numberOfServers; + + /* + * Gets or sets the number of web apps. + */ + private int numberOfWebApps; + + /* + * Gets or sets the number of machines. + */ + private int numberOfMachines; + + /** + * Creates an instance of DiscoveredEntityLightSummary class. + */ + public DiscoveredEntityLightSummary() { + } + + /** + * Get the numberOfServers property: Gets or sets the number of servers. + * + * @return the numberOfServers value. + */ + public int numberOfServers() { + return this.numberOfServers; + } + + /** + * Set the numberOfServers property: Gets or sets the number of servers. + * + * @param numberOfServers the numberOfServers value to set. + * @return the DiscoveredEntityLightSummary object itself. + */ + public DiscoveredEntityLightSummary withNumberOfServers(int numberOfServers) { + this.numberOfServers = numberOfServers; + return this; + } + + /** + * Get the numberOfWebApps property: Gets or sets the number of web apps. + * + * @return the numberOfWebApps value. + */ + public int numberOfWebApps() { + return this.numberOfWebApps; + } + + /** + * Set the numberOfWebApps property: Gets or sets the number of web apps. + * + * @param numberOfWebApps the numberOfWebApps value to set. + * @return the DiscoveredEntityLightSummary object itself. + */ + public DiscoveredEntityLightSummary withNumberOfWebApps(int numberOfWebApps) { + this.numberOfWebApps = numberOfWebApps; + return this; + } + + /** + * Get the numberOfMachines property: Gets or sets the number of machines. + * + * @return the numberOfMachines value. + */ + public int numberOfMachines() { + return this.numberOfMachines; + } + + /** + * Set the numberOfMachines property: Gets or sets the number of machines. + * + * @param numberOfMachines the numberOfMachines value to set. + * @return the DiscoveredEntityLightSummary object itself. + */ + public DiscoveredEntityLightSummary withNumberOfMachines(int numberOfMachines) { + this.numberOfMachines = numberOfMachines; + 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.writeIntField("numberOfServers", this.numberOfServers); + jsonWriter.writeIntField("numberOfWebApps", this.numberOfWebApps); + jsonWriter.writeIntField("numberOfMachines", this.numberOfMachines); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiscoveredEntityLightSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiscoveredEntityLightSummary 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 DiscoveredEntityLightSummary. + */ + public static DiscoveredEntityLightSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiscoveredEntityLightSummary deserializedDiscoveredEntityLightSummary = new DiscoveredEntityLightSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("numberOfServers".equals(fieldName)) { + deserializedDiscoveredEntityLightSummary.numberOfServers = reader.getInt(); + } else if ("numberOfWebApps".equals(fieldName)) { + deserializedDiscoveredEntityLightSummary.numberOfWebApps = reader.getInt(); + } else if ("numberOfMachines".equals(fieldName)) { + deserializedDiscoveredEntityLightSummary.numberOfMachines = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedDiscoveredEntityLightSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DiscoveredLightSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DiscoveredLightSummary.java new file mode 100644 index 000000000000..357fc2e5fe21 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DiscoveredLightSummary.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Summary of the compound assessment. + */ +@Fluent +public final class DiscoveredLightSummary implements JsonSerializable { + /* + * Number of web apps. + */ + private int numberOfWebApps; + + /* + * Number of web apps per type. + */ + private List numberOfWebAppsPerType; + + /* + * Number of web servers per type. + */ + private List numberOfWebServersPerType; + + /* + * Number of web servers. + */ + private int numberOfWebServers; + + /* + * Number of servers. + */ + private int numberOfServers; + + /** + * Creates an instance of DiscoveredLightSummary class. + */ + public DiscoveredLightSummary() { + } + + /** + * Get the numberOfWebApps property: Number of web apps. + * + * @return the numberOfWebApps value. + */ + public int numberOfWebApps() { + return this.numberOfWebApps; + } + + /** + * Set the numberOfWebApps property: Number of web apps. + * + * @param numberOfWebApps the numberOfWebApps value to set. + * @return the DiscoveredLightSummary object itself. + */ + public DiscoveredLightSummary withNumberOfWebApps(int numberOfWebApps) { + this.numberOfWebApps = numberOfWebApps; + return this; + } + + /** + * Get the numberOfWebAppsPerType property: Number of web apps per type. + * + * @return the numberOfWebAppsPerType value. + */ + public List numberOfWebAppsPerType() { + return this.numberOfWebAppsPerType; + } + + /** + * Set the numberOfWebAppsPerType property: Number of web apps per type. + * + * @param numberOfWebAppsPerType the numberOfWebAppsPerType value to set. + * @return the DiscoveredLightSummary object itself. + */ + public DiscoveredLightSummary withNumberOfWebAppsPerType(List numberOfWebAppsPerType) { + this.numberOfWebAppsPerType = numberOfWebAppsPerType; + return this; + } + + /** + * Get the numberOfWebServersPerType property: Number of web servers per type. + * + * @return the numberOfWebServersPerType value. + */ + public List numberOfWebServersPerType() { + return this.numberOfWebServersPerType; + } + + /** + * Set the numberOfWebServersPerType property: Number of web servers per type. + * + * @param numberOfWebServersPerType the numberOfWebServersPerType value to set. + * @return the DiscoveredLightSummary object itself. + */ + public DiscoveredLightSummary withNumberOfWebServersPerType(List numberOfWebServersPerType) { + this.numberOfWebServersPerType = numberOfWebServersPerType; + return this; + } + + /** + * Get the numberOfWebServers property: Number of web servers. + * + * @return the numberOfWebServers value. + */ + public int numberOfWebServers() { + return this.numberOfWebServers; + } + + /** + * Set the numberOfWebServers property: Number of web servers. + * + * @param numberOfWebServers the numberOfWebServers value to set. + * @return the DiscoveredLightSummary object itself. + */ + public DiscoveredLightSummary withNumberOfWebServers(int numberOfWebServers) { + this.numberOfWebServers = numberOfWebServers; + return this; + } + + /** + * Get the numberOfServers property: Number of servers. + * + * @return the numberOfServers value. + */ + public int numberOfServers() { + return this.numberOfServers; + } + + /** + * Set the numberOfServers property: Number of servers. + * + * @param numberOfServers the numberOfServers value to set. + * @return the DiscoveredLightSummary object itself. + */ + public DiscoveredLightSummary withNumberOfServers(int numberOfServers) { + this.numberOfServers = numberOfServers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (numberOfWebAppsPerType() != null) { + numberOfWebAppsPerType().forEach(e -> e.validate()); + } + if (numberOfWebServersPerType() != null) { + numberOfWebServersPerType().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("numberOfWebApps", this.numberOfWebApps); + jsonWriter.writeIntField("numberOfWebServers", this.numberOfWebServers); + jsonWriter.writeIntField("numberOfServers", this.numberOfServers); + jsonWriter.writeArrayField("numberOfWebAppsPerType", this.numberOfWebAppsPerType, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("numberOfWebServersPerType", this.numberOfWebServersPerType, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiscoveredLightSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiscoveredLightSummary 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 DiscoveredLightSummary. + */ + public static DiscoveredLightSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiscoveredLightSummary deserializedDiscoveredLightSummary = new DiscoveredLightSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("numberOfWebApps".equals(fieldName)) { + deserializedDiscoveredLightSummary.numberOfWebApps = reader.getInt(); + } else if ("numberOfWebServers".equals(fieldName)) { + deserializedDiscoveredLightSummary.numberOfWebServers = reader.getInt(); + } else if ("numberOfServers".equals(fieldName)) { + deserializedDiscoveredLightSummary.numberOfServers = reader.getInt(); + } else if ("numberOfWebAppsPerType".equals(fieldName)) { + List numberOfWebAppsPerType + = reader.readArray(reader1 -> WebAppsPerType.fromJson(reader1)); + deserializedDiscoveredLightSummary.numberOfWebAppsPerType = numberOfWebAppsPerType; + } else if ("numberOfWebServersPerType".equals(fieldName)) { + List numberOfWebServersPerType + = reader.readArray(reader1 -> WebServersPerType.fromJson(reader1)); + deserializedDiscoveredLightSummary.numberOfWebServersPerType = numberOfWebServersPerType; + } else { + reader.skipChildren(); + } + } + + return deserializedDiscoveredLightSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DiscoverySource.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DiscoverySource.java new file mode 100644 index 000000000000..603df9aebb42 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DiscoverySource.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Workload discovery source. + */ +public final class DiscoverySource extends ExpandableStringEnum { + /** + * Static value Unknown for DiscoverySource. + */ + public static final DiscoverySource UNKNOWN = fromString("Unknown"); + + /** + * Static value Appliance for DiscoverySource. + */ + public static final DiscoverySource APPLIANCE = fromString("Appliance"); + + /** + * Static value Import for DiscoverySource. + */ + public static final DiscoverySource IMPORT = fromString("Import"); + + /** + * Creates a new instance of DiscoverySource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiscoverySource() { + } + + /** + * Creates or finds a DiscoverySource from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiscoverySource. + */ + public static DiscoverySource fromString(String name) { + return fromString(name, DiscoverySource.class); + } + + /** + * Gets known DiscoverySource values. + * + * @return known DiscoverySource values. + */ + public static Collection values() { + return values(DiscoverySource.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Disk.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Disk.java deleted file mode 100644 index c84fb6546112..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Disk.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * A disk discovered on a machine. - */ -@Immutable -public final class Disk implements JsonSerializable { - /* - * Gigabytes of storage provisioned for this disk. - */ - private Float gigabytesAllocated; - - /* - * User friendly name of the disk. - */ - private String displayName; - - /** - * Creates an instance of Disk class. - */ - public Disk() { - } - - /** - * Get the gigabytesAllocated property: Gigabytes of storage provisioned for this disk. - * - * @return the gigabytesAllocated value. - */ - public Float gigabytesAllocated() { - return this.gigabytesAllocated; - } - - /** - * Get the displayName property: User friendly name of the disk. - * - * @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(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Disk from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Disk 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 Disk. - */ - public static Disk fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Disk deserializedDisk = new Disk(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("gigabytesAllocated".equals(fieldName)) { - deserializedDisk.gigabytesAllocated = reader.getNullable(JsonReader::getFloat); - } else if ("displayName".equals(fieldName)) { - deserializedDisk.displayName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDisk; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DistributionByOperatingSystem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DistributionByOperatingSystem.java new file mode 100644 index 000000000000..bbfe4024ebad --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DistributionByOperatingSystem.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 distribution by operating system. + */ +@Immutable +public final class DistributionByOperatingSystem implements JsonSerializable { + /* + * The Os classification type. + */ + private String osClassificationType; + + /* + * The number of machines with the OS type classification. + */ + private Integer count; + + /** + * Creates an instance of DistributionByOperatingSystem class. + */ + public DistributionByOperatingSystem() { + } + + /** + * Get the osClassificationType property: The Os classification type. + * + * @return the osClassificationType value. + */ + public String osClassificationType() { + return this.osClassificationType; + } + + /** + * Get the count property: The number of machines with the OS type classification. + * + * @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 DistributionByOperatingSystem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DistributionByOperatingSystem 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 DistributionByOperatingSystem. + */ + public static DistributionByOperatingSystem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DistributionByOperatingSystem deserializedDistributionByOperatingSystem + = new DistributionByOperatingSystem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("osClassificationType".equals(fieldName)) { + deserializedDistributionByOperatingSystem.osClassificationType = reader.getString(); + } else if ("count".equals(fieldName)) { + deserializedDistributionByOperatingSystem.count = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDistributionByOperatingSystem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DistributionByType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DistributionByType.java new file mode 100644 index 000000000000..502c7ea35ebb --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DistributionByType.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Distribution by Type. + */ +@Immutable +public final class DistributionByType implements JsonSerializable { + /* + * Distribution Type. + */ + private String type; + + /* + * Distribution Count. + */ + private Integer count; + + /** + * Creates an instance of DistributionByType class. + */ + public DistributionByType() { + } + + /** + * Get the type property: Distribution Type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the count property: Distribution Count. + * + * @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 DistributionByType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DistributionByType 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 DistributionByType. + */ + public static DistributionByType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DistributionByType deserializedDistributionByType = new DistributionByType(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedDistributionByType.type = reader.getString(); + } else if ("count".equals(fieldName)) { + deserializedDistributionByType.count = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDistributionByType; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DistributionByVirtualization.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DistributionByVirtualization.java new file mode 100644 index 000000000000..26d7397c63b3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/DistributionByVirtualization.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 distribution by virtualization. + */ +@Immutable +public final class DistributionByVirtualization implements JsonSerializable { + /* + * The Virtualization type. + */ + private String virtualizationType; + + /* + * The number of machines with the Virtualization type classification. + */ + private Integer count; + + /** + * Creates an instance of DistributionByVirtualization class. + */ + public DistributionByVirtualization() { + } + + /** + * Get the virtualizationType property: The Virtualization type. + * + * @return the virtualizationType value. + */ + public String virtualizationType() { + return this.virtualizationType; + } + + /** + * Get the count property: The number of machines with the Virtualization type classification. + * + * @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 DistributionByVirtualization from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DistributionByVirtualization 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 DistributionByVirtualization. + */ + public static DistributionByVirtualization fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DistributionByVirtualization deserializedDistributionByVirtualization = new DistributionByVirtualization(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualizationType".equals(fieldName)) { + deserializedDistributionByVirtualization.virtualizationType = reader.getString(); + } else if ("count".equals(fieldName)) { + deserializedDistributionByVirtualization.count = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDistributionByVirtualization; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EnvironmentType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EnvironmentType.java index 32c644f524d9..81cddc53a20b 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EnvironmentType.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EnvironmentType.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for EnvironmentType. + * Environment Type. */ public final class EnvironmentType extends ExpandableStringEnum { /** @@ -17,9 +17,14 @@ public final class EnvironmentType extends ExpandableStringEnum public static final EnvironmentType PRODUCTION = fromString("Production"); /** - * Static value Test for EnvironmentType. + * Static value Unknown for EnvironmentType. */ - public static final EnvironmentType TEST = fromString("Test"); + public static final EnvironmentType UNKNOWN = fromString("Unknown"); + + /** + * Static value DevTest for EnvironmentType. + */ + public static final EnvironmentType DEV_TEST = fromString("DevTest"); /** * Creates a new instance of EnvironmentType value. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Error.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Error.java index 7525130526ea..ec02f742dc0b 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Error.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Error.java @@ -12,7 +12,7 @@ import com.azure.json.JsonWriter; import java.io.IOException; import java.time.OffsetDateTime; -import java.util.Map; +import java.util.List; /** * Error web model class. @@ -72,7 +72,7 @@ public final class Error implements JsonSerializable { /* * Gets the error message parameters. */ - private Map messageParameters; + private List messageParameters; /* * Gets the time stamp when the error was updated. @@ -185,7 +185,7 @@ public String severity() { * * @return the messageParameters value. */ - public Map messageParameters() { + public List messageParameters() { return this.messageParameters; } @@ -213,6 +213,9 @@ public String impactedAssessmentType() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (messageParameters() != null) { + messageParameters().forEach(e -> e.validate()); + } } /** @@ -260,7 +263,8 @@ public static Error fromJson(JsonReader jsonReader) throws IOException { } else if ("severity".equals(fieldName)) { deserializedError.severity = reader.getString(); } else if ("messageParameters".equals(fieldName)) { - Map messageParameters = reader.readMap(reader1 -> reader1.getString()); + List messageParameters + = reader.readArray(reader1 -> ErrorMessageParametersItem.fromJson(reader1)); deserializedError.messageParameters = messageParameters; } else if ("updatedTimeStamp".equals(fieldName)) { deserializedError.updatedTimestamp = reader diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ErrorDetailAutoGenerated.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ErrorDetailAutoGenerated.java new file mode 100644 index 000000000000..7ea45643caf7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ErrorDetailAutoGenerated.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Error Details. + */ +@Immutable +public final class ErrorDetailAutoGenerated implements JsonSerializable { + /* + * Error Code + */ + private String code; + + /* + * Description of the error occurred + */ + private String message; + + /** + * Creates an instance of ErrorDetailAutoGenerated class. + */ + public ErrorDetailAutoGenerated() { + } + + /** + * Get the code property: Error Code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: Description of the error occurred. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorDetailAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorDetailAutoGenerated 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 ErrorDetailAutoGenerated. + */ + public static ErrorDetailAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorDetailAutoGenerated deserializedErrorDetailAutoGenerated = new ErrorDetailAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedErrorDetailAutoGenerated.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedErrorDetailAutoGenerated.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedErrorDetailAutoGenerated; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ErrorMessageParametersItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ErrorMessageParametersItem.java new file mode 100644 index 000000000000..c7a8b8b9d877 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ErrorMessageParametersItem.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 ErrorMessageParametersItem implements JsonSerializable { + /* + * The name. + */ + private String name; + + /* + * The value. + */ + private String value; + + /** + * Creates an instance of ErrorMessageParametersItem class. + */ + public ErrorMessageParametersItem() { + } + + /** + * 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 ErrorMessageParametersItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorMessageParametersItem 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 ErrorMessageParametersItem. + */ + public static ErrorMessageParametersItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorMessageParametersItem deserializedErrorMessageParametersItem = new ErrorMessageParametersItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedErrorMessageParametersItem.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedErrorMessageParametersItem.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedErrorMessageParametersItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ErrorSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ErrorSummary.java index 42260482d270..cc011ba27ed7 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ErrorSummary.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ErrorSummary.java @@ -19,7 +19,7 @@ public final class ErrorSummary implements JsonSerializable { /* * Gets the assessment type. */ - private AssessmentType assessmentType; + private String assessmentType; /* * Gets the affected entity count. @@ -37,7 +37,7 @@ public ErrorSummary() { * * @return the assessmentType value. */ - public AssessmentType assessmentType() { + public String assessmentType() { return this.assessmentType; } @@ -83,7 +83,7 @@ public static ErrorSummary fromJson(JsonReader jsonReader) throws IOException { reader.nextToken(); if ("assessmentType".equals(fieldName)) { - deserializedErrorSummary.assessmentType = AssessmentType.fromString(reader.getString()); + deserializedErrorSummary.assessmentType = reader.getString(); } else if ("count".equals(fieldName)) { deserializedErrorSummary.count = reader.getNullable(JsonReader::getInt); } else { diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EstimatedCostByOffer.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EstimatedCostByOffer.java new file mode 100644 index 000000000000..4b4a4cd4da97 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EstimatedCostByOffer.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 estimated cost by offer. + */ +@Immutable +public final class EstimatedCostByOffer implements JsonSerializable { + /* + * The offer name. + */ + private String offerName; + + /* + * Cost for the offer. + */ + private Float cost; + + /** + * Creates an instance of EstimatedCostByOffer class. + */ + public EstimatedCostByOffer() { + } + + /** + * Get the offerName property: The offer name. + * + * @return the offerName value. + */ + public String offerName() { + return this.offerName; + } + + /** + * Get the cost property: Cost for the offer. + * + * @return the cost value. + */ + public Float cost() { + return this.cost; + } + + /** + * 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 EstimatedCostByOffer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EstimatedCostByOffer 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 EstimatedCostByOffer. + */ + public static EstimatedCostByOffer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EstimatedCostByOffer deserializedEstimatedCostByOffer = new EstimatedCostByOffer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("offerName".equals(fieldName)) { + deserializedEstimatedCostByOffer.offerName = reader.getString(); + } else if ("cost".equals(fieldName)) { + deserializedEstimatedCostByOffer.cost = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedEstimatedCostByOffer; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EstimatedCostByTarget.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EstimatedCostByTarget.java new file mode 100644 index 000000000000..1b3d462455a2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EstimatedCostByTarget.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Shows the estimated cost by target. + */ +@Immutable +public final class EstimatedCostByTarget implements JsonSerializable { + /* + * Azure SQL MI cost. + */ + private Float azureSqlMiCost; + + /* + * Azure SQL DB cost. + */ + private Float azureSqlDbCost; + + /* + * Azure App Service cost. + */ + private Float appServiceCost; + + /* + * Azure App Service Containers cost. + */ + private Float appServiceContainerCost; + + /* + * Azure Kubernetes Service cost. + */ + private Float azureKubernetesServiceCost; + + /** + * Creates an instance of EstimatedCostByTarget class. + */ + public EstimatedCostByTarget() { + } + + /** + * Get the azureSqlMiCost property: Azure SQL MI cost. + * + * @return the azureSqlMiCost value. + */ + public Float azureSqlMiCost() { + return this.azureSqlMiCost; + } + + /** + * Get the azureSqlDbCost property: Azure SQL DB cost. + * + * @return the azureSqlDbCost value. + */ + public Float azureSqlDbCost() { + return this.azureSqlDbCost; + } + + /** + * Get the appServiceCost property: Azure App Service cost. + * + * @return the appServiceCost value. + */ + public Float appServiceCost() { + return this.appServiceCost; + } + + /** + * Get the appServiceContainerCost property: Azure App Service Containers cost. + * + * @return the appServiceContainerCost value. + */ + public Float appServiceContainerCost() { + return this.appServiceContainerCost; + } + + /** + * Get the azureKubernetesServiceCost property: Azure Kubernetes Service cost. + * + * @return the azureKubernetesServiceCost value. + */ + public Float azureKubernetesServiceCost() { + return this.azureKubernetesServiceCost; + } + + /** + * 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 EstimatedCostByTarget from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EstimatedCostByTarget 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 EstimatedCostByTarget. + */ + public static EstimatedCostByTarget fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EstimatedCostByTarget deserializedEstimatedCostByTarget = new EstimatedCostByTarget(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureSqlMiCost".equals(fieldName)) { + deserializedEstimatedCostByTarget.azureSqlMiCost = reader.getNullable(JsonReader::getFloat); + } else if ("azureSqlDbCost".equals(fieldName)) { + deserializedEstimatedCostByTarget.azureSqlDbCost = reader.getNullable(JsonReader::getFloat); + } else if ("appServiceCost".equals(fieldName)) { + deserializedEstimatedCostByTarget.appServiceCost = reader.getNullable(JsonReader::getFloat); + } else if ("appServiceContainerCost".equals(fieldName)) { + deserializedEstimatedCostByTarget.appServiceContainerCost + = reader.getNullable(JsonReader::getFloat); + } else if ("azureKubernetesServiceCost".equals(fieldName)) { + deserializedEstimatedCostByTarget.azureKubernetesServiceCost + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedEstimatedCostByTarget; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EstimatedExternalStorage.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EstimatedExternalStorage.java new file mode 100644 index 000000000000..4e4c77a7cc8c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EstimatedExternalStorage.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Estimated external storage. + */ +@Immutable +public final class EstimatedExternalStorage implements JsonSerializable { + /* + * External storage type + */ + private ExternalStorageType storageType; + + /* + * Total storage allocation in GB + */ + private Float totalStorageInGB; + + /* + * Percent storage utilization + */ + private Float storageUtilization; + + /* + * Total storage cost + */ + private Float totalStorageCost; + + /** + * Creates an instance of EstimatedExternalStorage class. + */ + public EstimatedExternalStorage() { + } + + /** + * Get the storageType property: External storage type. + * + * @return the storageType value. + */ + public ExternalStorageType storageType() { + return this.storageType; + } + + /** + * Get the totalStorageInGB property: Total storage allocation in GB. + * + * @return the totalStorageInGB value. + */ + public Float totalStorageInGB() { + return this.totalStorageInGB; + } + + /** + * Get the storageUtilization property: Percent storage utilization. + * + * @return the storageUtilization value. + */ + public Float storageUtilization() { + return this.storageUtilization; + } + + /** + * Get the totalStorageCost property: Total storage cost. + * + * @return the totalStorageCost value. + */ + public Float totalStorageCost() { + return this.totalStorageCost; + } + + /** + * 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 EstimatedExternalStorage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EstimatedExternalStorage 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 EstimatedExternalStorage. + */ + public static EstimatedExternalStorage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EstimatedExternalStorage deserializedEstimatedExternalStorage = new EstimatedExternalStorage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageType".equals(fieldName)) { + deserializedEstimatedExternalStorage.storageType + = ExternalStorageType.fromString(reader.getString()); + } else if ("totalStorageInGB".equals(fieldName)) { + deserializedEstimatedExternalStorage.totalStorageInGB = reader.getNullable(JsonReader::getFloat); + } else if ("storageUtilization".equals(fieldName)) { + deserializedEstimatedExternalStorage.storageUtilization = reader.getNullable(JsonReader::getFloat); + } else if ("totalStorageCost".equals(fieldName)) { + deserializedEstimatedExternalStorage.totalStorageCost = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedEstimatedExternalStorage; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EstimatedNetwork.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EstimatedNetwork.java new file mode 100644 index 000000000000..94f20dbca40e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EstimatedNetwork.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Estimated network. + */ +@Immutable +public final class EstimatedNetwork implements JsonSerializable { + /* + * Network SKU type. + */ + private NetworkSkuType skuType; + + /* + * Network Sku type cost. + */ + private Float cost; + + /** + * Creates an instance of EstimatedNetwork class. + */ + public EstimatedNetwork() { + } + + /** + * Get the skuType property: Network SKU type. + * + * @return the skuType value. + */ + public NetworkSkuType skuType() { + return this.skuType; + } + + /** + * Get the cost property: Network Sku type cost. + * + * @return the cost value. + */ + public Float cost() { + return this.cost; + } + + /** + * 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 EstimatedNetwork from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EstimatedNetwork 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 EstimatedNetwork. + */ + public static EstimatedNetwork fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EstimatedNetwork deserializedEstimatedNetwork = new EstimatedNetwork(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("skuType".equals(fieldName)) { + deserializedEstimatedNetwork.skuType = NetworkSkuType.fromString(reader.getString()); + } else if ("cost".equals(fieldName)) { + deserializedEstimatedNetwork.cost = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedEstimatedNetwork; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedAvsMachine.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedAvsMachine.java new file mode 100644 index 000000000000..630a34d869dd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedAvsMachine.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedAvsMachineInner; + +/** + * An immutable client-side representation of EvaluatedAvsMachine. + */ +public interface EvaluatedAvsMachine { + /** + * 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. + */ + EvaluatedAvsMachineProperties 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.migration.assessment.fluent.models.EvaluatedAvsMachineInner object. + * + * @return the inner object. + */ + EvaluatedAvsMachineInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedAvsMachineListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedAvsMachineListResult.java new file mode 100644 index 000000000000..84d3696f279e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedAvsMachineListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.EvaluatedAvsMachineInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EvaluatedAvsMachine list operation. + */ +@Fluent +public final class EvaluatedAvsMachineListResult implements JsonSerializable { + /* + * The EvaluatedAvsMachine items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EvaluatedAvsMachineListResult class. + */ + public EvaluatedAvsMachineListResult() { + } + + /** + * Get the value property: The EvaluatedAvsMachine items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EvaluatedAvsMachine items on this page. + * + * @param value the value value to set. + * @return the EvaluatedAvsMachineListResult object itself. + */ + public EvaluatedAvsMachineListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EvaluatedAvsMachineListResult object itself. + */ + public EvaluatedAvsMachineListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 EvaluatedAvsMachineListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EvaluatedAvsMachineListResult.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 EvaluatedAvsMachineListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatedAvsMachineListResult 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 EvaluatedAvsMachineListResult. + */ + public static EvaluatedAvsMachineListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EvaluatedAvsMachineListResult deserializedEvaluatedAvsMachineListResult + = new EvaluatedAvsMachineListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EvaluatedAvsMachineInner.fromJson(reader1)); + deserializedEvaluatedAvsMachineListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEvaluatedAvsMachineListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEvaluatedAvsMachineListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedAvsMachineProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedAvsMachineProperties.java new file mode 100644 index 000000000000..e2ac99568a21 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedAvsMachineProperties.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Evaluated AVS machine properties class. + */ +@Immutable +public final class EvaluatedAvsMachineProperties implements JsonSerializable { + /* + * Machine Id. + */ + private String machineId; + + /* + * Server Name. + */ + private String serverName; + + /* + * Virtualization type. + */ + private String virtualizationType; + + /* + * Activity state. + */ + private String activityState; + + /* + * Operating System (OS) name. + */ + private String operatingSystemName; + + /* + * Recommended Azure target. + */ + private String recommendedAzureTarget; + + /* + * Qualifying offer. + */ + private String qualifyingOffer; + + /* + * Is machine ready for migration. + */ + private String readyForMigration; + + /* + * End of Support status. + */ + private SupportabilityStatus supportStatus; + + /** + * Creates an instance of EvaluatedAvsMachineProperties class. + */ + public EvaluatedAvsMachineProperties() { + } + + /** + * Get the machineId property: Machine Id. + * + * @return the machineId value. + */ + public String machineId() { + return this.machineId; + } + + /** + * Get the serverName property: Server Name. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Get the virtualizationType property: Virtualization type. + * + * @return the virtualizationType value. + */ + public String virtualizationType() { + return this.virtualizationType; + } + + /** + * Get the activityState property: Activity state. + * + * @return the activityState value. + */ + public String activityState() { + return this.activityState; + } + + /** + * Get the operatingSystemName property: Operating System (OS) name. + * + * @return the operatingSystemName value. + */ + public String operatingSystemName() { + return this.operatingSystemName; + } + + /** + * Get the recommendedAzureTarget property: Recommended Azure target. + * + * @return the recommendedAzureTarget value. + */ + public String recommendedAzureTarget() { + return this.recommendedAzureTarget; + } + + /** + * Get the qualifyingOffer property: Qualifying offer. + * + * @return the qualifyingOffer value. + */ + public String qualifyingOffer() { + return this.qualifyingOffer; + } + + /** + * Get the readyForMigration property: Is machine ready for migration. + * + * @return the readyForMigration value. + */ + public String readyForMigration() { + return this.readyForMigration; + } + + /** + * Get the supportStatus property: End of Support status. + * + * @return the supportStatus value. + */ + public SupportabilityStatus supportStatus() { + return this.supportStatus; + } + + /** + * 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 EvaluatedAvsMachineProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatedAvsMachineProperties 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 EvaluatedAvsMachineProperties. + */ + public static EvaluatedAvsMachineProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EvaluatedAvsMachineProperties deserializedEvaluatedAvsMachineProperties + = new EvaluatedAvsMachineProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("machineId".equals(fieldName)) { + deserializedEvaluatedAvsMachineProperties.machineId = reader.getString(); + } else if ("serverName".equals(fieldName)) { + deserializedEvaluatedAvsMachineProperties.serverName = reader.getString(); + } else if ("virtualizationType".equals(fieldName)) { + deserializedEvaluatedAvsMachineProperties.virtualizationType = reader.getString(); + } else if ("activityState".equals(fieldName)) { + deserializedEvaluatedAvsMachineProperties.activityState = reader.getString(); + } else if ("operatingSystemName".equals(fieldName)) { + deserializedEvaluatedAvsMachineProperties.operatingSystemName = reader.getString(); + } else if ("recommendedAzureTarget".equals(fieldName)) { + deserializedEvaluatedAvsMachineProperties.recommendedAzureTarget = reader.getString(); + } else if ("qualifyingOffer".equals(fieldName)) { + deserializedEvaluatedAvsMachineProperties.qualifyingOffer = reader.getString(); + } else if ("readyForMigration".equals(fieldName)) { + deserializedEvaluatedAvsMachineProperties.readyForMigration = reader.getString(); + } else if ("supportStatus".equals(fieldName)) { + deserializedEvaluatedAvsMachineProperties.supportStatus + = SupportabilityStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEvaluatedAvsMachineProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedAvsMachinesOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedAvsMachinesOperations.java new file mode 100644 index 000000000000..8506c83bca85 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedAvsMachinesOperations.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 EvaluatedAvsMachinesOperations. + */ +public interface EvaluatedAvsMachinesOperations { + /** + * List EvaluatedAvsMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedAvsMachine list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName); + + /** + * List EvaluatedAvsMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedAvsMachine list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context); + + /** + * Get a EvaluatedAvsMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedAvsMachineName Business case Evaluated AVS 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 EvaluatedAvsMachine along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedAvsMachineName, Context context); + + /** + * Get a EvaluatedAvsMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedAvsMachineName Business case Evaluated AVS 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 EvaluatedAvsMachine. + */ + EvaluatedAvsMachine get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedAvsMachineName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedMachine.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedMachine.java new file mode 100644 index 000000000000..6965eb1931ae --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedMachine.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedMachineInner; + +/** + * An immutable client-side representation of EvaluatedMachine. + */ +public interface EvaluatedMachine { + /** + * 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. + */ + EvaluatedMachineProperties 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.migration.assessment.fluent.models.EvaluatedMachineInner object. + * + * @return the inner object. + */ + EvaluatedMachineInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedMachineListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedMachineListResult.java new file mode 100644 index 000000000000..b797310935f2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedMachineListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.EvaluatedMachineInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EvaluatedMachine list operation. + */ +@Fluent +public final class EvaluatedMachineListResult implements JsonSerializable { + /* + * The EvaluatedMachine items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EvaluatedMachineListResult class. + */ + public EvaluatedMachineListResult() { + } + + /** + * Get the value property: The EvaluatedMachine items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EvaluatedMachine items on this page. + * + * @param value the value value to set. + * @return the EvaluatedMachineListResult object itself. + */ + public EvaluatedMachineListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EvaluatedMachineListResult object itself. + */ + public EvaluatedMachineListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 EvaluatedMachineListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EvaluatedMachineListResult.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 EvaluatedMachineListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatedMachineListResult 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 EvaluatedMachineListResult. + */ + public static EvaluatedMachineListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EvaluatedMachineListResult deserializedEvaluatedMachineListResult = new EvaluatedMachineListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EvaluatedMachineInner.fromJson(reader1)); + deserializedEvaluatedMachineListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEvaluatedMachineListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEvaluatedMachineListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedMachineProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedMachineProperties.java new file mode 100644 index 000000000000..7bc633f3202a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedMachineProperties.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Evaluated machine properties class. + */ +@Immutable +public final class EvaluatedMachineProperties implements JsonSerializable { + /* + * Machine Id. + */ + private String machineId; + + /* + * Server Name. + */ + private String serverName; + + /* + * Virtualization type. + */ + private String virtualizationType; + + /* + * Activity state. + */ + private String activityState; + + /* + * Operating System (OS) name. + */ + private String operatingSystemName; + + /* + * Recommended Azure target. + */ + private String recommendedAzureTarget; + + /* + * Qualifying offer. + */ + private String qualifyingOffer; + + /* + * Is machine ready for migration. + */ + private String readyForMigration; + + /* + * End of Support status. + */ + private SupportabilityStatus supportStatus; + + /** + * Creates an instance of EvaluatedMachineProperties class. + */ + public EvaluatedMachineProperties() { + } + + /** + * Get the machineId property: Machine Id. + * + * @return the machineId value. + */ + public String machineId() { + return this.machineId; + } + + /** + * Get the serverName property: Server Name. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Get the virtualizationType property: Virtualization type. + * + * @return the virtualizationType value. + */ + public String virtualizationType() { + return this.virtualizationType; + } + + /** + * Get the activityState property: Activity state. + * + * @return the activityState value. + */ + public String activityState() { + return this.activityState; + } + + /** + * Get the operatingSystemName property: Operating System (OS) name. + * + * @return the operatingSystemName value. + */ + public String operatingSystemName() { + return this.operatingSystemName; + } + + /** + * Get the recommendedAzureTarget property: Recommended Azure target. + * + * @return the recommendedAzureTarget value. + */ + public String recommendedAzureTarget() { + return this.recommendedAzureTarget; + } + + /** + * Get the qualifyingOffer property: Qualifying offer. + * + * @return the qualifyingOffer value. + */ + public String qualifyingOffer() { + return this.qualifyingOffer; + } + + /** + * Get the readyForMigration property: Is machine ready for migration. + * + * @return the readyForMigration value. + */ + public String readyForMigration() { + return this.readyForMigration; + } + + /** + * Get the supportStatus property: End of Support status. + * + * @return the supportStatus value. + */ + public SupportabilityStatus supportStatus() { + return this.supportStatus; + } + + /** + * 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 EvaluatedMachineProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatedMachineProperties 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 EvaluatedMachineProperties. + */ + public static EvaluatedMachineProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EvaluatedMachineProperties deserializedEvaluatedMachineProperties = new EvaluatedMachineProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("machineId".equals(fieldName)) { + deserializedEvaluatedMachineProperties.machineId = reader.getString(); + } else if ("serverName".equals(fieldName)) { + deserializedEvaluatedMachineProperties.serverName = reader.getString(); + } else if ("virtualizationType".equals(fieldName)) { + deserializedEvaluatedMachineProperties.virtualizationType = reader.getString(); + } else if ("activityState".equals(fieldName)) { + deserializedEvaluatedMachineProperties.activityState = reader.getString(); + } else if ("operatingSystemName".equals(fieldName)) { + deserializedEvaluatedMachineProperties.operatingSystemName = reader.getString(); + } else if ("recommendedAzureTarget".equals(fieldName)) { + deserializedEvaluatedMachineProperties.recommendedAzureTarget = reader.getString(); + } else if ("qualifyingOffer".equals(fieldName)) { + deserializedEvaluatedMachineProperties.qualifyingOffer = reader.getString(); + } else if ("readyForMigration".equals(fieldName)) { + deserializedEvaluatedMachineProperties.readyForMigration = reader.getString(); + } else if ("supportStatus".equals(fieldName)) { + deserializedEvaluatedMachineProperties.supportStatus + = SupportabilityStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEvaluatedMachineProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedMachinesOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedMachinesOperations.java new file mode 100644 index 000000000000..eb1d5a1d6a41 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedMachinesOperations.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 EvaluatedMachinesOperations. + */ +public interface EvaluatedMachinesOperations { + /** + * List EvaluatedMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedMachine list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName); + + /** + * List EvaluatedMachine resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedMachine list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName, + String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, Context context); + + /** + * Get a EvaluatedMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedMachineName Business case Evaluated 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 EvaluatedMachine along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedMachineName, Context context); + + /** + * Get a EvaluatedMachine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedMachineName Business case Evaluated 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 EvaluatedMachine. + */ + EvaluatedMachine get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedMachineName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedSqlEntitiesOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedSqlEntitiesOperations.java new file mode 100644 index 000000000000..b1be8381707a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedSqlEntitiesOperations.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 EvaluatedSqlEntitiesOperations. + */ +public interface EvaluatedSqlEntitiesOperations { + /** + * List EvaluatedSqlEntity resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedSqlEntity list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName); + + /** + * List EvaluatedSqlEntity resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedSqlEntity list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String businessCaseName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context); + + /** + * Get a EvaluatedSqlEntity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedSqlEntityName Business case Evaluated sql entity 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 EvaluatedSqlEntity along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedSqlEntityName, Context context); + + /** + * Get a EvaluatedSqlEntity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedSqlEntityName Business case Evaluated sql entity 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 EvaluatedSqlEntity. + */ + EvaluatedSqlEntity get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedSqlEntityName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedSqlEntity.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedSqlEntity.java new file mode 100644 index 000000000000..96eee9e2a848 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedSqlEntity.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedSqlEntityInner; + +/** + * An immutable client-side representation of EvaluatedSqlEntity. + */ +public interface EvaluatedSqlEntity { + /** + * 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. + */ + EvaluatedSqlEntityProperties 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.migration.assessment.fluent.models.EvaluatedSqlEntityInner object. + * + * @return the inner object. + */ + EvaluatedSqlEntityInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedSqlEntityListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedSqlEntityListResult.java new file mode 100644 index 000000000000..93d27b273e97 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedSqlEntityListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.EvaluatedSqlEntityInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EvaluatedSqlEntity list operation. + */ +@Fluent +public final class EvaluatedSqlEntityListResult implements JsonSerializable { + /* + * The EvaluatedSqlEntity items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EvaluatedSqlEntityListResult class. + */ + public EvaluatedSqlEntityListResult() { + } + + /** + * Get the value property: The EvaluatedSqlEntity items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EvaluatedSqlEntity items on this page. + * + * @param value the value value to set. + * @return the EvaluatedSqlEntityListResult object itself. + */ + public EvaluatedSqlEntityListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EvaluatedSqlEntityListResult object itself. + */ + public EvaluatedSqlEntityListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 EvaluatedSqlEntityListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EvaluatedSqlEntityListResult.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 EvaluatedSqlEntityListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatedSqlEntityListResult 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 EvaluatedSqlEntityListResult. + */ + public static EvaluatedSqlEntityListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EvaluatedSqlEntityListResult deserializedEvaluatedSqlEntityListResult = new EvaluatedSqlEntityListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EvaluatedSqlEntityInner.fromJson(reader1)); + deserializedEvaluatedSqlEntityListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEvaluatedSqlEntityListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEvaluatedSqlEntityListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedSqlEntityProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedSqlEntityProperties.java new file mode 100644 index 000000000000..621d390cbeae --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedSqlEntityProperties.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Evaluated sql entity properties class. + */ +@Immutable +public final class EvaluatedSqlEntityProperties implements JsonSerializable { + /* + * Server name. + */ + private String serverName; + + /* + * Activity state. + */ + private String activityState; + + /* + * SQL Server version. + */ + private String sqlVersion; + + /* + * SQL Server edition. + */ + private String sqlEdition; + + /* + * Recommended Azure target. + */ + private String recommendedAzureTarget; + + /* + * Qualifying offer. + */ + private String qualifyingOffer; + + /* + * Is SQL Instance ready for migration. + */ + private String readyForMigration; + + /* + * The virtualization type. + */ + private String virtualizationType; + + /* + * DB count in instance. + */ + private Integer dbCount; + + /* + * End of Support status. + */ + private SupportabilityStatus supportStatus; + + /** + * Creates an instance of EvaluatedSqlEntityProperties class. + */ + public EvaluatedSqlEntityProperties() { + } + + /** + * Get the serverName property: Server name. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Get the activityState property: Activity state. + * + * @return the activityState value. + */ + public String activityState() { + return this.activityState; + } + + /** + * Get the sqlVersion property: SQL Server version. + * + * @return the sqlVersion value. + */ + public String sqlVersion() { + return this.sqlVersion; + } + + /** + * Get the sqlEdition property: SQL Server edition. + * + * @return the sqlEdition value. + */ + public String sqlEdition() { + return this.sqlEdition; + } + + /** + * Get the recommendedAzureTarget property: Recommended Azure target. + * + * @return the recommendedAzureTarget value. + */ + public String recommendedAzureTarget() { + return this.recommendedAzureTarget; + } + + /** + * Get the qualifyingOffer property: Qualifying offer. + * + * @return the qualifyingOffer value. + */ + public String qualifyingOffer() { + return this.qualifyingOffer; + } + + /** + * Get the readyForMigration property: Is SQL Instance ready for migration. + * + * @return the readyForMigration value. + */ + public String readyForMigration() { + return this.readyForMigration; + } + + /** + * Get the virtualizationType property: The virtualization type. + * + * @return the virtualizationType value. + */ + public String virtualizationType() { + return this.virtualizationType; + } + + /** + * Get the dbCount property: DB count in instance. + * + * @return the dbCount value. + */ + public Integer dbCount() { + return this.dbCount; + } + + /** + * Get the supportStatus property: End of Support status. + * + * @return the supportStatus value. + */ + public SupportabilityStatus supportStatus() { + return this.supportStatus; + } + + /** + * 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 EvaluatedSqlEntityProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatedSqlEntityProperties 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 EvaluatedSqlEntityProperties. + */ + public static EvaluatedSqlEntityProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EvaluatedSqlEntityProperties deserializedEvaluatedSqlEntityProperties = new EvaluatedSqlEntityProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serverName".equals(fieldName)) { + deserializedEvaluatedSqlEntityProperties.serverName = reader.getString(); + } else if ("activityState".equals(fieldName)) { + deserializedEvaluatedSqlEntityProperties.activityState = reader.getString(); + } else if ("sqlVersion".equals(fieldName)) { + deserializedEvaluatedSqlEntityProperties.sqlVersion = reader.getString(); + } else if ("sqlEdition".equals(fieldName)) { + deserializedEvaluatedSqlEntityProperties.sqlEdition = reader.getString(); + } else if ("recommendedAzureTarget".equals(fieldName)) { + deserializedEvaluatedSqlEntityProperties.recommendedAzureTarget = reader.getString(); + } else if ("qualifyingOffer".equals(fieldName)) { + deserializedEvaluatedSqlEntityProperties.qualifyingOffer = reader.getString(); + } else if ("readyForMigration".equals(fieldName)) { + deserializedEvaluatedSqlEntityProperties.readyForMigration = reader.getString(); + } else if ("virtualizationType".equals(fieldName)) { + deserializedEvaluatedSqlEntityProperties.virtualizationType = reader.getString(); + } else if ("dbCount".equals(fieldName)) { + deserializedEvaluatedSqlEntityProperties.dbCount = reader.getNullable(JsonReader::getInt); + } else if ("supportStatus".equals(fieldName)) { + deserializedEvaluatedSqlEntityProperties.supportStatus + = SupportabilityStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEvaluatedSqlEntityProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedWebApp.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedWebApp.java new file mode 100644 index 000000000000..e49057a4a2d2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedWebApp.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.EvaluatedWebAppInner; + +/** + * An immutable client-side representation of EvaluatedWebApp. + */ +public interface EvaluatedWebApp { + /** + * 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. + */ + EvaluatedWebAppProperties 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.migration.assessment.fluent.models.EvaluatedWebAppInner object. + * + * @return the inner object. + */ + EvaluatedWebAppInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedWebAppListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedWebAppListResult.java new file mode 100644 index 000000000000..730a54797052 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedWebAppListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.EvaluatedWebAppInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EvaluatedWebApp list operation. + */ +@Fluent +public final class EvaluatedWebAppListResult implements JsonSerializable { + /* + * The EvaluatedWebApp items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EvaluatedWebAppListResult class. + */ + public EvaluatedWebAppListResult() { + } + + /** + * Get the value property: The EvaluatedWebApp items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EvaluatedWebApp items on this page. + * + * @param value the value value to set. + * @return the EvaluatedWebAppListResult object itself. + */ + public EvaluatedWebAppListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EvaluatedWebAppListResult object itself. + */ + public EvaluatedWebAppListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 EvaluatedWebAppListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EvaluatedWebAppListResult.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 EvaluatedWebAppListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatedWebAppListResult 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 EvaluatedWebAppListResult. + */ + public static EvaluatedWebAppListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EvaluatedWebAppListResult deserializedEvaluatedWebAppListResult = new EvaluatedWebAppListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EvaluatedWebAppInner.fromJson(reader1)); + deserializedEvaluatedWebAppListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEvaluatedWebAppListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEvaluatedWebAppListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedWebAppProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedWebAppProperties.java new file mode 100644 index 000000000000..8c9344f9f7ce --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedWebAppProperties.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Evaluated web app properties class. + */ +@Fluent +public final class EvaluatedWebAppProperties implements JsonSerializable { + /* + * Recommended Azure target. + */ + private String recommendedAzureTarget; + + /* + * Recommended Azure SKU name. + */ + private String recommendedAzureSkuName; + + /* + * Recommended Azure SKU size. + */ + private String recommendedAzureSkuSize; + + /* + * The server name. + */ + private String serverName; + + /* + * The workload. + */ + private String workload; + + /* + * The activity state. + */ + private String activityState; + + /* + * Is machine ready for migration. + */ + private String readyForMigration; + + /** + * Creates an instance of EvaluatedWebAppProperties class. + */ + public EvaluatedWebAppProperties() { + } + + /** + * Get the recommendedAzureTarget property: Recommended Azure target. + * + * @return the recommendedAzureTarget value. + */ + public String recommendedAzureTarget() { + return this.recommendedAzureTarget; + } + + /** + * Set the recommendedAzureTarget property: Recommended Azure target. + * + * @param recommendedAzureTarget the recommendedAzureTarget value to set. + * @return the EvaluatedWebAppProperties object itself. + */ + public EvaluatedWebAppProperties withRecommendedAzureTarget(String recommendedAzureTarget) { + this.recommendedAzureTarget = recommendedAzureTarget; + return this; + } + + /** + * Get the recommendedAzureSkuName property: Recommended Azure SKU name. + * + * @return the recommendedAzureSkuName value. + */ + public String recommendedAzureSkuName() { + return this.recommendedAzureSkuName; + } + + /** + * Set the recommendedAzureSkuName property: Recommended Azure SKU name. + * + * @param recommendedAzureSkuName the recommendedAzureSkuName value to set. + * @return the EvaluatedWebAppProperties object itself. + */ + public EvaluatedWebAppProperties withRecommendedAzureSkuName(String recommendedAzureSkuName) { + this.recommendedAzureSkuName = recommendedAzureSkuName; + return this; + } + + /** + * Get the recommendedAzureSkuSize property: Recommended Azure SKU size. + * + * @return the recommendedAzureSkuSize value. + */ + public String recommendedAzureSkuSize() { + return this.recommendedAzureSkuSize; + } + + /** + * Set the recommendedAzureSkuSize property: Recommended Azure SKU size. + * + * @param recommendedAzureSkuSize the recommendedAzureSkuSize value to set. + * @return the EvaluatedWebAppProperties object itself. + */ + public EvaluatedWebAppProperties withRecommendedAzureSkuSize(String recommendedAzureSkuSize) { + this.recommendedAzureSkuSize = recommendedAzureSkuSize; + return this; + } + + /** + * Get the serverName property: The server name. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Set the serverName property: The server name. + * + * @param serverName the serverName value to set. + * @return the EvaluatedWebAppProperties object itself. + */ + public EvaluatedWebAppProperties withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get the workload property: The workload. + * + * @return the workload value. + */ + public String workload() { + return this.workload; + } + + /** + * Set the workload property: The workload. + * + * @param workload the workload value to set. + * @return the EvaluatedWebAppProperties object itself. + */ + public EvaluatedWebAppProperties withWorkload(String workload) { + this.workload = workload; + return this; + } + + /** + * Get the activityState property: The activity state. + * + * @return the activityState value. + */ + public String activityState() { + return this.activityState; + } + + /** + * Set the activityState property: The activity state. + * + * @param activityState the activityState value to set. + * @return the EvaluatedWebAppProperties object itself. + */ + public EvaluatedWebAppProperties withActivityState(String activityState) { + this.activityState = activityState; + return this; + } + + /** + * Get the readyForMigration property: Is machine ready for migration. + * + * @return the readyForMigration value. + */ + public String readyForMigration() { + return this.readyForMigration; + } + + /** + * Set the readyForMigration property: Is machine ready for migration. + * + * @param readyForMigration the readyForMigration value to set. + * @return the EvaluatedWebAppProperties object itself. + */ + public EvaluatedWebAppProperties withReadyForMigration(String readyForMigration) { + this.readyForMigration = readyForMigration; + 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("recommendedAzureTarget", this.recommendedAzureTarget); + jsonWriter.writeStringField("recommendedAzureSkuName", this.recommendedAzureSkuName); + jsonWriter.writeStringField("recommendedAzureSkuSize", this.recommendedAzureSkuSize); + jsonWriter.writeStringField("serverName", this.serverName); + jsonWriter.writeStringField("workload", this.workload); + jsonWriter.writeStringField("activityState", this.activityState); + jsonWriter.writeStringField("readyForMigration", this.readyForMigration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EvaluatedWebAppProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatedWebAppProperties 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 EvaluatedWebAppProperties. + */ + public static EvaluatedWebAppProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EvaluatedWebAppProperties deserializedEvaluatedWebAppProperties = new EvaluatedWebAppProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recommendedAzureTarget".equals(fieldName)) { + deserializedEvaluatedWebAppProperties.recommendedAzureTarget = reader.getString(); + } else if ("recommendedAzureSkuName".equals(fieldName)) { + deserializedEvaluatedWebAppProperties.recommendedAzureSkuName = reader.getString(); + } else if ("recommendedAzureSkuSize".equals(fieldName)) { + deserializedEvaluatedWebAppProperties.recommendedAzureSkuSize = reader.getString(); + } else if ("serverName".equals(fieldName)) { + deserializedEvaluatedWebAppProperties.serverName = reader.getString(); + } else if ("workload".equals(fieldName)) { + deserializedEvaluatedWebAppProperties.workload = reader.getString(); + } else if ("activityState".equals(fieldName)) { + deserializedEvaluatedWebAppProperties.activityState = reader.getString(); + } else if ("readyForMigration".equals(fieldName)) { + deserializedEvaluatedWebAppProperties.readyForMigration = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEvaluatedWebAppProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedWebAppsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedWebAppsOperations.java new file mode 100644 index 000000000000..a953dfa2389a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/EvaluatedWebAppsOperations.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 EvaluatedWebAppsOperations. + */ +public interface EvaluatedWebAppsOperations { + /** + * List EvaluatedWebApp resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedWebApp list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName); + + /** + * List EvaluatedWebApp resources by BusinessCase. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case 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 EvaluatedWebApp list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String businessCaseName, + String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, Context context); + + /** + * Get a EvaluatedWebApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedWebAppName Business case Evaluated web App 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 EvaluatedWebApp along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedWebAppName, Context context); + + /** + * Get a EvaluatedWebApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param businessCaseName Business case ARM name. + * @param evaluatedWebAppName Business case Evaluated web App 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 EvaluatedWebApp. + */ + EvaluatedWebApp get(String resourceGroupName, String projectName, String businessCaseName, + String evaluatedWebAppName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ExternalStorageType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ExternalStorageType.java new file mode 100644 index 000000000000..4f008aa59e67 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ExternalStorageType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Different External storage skus. + */ +public final class ExternalStorageType extends ExpandableStringEnum { + /** + * Static value Unknown for ExternalStorageType. + */ + public static final ExternalStorageType UNKNOWN = fromString("Unknown"); + + /** + * Static value None for ExternalStorageType. + */ + public static final ExternalStorageType NONE = fromString("None"); + + /** + * Static value AnfStandard for ExternalStorageType. + */ + public static final ExternalStorageType ANF_STANDARD = fromString("AnfStandard"); + + /** + * Static value AnfPremium for ExternalStorageType. + */ + public static final ExternalStorageType ANF_PREMIUM = fromString("AnfPremium"); + + /** + * Static value AnfUltra for ExternalStorageType. + */ + public static final ExternalStorageType ANF_ULTRA = fromString("AnfUltra"); + + /** + * Creates a new instance of ExternalStorageType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExternalStorageType() { + } + + /** + * Creates or finds a ExternalStorageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExternalStorageType. + */ + public static ExternalStorageType fromString(String name) { + return fromString(name, ExternalStorageType.class); + } + + /** + * Gets known ExternalStorageType values. + * + * @return known ExternalStorageType values. + */ + public static Collection values() { + return values(ExternalStorageType.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/FacilitySettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/FacilitySettings.java new file mode 100644 index 000000000000..f35784960d44 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/FacilitySettings.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Facility settings. + */ +@Fluent +public final class FacilitySettings implements JsonSerializable { + /* + * The facilities cost. + */ + private Float facilitiesCostPerKwh; + + /* + * Power utilization Efficiency. + */ + private float powerUtilizationEfficiency; + + /** + * Creates an instance of FacilitySettings class. + */ + public FacilitySettings() { + } + + /** + * Get the facilitiesCostPerKwh property: The facilities cost. + * + * @return the facilitiesCostPerKwh value. + */ + public Float facilitiesCostPerKwh() { + return this.facilitiesCostPerKwh; + } + + /** + * Set the facilitiesCostPerKwh property: The facilities cost. + * + * @param facilitiesCostPerKwh the facilitiesCostPerKwh value to set. + * @return the FacilitySettings object itself. + */ + public FacilitySettings withFacilitiesCostPerKwh(Float facilitiesCostPerKwh) { + this.facilitiesCostPerKwh = facilitiesCostPerKwh; + return this; + } + + /** + * Get the powerUtilizationEfficiency property: Power utilization Efficiency. + * + * @return the powerUtilizationEfficiency value. + */ + public float powerUtilizationEfficiency() { + return this.powerUtilizationEfficiency; + } + + /** + * Set the powerUtilizationEfficiency property: Power utilization Efficiency. + * + * @param powerUtilizationEfficiency the powerUtilizationEfficiency value to set. + * @return the FacilitySettings object itself. + */ + public FacilitySettings withPowerUtilizationEfficiency(float powerUtilizationEfficiency) { + this.powerUtilizationEfficiency = powerUtilizationEfficiency; + 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.writeFloatField("powerUtilizationEfficiency", this.powerUtilizationEfficiency); + jsonWriter.writeNumberField("facilitiesCostPerKwh", this.facilitiesCostPerKwh); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FacilitySettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FacilitySettings 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 FacilitySettings. + */ + public static FacilitySettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FacilitySettings deserializedFacilitySettings = new FacilitySettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("powerUtilizationEfficiency".equals(fieldName)) { + deserializedFacilitySettings.powerUtilizationEfficiency = reader.getFloat(); + } else if ("facilitiesCostPerKwh".equals(fieldName)) { + deserializedFacilitySettings.facilitiesCostPerKwh = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedFacilitySettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/FttAndRaidLevel.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/FttAndRaidLevel.java index 575fec6374ee..f09d914620b6 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/FttAndRaidLevel.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/FttAndRaidLevel.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for FttAndRaidLevel. + * FTT and RAID Level. */ public final class FttAndRaidLevel extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Group.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Group.java deleted file mode 100644 index 6f7581156ae1..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Group.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.migration.assessment.fluent.models.GroupInner; - -/** - * An immutable client-side representation of Group. - */ -public interface Group { - /** - * 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. - */ - GroupProperties 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.migration.assessment.fluent.models.GroupInner object. - * - * @return the inner object. - */ - GroupInner innerModel(); - - /** - * The entirety of the Group definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The Group definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Group definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the Group 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 Group 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. - */ - Group create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Group create(Context context); - } - - /** - * The stage of the Group 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(GroupProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Group refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Group refresh(Context context); - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @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 group resource. - */ - Group updateMachines(UpdateGroupBody body); - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @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 group resource. - */ - Group updateMachines(UpdateGroupBody body, Context context); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupBodyProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupBodyProperties.java deleted file mode 100644 index cf74a4db56b1..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupBodyProperties.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Body properties of group update. - */ -@Fluent -public final class GroupBodyProperties implements JsonSerializable { - /* - * Whether to add or remove the machines. - */ - private GroupUpdateOperation operationType; - - /* - * List of machine names that are part of this group. - */ - private List machines; - - /** - * Creates an instance of GroupBodyProperties class. - */ - public GroupBodyProperties() { - } - - /** - * Get the operationType property: Whether to add or remove the machines. - * - * @return the operationType value. - */ - public GroupUpdateOperation operationType() { - return this.operationType; - } - - /** - * Set the operationType property: Whether to add or remove the machines. - * - * @param operationType the operationType value to set. - * @return the GroupBodyProperties object itself. - */ - public GroupBodyProperties withOperationType(GroupUpdateOperation operationType) { - this.operationType = operationType; - return this; - } - - /** - * Get the machines property: List of machine names that are part of this group. - * - * @return the machines value. - */ - public List machines() { - return this.machines; - } - - /** - * Set the machines property: List of machine names that are part of this group. - * - * @param machines the machines value to set. - * @return the GroupBodyProperties object itself. - */ - public GroupBodyProperties withMachines(List machines) { - this.machines = machines; - 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("operationType", this.operationType == null ? null : this.operationType.toString()); - jsonWriter.writeArrayField("machines", this.machines, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupBodyProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupBodyProperties 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 GroupBodyProperties. - */ - public static GroupBodyProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupBodyProperties deserializedGroupBodyProperties = new GroupBodyProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("operationType".equals(fieldName)) { - deserializedGroupBodyProperties.operationType = GroupUpdateOperation.fromString(reader.getString()); - } else if ("machines".equals(fieldName)) { - List machines = reader.readArray(reader1 -> reader1.getString()); - deserializedGroupBodyProperties.machines = machines; - } else { - reader.skipChildren(); - } - } - - return deserializedGroupBodyProperties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupListResult.java deleted file mode 100644 index 5348f33b8dca..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupListResult.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -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.migration.assessment.fluent.models.GroupInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a Group list operation. - */ -@Fluent -public final class GroupListResult implements JsonSerializable { - /* - * The Group items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of GroupListResult class. - */ - public GroupListResult() { - } - - /** - * Get the value property: The Group items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The Group items on this page. - * - * @param value the value value to set. - * @return the GroupListResult object itself. - */ - public GroupListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the GroupListResult object itself. - */ - public GroupListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * 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 GroupListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(GroupListResult.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 GroupListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupListResult 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 GroupListResult. - */ - public static GroupListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupListResult deserializedGroupListResult = new GroupListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> GroupInner.fromJson(reader1)); - deserializedGroupListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedGroupListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupListResult; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupProperties.java deleted file mode 100644 index d2ef0b7782bb..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupProperties.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * Properties of group resource. - */ -@Fluent -public final class GroupProperties extends AzureResourceProperties { - /* - * Whether the group has been created and is valid. - */ - private GroupStatus groupStatus; - - /* - * Number of machines part of this group. - */ - private Integer machineCount; - - /* - * List of References to Assessments created on this group. - */ - private List assessments; - - /* - * List of assessment types supported on this group. - */ - private List supportedAssessmentTypes; - - /* - * If the assessments are in running state. - */ - private Boolean areAssessmentsRunning; - - /* - * Time when this group was created. Date-Time represented in ISO-8601 format. - */ - private OffsetDateTime createdTimestamp; - - /* - * Time when this group was last updated. Date-Time represented in ISO-8601 format. - */ - private OffsetDateTime updatedTimestamp; - - /* - * The type of group. - */ - private GroupType groupType; - - /** - * Creates an instance of GroupProperties class. - */ - public GroupProperties() { - } - - /** - * Get the groupStatus property: Whether the group has been created and is valid. - * - * @return the groupStatus value. - */ - public GroupStatus groupStatus() { - return this.groupStatus; - } - - /** - * Get the machineCount property: Number of machines part of this group. - * - * @return the machineCount value. - */ - public Integer machineCount() { - return this.machineCount; - } - - /** - * Get the assessments property: List of References to Assessments created on this group. - * - * @return the assessments value. - */ - public List assessments() { - return this.assessments; - } - - /** - * Get the supportedAssessmentTypes property: List of assessment types supported on this group. - * - * @return the supportedAssessmentTypes value. - */ - public List supportedAssessmentTypes() { - return this.supportedAssessmentTypes; - } - - /** - * Set the supportedAssessmentTypes property: List of assessment types supported on this group. - * - * @param supportedAssessmentTypes the supportedAssessmentTypes value to set. - * @return the GroupProperties object itself. - */ - public GroupProperties withSupportedAssessmentTypes(List supportedAssessmentTypes) { - this.supportedAssessmentTypes = supportedAssessmentTypes; - return this; - } - - /** - * Get the areAssessmentsRunning property: If the assessments are in running state. - * - * @return the areAssessmentsRunning value. - */ - public Boolean areAssessmentsRunning() { - return this.areAssessmentsRunning; - } - - /** - * Get the createdTimestamp property: Time when this group was created. Date-Time represented in ISO-8601 format. - * - * @return the createdTimestamp value. - */ - public OffsetDateTime createdTimestamp() { - return this.createdTimestamp; - } - - /** - * Get the updatedTimestamp property: Time when this group was last updated. Date-Time represented in ISO-8601 - * format. - * - * @return the updatedTimestamp value. - */ - public OffsetDateTime updatedTimestamp() { - return this.updatedTimestamp; - } - - /** - * Get the groupType property: The type of group. - * - * @return the groupType value. - */ - public GroupType groupType() { - return this.groupType; - } - - /** - * Set the groupType property: The type of group. - * - * @param groupType the groupType value to set. - * @return the GroupProperties object itself. - */ - public GroupProperties withGroupType(GroupType groupType) { - this.groupType = groupType; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GroupProperties withProvisioningState(ProvisioningState provisioningState) { - super.withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provisioningState", - provisioningState() == null ? null : provisioningState().toString()); - jsonWriter.writeArrayField("supportedAssessmentTypes", this.supportedAssessmentTypes, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeStringField("groupType", this.groupType == null ? null : this.groupType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupProperties 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 GroupProperties. - */ - public static GroupProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupProperties deserializedGroupProperties = new GroupProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedGroupProperties.withProvisioningState(ProvisioningState.fromString(reader.getString())); - } else if ("groupStatus".equals(fieldName)) { - deserializedGroupProperties.groupStatus = GroupStatus.fromString(reader.getString()); - } else if ("machineCount".equals(fieldName)) { - deserializedGroupProperties.machineCount = reader.getNullable(JsonReader::getInt); - } else if ("assessments".equals(fieldName)) { - List assessments = reader.readArray(reader1 -> reader1.getString()); - deserializedGroupProperties.assessments = assessments; - } else if ("supportedAssessmentTypes".equals(fieldName)) { - List supportedAssessmentTypes - = reader.readArray(reader1 -> AssessmentType.fromString(reader1.getString())); - deserializedGroupProperties.supportedAssessmentTypes = supportedAssessmentTypes; - } else if ("areAssessmentsRunning".equals(fieldName)) { - deserializedGroupProperties.areAssessmentsRunning = reader.getNullable(JsonReader::getBoolean); - } else if ("createdTimestamp".equals(fieldName)) { - deserializedGroupProperties.createdTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("updatedTimestamp".equals(fieldName)) { - deserializedGroupProperties.updatedTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("groupType".equals(fieldName)) { - deserializedGroupProperties.groupType = GroupType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupProperties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupStatus.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupStatus.java deleted file mode 100644 index 0b7b4d8fab41..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupStatus.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for GroupStatus. - */ -public final class GroupStatus extends ExpandableStringEnum { - /** - * Static value Created for GroupStatus. - */ - public static final GroupStatus CREATED = fromString("Created"); - - /** - * Static value Updated for GroupStatus. - */ - public static final GroupStatus UPDATED = fromString("Updated"); - - /** - * Static value Running for GroupStatus. - */ - public static final GroupStatus RUNNING = fromString("Running"); - - /** - * Static value Completed for GroupStatus. - */ - public static final GroupStatus COMPLETED = fromString("Completed"); - - /** - * Static value Invalid for GroupStatus. - */ - public static final GroupStatus INVALID = fromString("Invalid"); - - /** - * Creates a new instance of GroupStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public GroupStatus() { - } - - /** - * Creates or finds a GroupStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding GroupStatus. - */ - public static GroupStatus fromString(String name) { - return fromString(name, GroupStatus.class); - } - - /** - * Gets known GroupStatus values. - * - * @return known GroupStatus values. - */ - public static Collection values() { - return values(GroupStatus.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupType.java deleted file mode 100644 index fb10c9fdc7a1..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for GroupType. - */ -public final class GroupType extends ExpandableStringEnum { - /** - * Static value Default for GroupType. - */ - public static final GroupType DEFAULT = fromString("Default"); - - /** - * Static value Import for GroupType. - */ - public static final GroupType IMPORT = fromString("Import"); - - /** - * Creates a new instance of GroupType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public GroupType() { - } - - /** - * Creates or finds a GroupType from its string representation. - * - * @param name a name to look for. - * @return the corresponding GroupType. - */ - public static GroupType fromString(String name) { - return fromString(name, GroupType.class); - } - - /** - * Gets known GroupType values. - * - * @return known GroupType values. - */ - public static Collection values() { - return values(GroupType.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupUpdateOperation.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupUpdateOperation.java deleted file mode 100644 index 4d5a70a50b1e..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupUpdateOperation.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for GroupUpdateOperation. - */ -public final class GroupUpdateOperation extends ExpandableStringEnum { - /** - * Static value Add for GroupUpdateOperation. - */ - public static final GroupUpdateOperation ADD = fromString("Add"); - - /** - * Static value Remove for GroupUpdateOperation. - */ - public static final GroupUpdateOperation REMOVE = fromString("Remove"); - - /** - * Creates a new instance of GroupUpdateOperation value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public GroupUpdateOperation() { - } - - /** - * Creates or finds a GroupUpdateOperation from its string representation. - * - * @param name a name to look for. - * @return the corresponding GroupUpdateOperation. - */ - public static GroupUpdateOperation fromString(String name) { - return fromString(name, GroupUpdateOperation.class); - } - - /** - * Gets known GroupUpdateOperation values. - * - * @return known GroupUpdateOperation values. - */ - public static Collection values() { - return values(GroupUpdateOperation.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupsOperations.java deleted file mode 100644 index e7c8489a48b2..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GroupsOperations.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 GroupsOperations. - */ -public interface GroupsOperations { - /** - * List Group 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 Group list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); - - /** - * List Group 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 Group list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, Context context); - - /** - * Get a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Group along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String projectName, String groupName, Context context); - - /** - * Get a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 Group. - */ - Group get(String resourceGroupName, String projectName, String groupName); - - /** - * Delete a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 groupName, Context context); - - /** - * Delete a Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 groupName); - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - Group updateMachines(String resourceGroupName, String projectName, String groupName, UpdateGroupBody body); - - /** - * Update machines in group. - * - * Update machines in group by adding or removing machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 group resource. - */ - Group updateMachines(String resourceGroupName, String projectName, String groupName, UpdateGroupBody body, - Context context); - - /** - * Get a Group. - * - * @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 Group along with {@link Response}. - */ - Group getById(String id); - - /** - * Get a Group. - * - * @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 Group along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a Group. - * - * @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 Group. - * - * @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 Group resource. - * - * @param name resource name. - * @return the first stage of the new Group definition. - */ - Group.DefinitionStages.Blank define(String name); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GuestOperatingSystemArchitecture.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GuestOperatingSystemArchitecture.java index d064b15557ab..2cf0f5aa55fe 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GuestOperatingSystemArchitecture.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/GuestOperatingSystemArchitecture.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for GuestOperatingSystemArchitecture. + * Guest operating system architecture. */ public final class GuestOperatingSystemArchitecture extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HardwareGeneration.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HardwareGeneration.java index 0ba1bbe84285..53a7b19432d5 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HardwareGeneration.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HardwareGeneration.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for HardwareGeneration. + * Hardware Generation. */ public final class HardwareGeneration extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessment.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessment.java new file mode 100644 index 000000000000..125f864452e0 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessment.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.HeterogeneousAssessmentInner; + +/** + * An immutable client-side representation of HeterogeneousAssessment. + */ +public interface HeterogeneousAssessment { + /** + * 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. + */ + HeterogeneousAssessmentProperties 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.migration.assessment.fluent.models.HeterogeneousAssessmentInner object. + * + * @return the inner object. + */ + HeterogeneousAssessmentInner innerModel(); + + /** + * The entirety of the HeterogeneousAssessment definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The HeterogeneousAssessment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the HeterogeneousAssessment definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the HeterogeneousAssessment 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 HeterogeneousAssessment 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. + */ + HeterogeneousAssessment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HeterogeneousAssessment create(Context context); + } + + /** + * The stage of the HeterogeneousAssessment 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(HeterogeneousAssessmentProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HeterogeneousAssessment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HeterogeneousAssessment refresh(Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentListResult.java new file mode 100644 index 000000000000..032b3e6dd9d6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.HeterogeneousAssessmentInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a HeterogeneousAssessment list operation. + */ +@Fluent +public final class HeterogeneousAssessmentListResult implements JsonSerializable { + /* + * The HeterogeneousAssessment items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HeterogeneousAssessmentListResult class. + */ + public HeterogeneousAssessmentListResult() { + } + + /** + * Get the value property: The HeterogeneousAssessment items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The HeterogeneousAssessment items on this page. + * + * @param value the value value to set. + * @return the HeterogeneousAssessmentListResult object itself. + */ + public HeterogeneousAssessmentListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the HeterogeneousAssessmentListResult object itself. + */ + public HeterogeneousAssessmentListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 HeterogeneousAssessmentListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HeterogeneousAssessmentListResult.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 HeterogeneousAssessmentListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HeterogeneousAssessmentListResult 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 HeterogeneousAssessmentListResult. + */ + public static HeterogeneousAssessmentListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HeterogeneousAssessmentListResult deserializedHeterogeneousAssessmentListResult + = new HeterogeneousAssessmentListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> HeterogeneousAssessmentInner.fromJson(reader1)); + deserializedHeterogeneousAssessmentListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHeterogeneousAssessmentListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHeterogeneousAssessmentListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentOperations.java new file mode 100644 index 000000000000..09cf96d882ee --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentOperations.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 HeterogeneousAssessmentOperations. + */ +public interface HeterogeneousAssessmentOperations { + /** + * List HeterogeneousAssessment 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 HeterogeneousAssessment list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List HeterogeneousAssessment 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 HeterogeneousAssessment list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessment along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessment. + */ + HeterogeneousAssessment get(String resourceGroupName, String projectName, String assessmentName); + + /** + * Delete a HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 a HeterogeneousAssessment. + * + * @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 HeterogeneousAssessment along with {@link Response}. + */ + HeterogeneousAssessment getById(String id); + + /** + * Get a HeterogeneousAssessment. + * + * @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 HeterogeneousAssessment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a HeterogeneousAssessment. + * + * @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 HeterogeneousAssessment. + * + * @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 HeterogeneousAssessment resource. + * + * @param name resource name. + * @return the first stage of the new HeterogeneousAssessment definition. + */ + HeterogeneousAssessment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentProperties.java new file mode 100644 index 000000000000..2ded4181e24b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentProperties.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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.util.List; + +/** + * Properties of an assessment. + */ +@Fluent +public final class HeterogeneousAssessmentProperties implements JsonSerializable { + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /* + * Arm id of partner assessments. + */ + private List assessmentArmIds; + + /* + * Whether assessment is in valid state and all machines have been assessed. + */ + private AssessmentStatus status; + + /* + * Timestamp for the last successfully calculated summary for the assessment. + */ + private OffsetDateTime lastCalculatedOn; + + /* + * Confidence rating in percentage. + */ + private Float confidenceRatingInPercentage; + + /* + * Azure location for assessment. + */ + private String azureLocation; + + /* + * Sizing criterion for assessment. + */ + private AssessmentSizingCriterion sizingCriterion; + + /* + * Schema version. + */ + private String schemaVersion; + + /** + * Creates an instance of HeterogeneousAssessmentProperties class. + */ + public HeterogeneousAssessmentProperties() { + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the assessmentArmIds property: Arm id of partner assessments. + * + * @return the assessmentArmIds value. + */ + public List assessmentArmIds() { + return this.assessmentArmIds; + } + + /** + * Set the assessmentArmIds property: Arm id of partner assessments. + * + * @param assessmentArmIds the assessmentArmIds value to set. + * @return the HeterogeneousAssessmentProperties object itself. + */ + public HeterogeneousAssessmentProperties withAssessmentArmIds(List assessmentArmIds) { + this.assessmentArmIds = assessmentArmIds; + return this; + } + + /** + * 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; + } + + /** + * Get the lastCalculatedOn property: Timestamp for the last successfully calculated summary for the assessment. + * + * @return the lastCalculatedOn value. + */ + public OffsetDateTime lastCalculatedOn() { + return this.lastCalculatedOn; + } + + /** + * Get the confidenceRatingInPercentage property: Confidence rating in percentage. + * + * @return the confidenceRatingInPercentage value. + */ + public Float confidenceRatingInPercentage() { + return this.confidenceRatingInPercentage; + } + + /** + * Get the azureLocation property: Azure location for assessment. + * + * @return the azureLocation value. + */ + public String azureLocation() { + return this.azureLocation; + } + + /** + * Get the sizingCriterion property: Sizing criterion for assessment. + * + * @return the sizingCriterion value. + */ + public AssessmentSizingCriterion sizingCriterion() { + return this.sizingCriterion; + } + + /** + * Get the schemaVersion property: Schema version. + * + * @return the schemaVersion value. + */ + public String schemaVersion() { + return this.schemaVersion; + } + + /** + * 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.writeArrayField("assessmentArmIds", this.assessmentArmIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HeterogeneousAssessmentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HeterogeneousAssessmentProperties 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 HeterogeneousAssessmentProperties. + */ + public static HeterogeneousAssessmentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HeterogeneousAssessmentProperties deserializedHeterogeneousAssessmentProperties + = new HeterogeneousAssessmentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedHeterogeneousAssessmentProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("assessmentArmIds".equals(fieldName)) { + List assessmentArmIds = reader.readArray(reader1 -> reader1.getString()); + deserializedHeterogeneousAssessmentProperties.assessmentArmIds = assessmentArmIds; + } else if ("status".equals(fieldName)) { + deserializedHeterogeneousAssessmentProperties.status + = AssessmentStatus.fromString(reader.getString()); + } else if ("lastCalculatedOn".equals(fieldName)) { + deserializedHeterogeneousAssessmentProperties.lastCalculatedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("confidenceRatingInPercentage".equals(fieldName)) { + deserializedHeterogeneousAssessmentProperties.confidenceRatingInPercentage + = reader.getNullable(JsonReader::getFloat); + } else if ("azureLocation".equals(fieldName)) { + deserializedHeterogeneousAssessmentProperties.azureLocation = reader.getString(); + } else if ("sizingCriterion".equals(fieldName)) { + deserializedHeterogeneousAssessmentProperties.sizingCriterion + = AssessmentSizingCriterion.fromString(reader.getString()); + } else if ("schemaVersion".equals(fieldName)) { + deserializedHeterogeneousAssessmentProperties.schemaVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHeterogeneousAssessmentProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentSummary.java new file mode 100644 index 000000000000..b6aa51bd0608 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentSummary.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.HeterogeneousAssessmentSummaryInner; + +/** + * An immutable client-side representation of HeterogeneousAssessmentSummary. + */ +public interface HeterogeneousAssessmentSummary { + /** + * 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. + */ + HeterogeneousAssessmentSummaryProperties 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.migration.assessment.fluent.models.HeterogeneousAssessmentSummaryInner + * object. + * + * @return the inner object. + */ + HeterogeneousAssessmentSummaryInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentSummaryListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentSummaryListResult.java new file mode 100644 index 000000000000..89e6818e2cfa --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentSummaryListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.HeterogeneousAssessmentSummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a HeterogeneousAssessmentSummary list operation. + */ +@Fluent +public final class HeterogeneousAssessmentSummaryListResult + implements JsonSerializable { + /* + * The HeterogeneousAssessmentSummary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HeterogeneousAssessmentSummaryListResult class. + */ + public HeterogeneousAssessmentSummaryListResult() { + } + + /** + * Get the value property: The HeterogeneousAssessmentSummary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The HeterogeneousAssessmentSummary items on this page. + * + * @param value the value value to set. + * @return the HeterogeneousAssessmentSummaryListResult object itself. + */ + public HeterogeneousAssessmentSummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the HeterogeneousAssessmentSummaryListResult object itself. + */ + public HeterogeneousAssessmentSummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 HeterogeneousAssessmentSummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HeterogeneousAssessmentSummaryListResult.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 HeterogeneousAssessmentSummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HeterogeneousAssessmentSummaryListResult 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 HeterogeneousAssessmentSummaryListResult. + */ + public static HeterogeneousAssessmentSummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HeterogeneousAssessmentSummaryListResult deserializedHeterogeneousAssessmentSummaryListResult + = new HeterogeneousAssessmentSummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> HeterogeneousAssessmentSummaryInner.fromJson(reader1)); + deserializedHeterogeneousAssessmentSummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHeterogeneousAssessmentSummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHeterogeneousAssessmentSummaryListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentSummaryOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentSummaryOperations.java new file mode 100644 index 000000000000..e6aab4cb1b8e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentSummaryOperations.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 HeterogeneousAssessmentSummaryOperations. + */ +public interface HeterogeneousAssessmentSummaryOperations { + /** + * List HeterogeneousAssessmentSummary resources by HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessmentSummary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List HeterogeneousAssessmentSummary resources by HeterogeneousAssessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment 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 HeterogeneousAssessmentSummary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a HeterogeneousAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment ARM name. + * @param summaryName Gets the Name of the Heterogeneous assessment 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 HeterogeneousAssessmentSummary along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String summaryName, Context context); + + /** + * Get a HeterogeneousAssessmentSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Heterogeneous Assessment ARM name. + * @param summaryName Gets the Name of the Heterogeneous assessment 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 HeterogeneousAssessmentSummary. + */ + HeterogeneousAssessmentSummary get(String resourceGroupName, String projectName, String assessmentName, + String summaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentSummaryProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentSummaryProperties.java new file mode 100644 index 000000000000..e149cd4df45c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentSummaryProperties.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Heterogeneous assessment summary properties class. + */ +@Immutable +public final class HeterogeneousAssessmentSummaryProperties + implements JsonSerializable { + /* + * The assessment name + */ + private String assessmentName; + + /* + * The summary type + */ + private SummaryType summaryType; + + /* + * Gets the migration type summaries. + */ + private List migrationPaths; + + /* + * Gets the readiness summary. + */ + private List readinessSummary; + + /* + * Gets the confidence score. + */ + private Float confidenceScore; + + /* + * Gets the cost components. + */ + private List costComponents; + + /* + * Gets the saving component. + */ + private List savingComponent; + + /** + * Creates an instance of HeterogeneousAssessmentSummaryProperties class. + */ + public HeterogeneousAssessmentSummaryProperties() { + } + + /** + * Get the assessmentName property: The assessment name. + * + * @return the assessmentName value. + */ + public String assessmentName() { + return this.assessmentName; + } + + /** + * Get the summaryType property: The summary type. + * + * @return the summaryType value. + */ + public SummaryType summaryType() { + return this.summaryType; + } + + /** + * Get the migrationPaths property: Gets the migration type summaries. + * + * @return the migrationPaths value. + */ + public List migrationPaths() { + return this.migrationPaths; + } + + /** + * Get the readinessSummary property: Gets the readiness summary. + * + * @return the readinessSummary value. + */ + public List readinessSummary() { + return this.readinessSummary; + } + + /** + * Get the confidenceScore property: Gets the confidence score. + * + * @return the confidenceScore value. + */ + public Float confidenceScore() { + return this.confidenceScore; + } + + /** + * Get the costComponents property: Gets the cost components. + * + * @return the costComponents value. + */ + public List costComponents() { + return this.costComponents; + } + + /** + * Get the savingComponent property: Gets the saving component. + * + * @return the savingComponent value. + */ + public List savingComponent() { + return this.savingComponent; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (migrationPaths() != null) { + migrationPaths().forEach(e -> e.validate()); + } + if (readinessSummary() != null) { + readinessSummary().forEach(e -> e.validate()); + } + if (costComponents() != null) { + costComponents().forEach(e -> e.validate()); + } + if (savingComponent() != null) { + savingComponent().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HeterogeneousAssessmentSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HeterogeneousAssessmentSummaryProperties 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 HeterogeneousAssessmentSummaryProperties. + */ + public static HeterogeneousAssessmentSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HeterogeneousAssessmentSummaryProperties deserializedHeterogeneousAssessmentSummaryProperties + = new HeterogeneousAssessmentSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assessmentName".equals(fieldName)) { + deserializedHeterogeneousAssessmentSummaryProperties.assessmentName = reader.getString(); + } else if ("summaryType".equals(fieldName)) { + deserializedHeterogeneousAssessmentSummaryProperties.summaryType + = SummaryType.fromString(reader.getString()); + } else if ("migrationPaths".equals(fieldName)) { + List migrationPaths + = reader.readArray(reader1 -> MigrationTypeSummaries.fromJson(reader1)); + deserializedHeterogeneousAssessmentSummaryProperties.migrationPaths = migrationPaths; + } else if ("readinessSummary".equals(fieldName)) { + List readinessSummary + = reader.readArray( + reader1 -> HeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem.fromJson(reader1)); + deserializedHeterogeneousAssessmentSummaryProperties.readinessSummary = readinessSummary; + } else if ("confidenceScore".equals(fieldName)) { + deserializedHeterogeneousAssessmentSummaryProperties.confidenceScore + = reader.getNullable(JsonReader::getFloat); + } else if ("costComponents".equals(fieldName)) { + List costComponents = reader.readArray(reader1 -> CostComponent.fromJson(reader1)); + deserializedHeterogeneousAssessmentSummaryProperties.costComponents = costComponents; + } else if ("savingComponent".equals(fieldName)) { + List savingComponent + = reader.readArray(reader1 -> SavingComponent.fromJson(reader1)); + deserializedHeterogeneousAssessmentSummaryProperties.savingComponent = savingComponent; + } else { + reader.skipChildren(); + } + } + + return deserializedHeterogeneousAssessmentSummaryProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem.java new file mode 100644 index 000000000000..8f128d86aee0 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 HeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem + implements JsonSerializable { + /* + * The name. + */ + private CloudSuitabilityCommon name; + + /* + * The value. + */ + private Integer value; + + /** + * Creates an instance of HeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem class. + */ + public HeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem() { + } + + /** + * 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 HeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem 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 + * HeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem. + */ + public static HeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + HeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem deserializedHeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem + = new HeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedHeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem.name + = CloudSuitabilityCommon.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedHeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem.value + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedHeterogeneousAssessmentSummaryPropertiesReadinessSummaryItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HyperVLicenseType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HyperVLicenseType.java new file mode 100644 index 000000000000..8d9bee461586 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HyperVLicenseType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Business case supported HyperV License types. + */ +public final class HyperVLicenseType extends ExpandableStringEnum { + /** + * Static value Unknown for HyperVLicenseType. + */ + public static final HyperVLicenseType UNKNOWN = fromString("Unknown"); + + /** + * Static value Datacentre for HyperVLicenseType. + */ + public static final HyperVLicenseType DATACENTRE = fromString("Datacentre"); + + /** + * Static value Standard for HyperVLicenseType. + */ + public static final HyperVLicenseType STANDARD = fromString("Standard"); + + /** + * Creates a new instance of HyperVLicenseType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HyperVLicenseType() { + } + + /** + * Creates or finds a HyperVLicenseType from its string representation. + * + * @param name a name to look for. + * @return the corresponding HyperVLicenseType. + */ + public static HyperVLicenseType fromString(String name) { + return fromString(name, HyperVLicenseType.class); + } + + /** + * Gets known HyperVLicenseType values. + * + * @return known HyperVLicenseType values. + */ + public static Collection values() { + return values(HyperVLicenseType.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HypervCollectorsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HypervCollectorsOperations.java index 125d1224d1dd..45533fd0a08c 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HypervCollectorsOperations.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HypervCollectorsOperations.java @@ -22,7 +22,7 @@ public interface HypervCollectorsOperations { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a HypervCollector list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List HypervCollector resources by AssessmentProject. @@ -35,8 +35,7 @@ public interface HypervCollectorsOperations { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a HypervCollector list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** * Get a HypervCollector. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HypervLicense.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HypervLicense.java new file mode 100644 index 000000000000..0dfa2f4170f8 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HypervLicense.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Representation of a licence. + */ +@Fluent +public final class HypervLicense implements JsonSerializable { + /* + * Cost of a licence. + */ + private float licenseCost; + + /* + * HyperV licence type. + */ + private HyperVLicenseType licenseType; + + /** + * Creates an instance of HypervLicense class. + */ + public HypervLicense() { + } + + /** + * Get the licenseCost property: Cost of a licence. + * + * @return the licenseCost value. + */ + public float licenseCost() { + return this.licenseCost; + } + + /** + * Set the licenseCost property: Cost of a licence. + * + * @param licenseCost the licenseCost value to set. + * @return the HypervLicense object itself. + */ + public HypervLicense withLicenseCost(float licenseCost) { + this.licenseCost = licenseCost; + return this; + } + + /** + * Get the licenseType property: HyperV licence type. + * + * @return the licenseType value. + */ + public HyperVLicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: HyperV licence type. + * + * @param licenseType the licenseType value to set. + * @return the HypervLicense object itself. + */ + public HypervLicense withLicenseType(HyperVLicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (licenseType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property licenseType in model HypervLicense")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HypervLicense.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeFloatField("licenseCost", this.licenseCost); + jsonWriter.writeStringField("licenseType", this.licenseType == null ? null : this.licenseType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HypervLicense from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HypervLicense 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 HypervLicense. + */ + public static HypervLicense fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HypervLicense deserializedHypervLicense = new HypervLicense(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("licenseCost".equals(fieldName)) { + deserializedHypervLicense.licenseCost = reader.getFloat(); + } else if ("licenseType".equals(fieldName)) { + deserializedHypervLicense.licenseType = HyperVLicenseType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHypervLicense; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HypervVirtualizationManagementSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HypervVirtualizationManagementSettings.java new file mode 100644 index 000000000000..16d6eccd0f95 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/HypervVirtualizationManagementSettings.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * HyperV Virtualization Management Settings. + */ +@Fluent +public final class HypervVirtualizationManagementSettings + implements JsonSerializable { + /* + * Number of physical cores per licence. + */ + private int numberOfPhysicalCoresPerLicense; + + /* + * Software Assurance Cost. + */ + private float softwareAssuranceCost; + + /* + * Licence and support list. + */ + private List licenseAndSupportList; + + /** + * Creates an instance of HypervVirtualizationManagementSettings class. + */ + public HypervVirtualizationManagementSettings() { + } + + /** + * Get the numberOfPhysicalCoresPerLicense property: Number of physical cores per licence. + * + * @return the numberOfPhysicalCoresPerLicense value. + */ + public int numberOfPhysicalCoresPerLicense() { + return this.numberOfPhysicalCoresPerLicense; + } + + /** + * Set the numberOfPhysicalCoresPerLicense property: Number of physical cores per licence. + * + * @param numberOfPhysicalCoresPerLicense the numberOfPhysicalCoresPerLicense value to set. + * @return the HypervVirtualizationManagementSettings object itself. + */ + public HypervVirtualizationManagementSettings + withNumberOfPhysicalCoresPerLicense(int numberOfPhysicalCoresPerLicense) { + this.numberOfPhysicalCoresPerLicense = numberOfPhysicalCoresPerLicense; + return this; + } + + /** + * Get the softwareAssuranceCost property: Software Assurance Cost. + * + * @return the softwareAssuranceCost value. + */ + public float softwareAssuranceCost() { + return this.softwareAssuranceCost; + } + + /** + * Set the softwareAssuranceCost property: Software Assurance Cost. + * + * @param softwareAssuranceCost the softwareAssuranceCost value to set. + * @return the HypervVirtualizationManagementSettings object itself. + */ + public HypervVirtualizationManagementSettings withSoftwareAssuranceCost(float softwareAssuranceCost) { + this.softwareAssuranceCost = softwareAssuranceCost; + return this; + } + + /** + * Get the licenseAndSupportList property: Licence and support list. + * + * @return the licenseAndSupportList value. + */ + public List licenseAndSupportList() { + return this.licenseAndSupportList; + } + + /** + * Set the licenseAndSupportList property: Licence and support list. + * + * @param licenseAndSupportList the licenseAndSupportList value to set. + * @return the HypervVirtualizationManagementSettings object itself. + */ + public HypervVirtualizationManagementSettings withLicenseAndSupportList(List licenseAndSupportList) { + this.licenseAndSupportList = licenseAndSupportList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (licenseAndSupportList() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property licenseAndSupportList in model HypervVirtualizationManagementSettings")); + } else { + licenseAndSupportList().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HypervVirtualizationManagementSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("numberOfPhysicalCoresPerLicense", this.numberOfPhysicalCoresPerLicense); + jsonWriter.writeFloatField("softwareAssuranceCost", this.softwareAssuranceCost); + jsonWriter.writeArrayField("licenseAndSupportList", this.licenseAndSupportList, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HypervVirtualizationManagementSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HypervVirtualizationManagementSettings 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 HypervVirtualizationManagementSettings. + */ + public static HypervVirtualizationManagementSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HypervVirtualizationManagementSettings deserializedHypervVirtualizationManagementSettings + = new HypervVirtualizationManagementSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("numberOfPhysicalCoresPerLicense".equals(fieldName)) { + deserializedHypervVirtualizationManagementSettings.numberOfPhysicalCoresPerLicense + = reader.getInt(); + } else if ("softwareAssuranceCost".equals(fieldName)) { + deserializedHypervVirtualizationManagementSettings.softwareAssuranceCost = reader.getFloat(); + } else if ("licenseAndSupportList".equals(fieldName)) { + List licenseAndSupportList + = reader.readArray(reader1 -> HypervLicense.fromJson(reader1)); + deserializedHypervVirtualizationManagementSettings.licenseAndSupportList = licenseAndSupportList; + } else { + reader.skipChildren(); + } + } + + return deserializedHypervVirtualizationManagementSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/IaasOsDistribution.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/IaasOsDistribution.java new file mode 100644 index 000000000000..c0b34e80d216 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/IaasOsDistribution.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Shows the infrastructure as a service machine OS distribution. + */ +@Immutable +public final class IaasOsDistribution implements JsonSerializable { + /* + * Number of Windows servers. + */ + private Integer windows; + + /* + * Number of Linux servers. + */ + private Integer linux; + + /* + * Number of servers neither Windows or Linux. + */ + private Integer other; + + /** + * Creates an instance of IaasOsDistribution class. + */ + public IaasOsDistribution() { + } + + /** + * Get the windows property: Number of Windows servers. + * + * @return the windows value. + */ + public Integer windows() { + return this.windows; + } + + /** + * Get the linux property: Number of Linux servers. + * + * @return the linux value. + */ + public Integer linux() { + return this.linux; + } + + /** + * Get the other property: Number of servers neither Windows or Linux. + * + * @return the other value. + */ + public Integer other() { + return this.other; + } + + /** + * 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 IaasOsDistribution from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IaasOsDistribution 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 IaasOsDistribution. + */ + public static IaasOsDistribution fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IaasOsDistribution deserializedIaasOsDistribution = new IaasOsDistribution(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("windows".equals(fieldName)) { + deserializedIaasOsDistribution.windows = reader.getNullable(JsonReader::getInt); + } else if ("linux".equals(fieldName)) { + deserializedIaasOsDistribution.linux = reader.getNullable(JsonReader::getInt); + } else if ("other".equals(fieldName)) { + deserializedIaasOsDistribution.other = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedIaasOsDistribution; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/IaasOsLicensingDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/IaasOsLicensingDetails.java new file mode 100644 index 000000000000..bac4685fad50 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/IaasOsLicensingDetails.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 Iaas OS licensing details. + */ +@Immutable +public final class IaasOsLicensingDetails implements JsonSerializable { + /* + * The OS type. + */ + private String osType; + + /* + * The total cost. + */ + private Float totalCost; + + /* + * The decommission cost. + */ + private Float decomissionCost; + + /** + * Creates an instance of IaasOsLicensingDetails class. + */ + public IaasOsLicensingDetails() { + } + + /** + * Get the osType property: The OS type. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Get the totalCost property: The total cost. + * + * @return the totalCost value. + */ + public Float totalCost() { + return this.totalCost; + } + + /** + * Get the decomissionCost property: The decommission cost. + * + * @return the decomissionCost value. + */ + public Float decomissionCost() { + return this.decomissionCost; + } + + /** + * 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 IaasOsLicensingDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IaasOsLicensingDetails 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 IaasOsLicensingDetails. + */ + public static IaasOsLicensingDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IaasOsLicensingDetails deserializedIaasOsLicensingDetails = new IaasOsLicensingDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("osType".equals(fieldName)) { + deserializedIaasOsLicensingDetails.osType = reader.getString(); + } else if ("totalCost".equals(fieldName)) { + deserializedIaasOsLicensingDetails.totalCost = reader.getNullable(JsonReader::getFloat); + } else if ("decomissionCost".equals(fieldName)) { + deserializedIaasOsLicensingDetails.decomissionCost = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedIaasOsLicensingDetails; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/IaasSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/IaasSummary.java new file mode 100644 index 000000000000..924ee42729f9 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/IaasSummary.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.IaasSummaryInner; + +/** + * An immutable client-side representation of IaasSummary. + */ +public interface IaasSummary { + /** + * 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. + */ + IaasSummaryProperties 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.migration.assessment.fluent.models.IaasSummaryInner object. + * + * @return the inner object. + */ + IaasSummaryInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/IaasSummaryListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/IaasSummaryListResult.java new file mode 100644 index 000000000000..76391e11615c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/IaasSummaryListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.IaasSummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a IaasSummary list operation. + */ +@Fluent +public final class IaasSummaryListResult implements JsonSerializable { + /* + * The IaasSummary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of IaasSummaryListResult class. + */ + public IaasSummaryListResult() { + } + + /** + * Get the value property: The IaasSummary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The IaasSummary items on this page. + * + * @param value the value value to set. + * @return the IaasSummaryListResult object itself. + */ + public IaasSummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the IaasSummaryListResult object itself. + */ + public IaasSummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 IaasSummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IaasSummaryListResult.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 IaasSummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IaasSummaryListResult 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 IaasSummaryListResult. + */ + public static IaasSummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IaasSummaryListResult deserializedIaasSummaryListResult = new IaasSummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> IaasSummaryInner.fromJson(reader1)); + deserializedIaasSummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIaasSummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIaasSummaryListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/IaasSummaryProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/IaasSummaryProperties.java new file mode 100644 index 000000000000..1f1512362967 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/IaasSummaryProperties.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Iaas summary properties class. + */ +@Immutable +public final class IaasSummaryProperties implements JsonSerializable { + /* + * The Azure IaaS summary. + */ + private AzureIaasSummary azureIaasSummary; + + /* + * The on premises IaaS summary. + */ + private OnPremisesIaasSummary onPremisesIaasSummary; + + /** + * Creates an instance of IaasSummaryProperties class. + */ + public IaasSummaryProperties() { + } + + /** + * Get the azureIaasSummary property: The Azure IaaS summary. + * + * @return the azureIaasSummary value. + */ + public AzureIaasSummary azureIaasSummary() { + return this.azureIaasSummary; + } + + /** + * Get the onPremisesIaasSummary property: The on premises IaaS summary. + * + * @return the onPremisesIaasSummary value. + */ + public OnPremisesIaasSummary onPremisesIaasSummary() { + return this.onPremisesIaasSummary; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureIaasSummary() != null) { + azureIaasSummary().validate(); + } + if (onPremisesIaasSummary() != null) { + onPremisesIaasSummary().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IaasSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IaasSummaryProperties 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 IaasSummaryProperties. + */ + public static IaasSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IaasSummaryProperties deserializedIaasSummaryProperties = new IaasSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureIaasSummary".equals(fieldName)) { + deserializedIaasSummaryProperties.azureIaasSummary = AzureIaasSummary.fromJson(reader); + } else if ("onPremisesIaasSummary".equals(fieldName)) { + deserializedIaasSummaryProperties.onPremisesIaasSummary = OnPremisesIaasSummary.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIaasSummaryProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportCollectorsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportCollectorsOperations.java index 24a59f7f6f74..4aa3a98e01db 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportCollectorsOperations.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportCollectorsOperations.java @@ -22,7 +22,7 @@ public interface ImportCollectorsOperations { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a ImportCollector list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List ImportCollector resources by AssessmentProject. @@ -35,8 +35,7 @@ public interface ImportCollectorsOperations { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a ImportCollector list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** * Get a ImportCollector. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportSqlCollector.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportSqlCollector.java new file mode 100644 index 000000000000..59bacbe8c83a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportSqlCollector.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.ImportSqlCollectorInner; + +/** + * An immutable client-side representation of ImportSqlCollector. + */ +public interface ImportSqlCollector { + /** + * 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. + */ + ImportSqlCollectorProperties 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.migration.assessment.fluent.models.ImportSqlCollectorInner object. + * + * @return the inner object. + */ + ImportSqlCollectorInner innerModel(); + + /** + * The entirety of the ImportSqlCollector definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ImportSqlCollector definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ImportSqlCollector definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ImportSqlCollector 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 ImportSqlCollector 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. + */ + ImportSqlCollector create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ImportSqlCollector create(Context context); + } + + /** + * The stage of the ImportSqlCollector 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(ImportSqlCollectorProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ImportSqlCollector refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ImportSqlCollector refresh(Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportSqlCollectorListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportSqlCollectorListResult.java new file mode 100644 index 000000000000..565298132cac --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportSqlCollectorListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.ImportSqlCollectorInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ImportSqlCollector list operation. + */ +@Fluent +public final class ImportSqlCollectorListResult implements JsonSerializable { + /* + * The ImportSqlCollector items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ImportSqlCollectorListResult class. + */ + public ImportSqlCollectorListResult() { + } + + /** + * Get the value property: The ImportSqlCollector items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ImportSqlCollector items on this page. + * + * @param value the value value to set. + * @return the ImportSqlCollectorListResult object itself. + */ + public ImportSqlCollectorListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ImportSqlCollectorListResult object itself. + */ + public ImportSqlCollectorListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 ImportSqlCollectorListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImportSqlCollectorListResult.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 ImportSqlCollectorListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImportSqlCollectorListResult 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 ImportSqlCollectorListResult. + */ + public static ImportSqlCollectorListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImportSqlCollectorListResult deserializedImportSqlCollectorListResult = new ImportSqlCollectorListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ImportSqlCollectorInner.fromJson(reader1)); + deserializedImportSqlCollectorListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedImportSqlCollectorListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedImportSqlCollectorListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportSqlCollectorOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportSqlCollectorOperations.java new file mode 100644 index 000000000000..91a0902876bf --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportSqlCollectorOperations.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 ImportSqlCollectorOperations. + */ +public interface ImportSqlCollectorOperations { + /** + * List ImportSqlCollector 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 ImportSqlCollector list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List ImportSqlCollector 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 ImportSqlCollector list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 ImportSqlCollector along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, + String importSqlCollectorsName, Context context); + + /** + * Get a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 ImportSqlCollector. + */ + ImportSqlCollector get(String resourceGroupName, String projectName, String importSqlCollectorsName); + + /** + * Delete a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 importSqlCollectorsName, + Context context); + + /** + * Delete a ImportSqlCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param importSqlCollectorsName Import SQL Collector 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 importSqlCollectorsName); + + /** + * Get a ImportSqlCollector. + * + * @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 ImportSqlCollector along with {@link Response}. + */ + ImportSqlCollector getById(String id); + + /** + * Get a ImportSqlCollector. + * + * @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 ImportSqlCollector along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a ImportSqlCollector. + * + * @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 ImportSqlCollector. + * + * @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 ImportSqlCollector resource. + * + * @param name resource name. + * @return the first stage of the new ImportSqlCollector definition. + */ + ImportSqlCollector.DefinitionStages.Blank define(String name); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportSqlCollectorProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportSqlCollectorProperties.java new file mode 100644 index 000000000000..65dfda3185f5 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ImportSqlCollectorProperties.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SQL Collector properties class. + */ +@Fluent +public final class ImportSqlCollectorProperties implements JsonSerializable { + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /* + * The sql db extended details. + */ + private String discoverySiteId; + + /* + * When was import SQL collector first created. + */ + private OffsetDateTime createdTimestamp; + + /* + * When was import SQL collector last updated. + */ + private OffsetDateTime updatedTimestamp; + + /** + * Creates an instance of ImportSqlCollectorProperties class. + */ + public ImportSqlCollectorProperties() { + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the discoverySiteId property: The sql db extended details. + * + * @return the discoverySiteId value. + */ + public String discoverySiteId() { + return this.discoverySiteId; + } + + /** + * Set the discoverySiteId property: The sql db extended details. + * + * @param discoverySiteId the discoverySiteId value to set. + * @return the ImportSqlCollectorProperties object itself. + */ + public ImportSqlCollectorProperties withDiscoverySiteId(String discoverySiteId) { + this.discoverySiteId = discoverySiteId; + return this; + } + + /** + * Get the createdTimestamp property: When was import SQL collector first created. + * + * @return the createdTimestamp value. + */ + public OffsetDateTime createdTimestamp() { + return this.createdTimestamp; + } + + /** + * Get the updatedTimestamp property: When was import SQL collector 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("discoverySiteId", this.discoverySiteId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImportSqlCollectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImportSqlCollectorProperties 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 ImportSqlCollectorProperties. + */ + public static ImportSqlCollectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImportSqlCollectorProperties deserializedImportSqlCollectorProperties = new ImportSqlCollectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedImportSqlCollectorProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("discoverySiteId".equals(fieldName)) { + deserializedImportSqlCollectorProperties.discoverySiteId = reader.getString(); + } else if ("createdTimestamp".equals(fieldName)) { + deserializedImportSqlCollectorProperties.createdTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedTimestamp".equals(fieldName)) { + deserializedImportSqlCollectorProperties.updatedTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedImportSqlCollectorProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/LaborSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/LaborSettings.java new file mode 100644 index 000000000000..2316de0b13e5 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/LaborSettings.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Labour settings. + */ +@Fluent +public final class LaborSettings implements JsonSerializable { + /* + * Physical servers per administrator. + */ + private int physicalServersPerAdmin; + + /* + * Virtual machines per administrator. + */ + private int virtualMachinesPerAdmin; + + /* + * Hourly administrator cost. + */ + private float hourlyAdminCost; + + /** + * Creates an instance of LaborSettings class. + */ + public LaborSettings() { + } + + /** + * Get the physicalServersPerAdmin property: Physical servers per administrator. + * + * @return the physicalServersPerAdmin value. + */ + public int physicalServersPerAdmin() { + return this.physicalServersPerAdmin; + } + + /** + * Set the physicalServersPerAdmin property: Physical servers per administrator. + * + * @param physicalServersPerAdmin the physicalServersPerAdmin value to set. + * @return the LaborSettings object itself. + */ + public LaborSettings withPhysicalServersPerAdmin(int physicalServersPerAdmin) { + this.physicalServersPerAdmin = physicalServersPerAdmin; + return this; + } + + /** + * Get the virtualMachinesPerAdmin property: Virtual machines per administrator. + * + * @return the virtualMachinesPerAdmin value. + */ + public int virtualMachinesPerAdmin() { + return this.virtualMachinesPerAdmin; + } + + /** + * Set the virtualMachinesPerAdmin property: Virtual machines per administrator. + * + * @param virtualMachinesPerAdmin the virtualMachinesPerAdmin value to set. + * @return the LaborSettings object itself. + */ + public LaborSettings withVirtualMachinesPerAdmin(int virtualMachinesPerAdmin) { + this.virtualMachinesPerAdmin = virtualMachinesPerAdmin; + return this; + } + + /** + * Get the hourlyAdminCost property: Hourly administrator cost. + * + * @return the hourlyAdminCost value. + */ + public float hourlyAdminCost() { + return this.hourlyAdminCost; + } + + /** + * Set the hourlyAdminCost property: Hourly administrator cost. + * + * @param hourlyAdminCost the hourlyAdminCost value to set. + * @return the LaborSettings object itself. + */ + public LaborSettings withHourlyAdminCost(float hourlyAdminCost) { + this.hourlyAdminCost = hourlyAdminCost; + 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.writeIntField("physicalServersPerAdmin", this.physicalServersPerAdmin); + jsonWriter.writeIntField("virtualMachinesPerAdmin", this.virtualMachinesPerAdmin); + jsonWriter.writeFloatField("hourlyAdminCost", this.hourlyAdminCost); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LaborSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LaborSettings 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 LaborSettings. + */ + public static LaborSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LaborSettings deserializedLaborSettings = new LaborSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("physicalServersPerAdmin".equals(fieldName)) { + deserializedLaborSettings.physicalServersPerAdmin = reader.getInt(); + } else if ("virtualMachinesPerAdmin".equals(fieldName)) { + deserializedLaborSettings.virtualMachinesPerAdmin = reader.getInt(); + } else if ("hourlyAdminCost".equals(fieldName)) { + deserializedLaborSettings.hourlyAdminCost = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedLaborSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/LicensingProgram.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/LicensingProgram.java new file mode 100644 index 000000000000..b49d0c5c711e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/LicensingProgram.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The licensing program. + */ +public final class LicensingProgram extends ExpandableStringEnum { + /** + * Static value Retail for LicensingProgram. + */ + public static final LicensingProgram RETAIL = fromString("Retail"); + + /** + * Static value Unknown for LicensingProgram. + */ + public static final LicensingProgram UNKNOWN = fromString("Unknown"); + + /** + * Static value EA for LicensingProgram. + */ + public static final LicensingProgram EA = fromString("EA"); + + /** + * Static value MCA for LicensingProgram. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/LinkageKind.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/LinkageKind.java new file mode 100644 index 000000000000..85f56cfe6113 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/LinkageKind.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Linkage kind. + */ +public final class LinkageKind extends ExpandableStringEnum { + /** + * Static value Unknown for LinkageKind. + */ + public static final LinkageKind UNKNOWN = fromString("Unknown"); + + /** + * Static value Machine for LinkageKind. + */ + public static final LinkageKind MACHINE = fromString("Machine"); + + /** + * Static value Server for LinkageKind. + */ + public static final LinkageKind SERVER = fromString("Server"); + + /** + * Static value Instance for LinkageKind. + */ + public static final LinkageKind INSTANCE = fromString("Instance"); + + /** + * Static value WebServer for LinkageKind. + */ + public static final LinkageKind WEB_SERVER = fromString("WebServer"); + + /** + * Static value WebApplication for LinkageKind. + */ + public static final LinkageKind WEB_APPLICATION = fromString("WebApplication"); + + /** + * Static value Database for LinkageKind. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/LinkageType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/LinkageType.java new file mode 100644 index 000000000000..6eb4dae986f7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/LinkageType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Linkage type. + */ +public final class LinkageType extends ExpandableStringEnum { + /** + * Static value Parent for LinkageType. + */ + public static final LinkageType PARENT = fromString("Parent"); + + /** + * Static value Source for LinkageType. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Linkages.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Linkages.java new file mode 100644 index 000000000000..7f5dd162ef49 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Linkages.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/LinuxServerLicensingSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/LinuxServerLicensingSettings.java new file mode 100644 index 000000000000..c859b3682cb2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/LinuxServerLicensingSettings.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Linux Server licensing settings. + */ +@Fluent +public final class LinuxServerLicensingSettings implements JsonSerializable { + /* + * Licence Cost. + */ + private float licenseCost; + + /** + * Creates an instance of LinuxServerLicensingSettings class. + */ + public LinuxServerLicensingSettings() { + } + + /** + * Get the licenseCost property: Licence Cost. + * + * @return the licenseCost value. + */ + public float licenseCost() { + return this.licenseCost; + } + + /** + * Set the licenseCost property: Licence Cost. + * + * @param licenseCost the licenseCost value to set. + * @return the LinuxServerLicensingSettings object itself. + */ + public LinuxServerLicensingSettings withLicenseCost(float licenseCost) { + this.licenseCost = licenseCost; + 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.writeFloatField("licenseCost", this.licenseCost); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LinuxServerLicensingSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LinuxServerLicensingSettings 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 LinuxServerLicensingSettings. + */ + public static LinuxServerLicensingSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LinuxServerLicensingSettings deserializedLinuxServerLicensingSettings = new LinuxServerLicensingSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("licenseCost".equals(fieldName)) { + deserializedLinuxServerLicensingSettings.licenseCost = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedLinuxServerLicensingSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Machine.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Machine.java deleted file mode 100644 index d9b72f7de8e4..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Machine.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.MachineInner; - -/** - * An immutable client-side representation of Machine. - */ -public interface Machine { - /** - * 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. - */ - MachineProperties 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.migration.assessment.fluent.models.MachineInner object. - * - * @return the inner object. - */ - MachineInner innerModel(); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentOptionsOutboundEdgeGroup.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentOptionsOutboundEdgeGroup.java new file mode 100644 index 000000000000..62427f74b80c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentOptionsOutboundEdgeGroup.java @@ -0,0 +1,399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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. + */ +@Fluent +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; + + /** + * Creates an instance of MachineAssessmentOptionsOutboundEdgeGroup class. + */ + public MachineAssessmentOptionsOutboundEdgeGroup() { + } + + /** + * Get the targetLocations property: Gets or sets the Azure Locations. + * + * @return the targetLocations value. + */ + public List targetLocations() { + return this.targetLocations; + } + + /** + * Set the targetLocations property: Gets or sets the Azure Locations. + * + * @param targetLocations the targetLocations value to set. + * @return the MachineAssessmentOptionsOutboundEdgeGroup object itself. + */ + public MachineAssessmentOptionsOutboundEdgeGroup withTargetLocations(List targetLocations) { + this.targetLocations = targetLocations; + return this; + } + + /** + * Get the currencies property: Gets or sets the Azure Currency. + * + * @return the currencies value. + */ + public List currencies() { + return this.currencies; + } + + /** + * Set the currencies property: Gets or sets the Azure Currency. + * + * @param currencies the currencies value to set. + * @return the MachineAssessmentOptionsOutboundEdgeGroup object itself. + */ + public MachineAssessmentOptionsOutboundEdgeGroup withCurrencies(List currencies) { + this.currencies = currencies; + return this; + } + + /** + * Get the savingsOptions property: Gets or sets the Assessment Savings Options. + * + * @return the savingsOptions value. + */ + public List savingsOptions() { + return this.savingsOptions; + } + + /** + * Set the savingsOptions property: Gets or sets the Assessment Savings Options. + * + * @param savingsOptions the savingsOptions value to set. + * @return the MachineAssessmentOptionsOutboundEdgeGroup object itself. + */ + public MachineAssessmentOptionsOutboundEdgeGroup withSavingsOptions(List savingsOptions) { + this.savingsOptions = savingsOptions; + return this; + } + + /** + * Get the licensingProgram property: Gets or sets the Licensing Program. + * + * @return the licensingProgram value. + */ + public List licensingProgram() { + return this.licensingProgram; + } + + /** + * Set the licensingProgram property: Gets or sets the Licensing Program. + * + * @param licensingProgram the licensingProgram value to set. + * @return the MachineAssessmentOptionsOutboundEdgeGroup object itself. + */ + public MachineAssessmentOptionsOutboundEdgeGroup withLicensingProgram(List licensingProgram) { + this.licensingProgram = licensingProgram; + 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 MachineAssessmentOptionsOutboundEdgeGroup object itself. + */ + public MachineAssessmentOptionsOutboundEdgeGroup withAzureVmFamilies(List azureVmFamilies) { + this.azureVmFamilies = azureVmFamilies; + return this; + } + + /** + * Get the azureVmFamilyCategories property: Gets or sets the Azure VM family categories. + * + * @return the azureVmFamilyCategories value. + */ + public List azureVmFamilyCategories() { + return this.azureVmFamilyCategories; + } + + /** + * Set the azureVmFamilyCategories property: Gets or sets the Azure VM family categories. + * + * @param azureVmFamilyCategories the azureVmFamilyCategories value to set. + * @return the MachineAssessmentOptionsOutboundEdgeGroup object itself. + */ + public MachineAssessmentOptionsOutboundEdgeGroup + withAzureVmFamilyCategories(List azureVmFamilyCategories) { + this.azureVmFamilyCategories = azureVmFamilyCategories; + return this; + } + + /** + * Get the premiumDiskSupport property: Gets or sets the premium disk support. + * + * @return the premiumDiskSupport value. + */ + public List premiumDiskSupport() { + return this.premiumDiskSupport; + } + + /** + * Set the premiumDiskSupport property: Gets or sets the premium disk support. + * + * @param premiumDiskSupport the premiumDiskSupport value to set. + * @return the MachineAssessmentOptionsOutboundEdgeGroup object itself. + */ + public MachineAssessmentOptionsOutboundEdgeGroup + withPremiumDiskSupport(List premiumDiskSupport) { + this.premiumDiskSupport = premiumDiskSupport; + return this; + } + + /** + * Get the ultraDiskSupport property: Gets or sets the premium disk support. + * + * @return the ultraDiskSupport value. + */ + public List ultraDiskSupport() { + return this.ultraDiskSupport; + } + + /** + * Set the ultraDiskSupport property: Gets or sets the premium disk support. + * + * @param ultraDiskSupport the ultraDiskSupport value to set. + * @return the MachineAssessmentOptionsOutboundEdgeGroup object itself. + */ + public MachineAssessmentOptionsOutboundEdgeGroup withUltraDiskSupport(List ultraDiskSupport) { + this.ultraDiskSupport = ultraDiskSupport; + return this; + } + + /** + * Get the azureOfferCode property: Gets or sets the Azure Offer Code. + * + * @return the azureOfferCode value. + */ + public List azureOfferCode() { + return this.azureOfferCode; + } + + /** + * Set the azureOfferCode property: Gets or sets the Azure Offer Code. + * + * @param azureOfferCode the azureOfferCode value to set. + * @return the MachineAssessmentOptionsOutboundEdgeGroup object itself. + */ + public MachineAssessmentOptionsOutboundEdgeGroup withAzureOfferCode(List azureOfferCode) { + this.azureOfferCode = azureOfferCode; + return this; + } + + /** + * 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())); + 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 { + reader.skipChildren(); + } + } + + return deserializedMachineAssessmentOptionsOutboundEdgeGroup; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentProperties.java deleted file mode 100644 index b9fc70d23eb4..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentProperties.java +++ /dev/null @@ -1,1024 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Properties of an assessment. - */ -@Fluent -public final class MachineAssessmentProperties extends AzureResourceProperties { - /* - * Gets or sets the assessment error summary. - * This is the number of - * machines affected by each type of error in this assessment. - */ - private Map assessmentErrorSummary; - - /* - * Gets or sets the aggregate ultra storage cost for all machines in the - * assessment. - */ - private Float monthlyUltraStorageCost; - - /* - * Gets the collection of cost components. - */ - private List costComponents; - - /* - * Gets or sets enterprise agreement subscription id. - */ - private String eaSubscriptionId; - - /* - * 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 Azure Reserved Instance - 1-Year, 3-Year. - */ - private AzureReservedInstance reservedInstance; - - /* - * Gets or sets the user configurable setting to display the azure hybrid use - * benefit. - */ - private AzureHybridUseBenefit azureHybridUseBenefit; - - /* - * Gets or sets the azure storage type. Premium, Standard etc. - */ - private List azureDiskTypes; - - /* - * Gets or sets the Azure VM families. - */ - private List azureVmFamilies; - - /* - * Gets the distribution of sqlInstances by support status. - */ - private Map distributionBySupportStatus; - - /* - * Gets the distribution distribution of sqlInstances by service pack insight. - */ - private Map distributionByServicePackInsight; - - /* - * Gets the distribution by os name. - */ - private Map distributionByOsName; - - /* - * Gets or sets the aggregate Compute Cost for all machines in the assessment. - */ - private Float monthlyComputeCost; - - /* - * Gets or sets the aggregate Bandwidth Cost for all machines in the assessment. - */ - private Float monthlyBandwidthCost; - - /* - * Gets or sets the aggregate Storage Cost for all machines in the assessment. - */ - private Float monthlyStorageCost; - - /* - * Gets or sets the aggregate premium storage cost for all machines in the - * assessment. - */ - private Float monthlyPremiumStorageCost; - - /* - * Gets or sets the aggregate standard SSD storage cost for all the machines in - * the assessment. - */ - private Float monthlyStandardSsdStorageCost; - - /* - * Gets or sets the Cloud suitability summary for all the machines in the - * assessment. - */ - private Map suitabilitySummary; - - /* - * Gets or sets the Number of machines part of the assessment. - */ - private Integer numberOfMachines; - - /* - * Gets or sets the duration for which the VMs are up in the on-premises - * environment. - */ - private VmUptime vmUptime; - - /* - * Gets the group type for the assessment. - */ - private GroupType groupType; - - /* - * Assessment type of the assessment. - */ - private AssessmentType assessmentType; - - /* - * Azure Location or Azure region where to which the machines will be migrated. - */ - private String azureLocation; - - /* - * Azure Offer Code. - */ - private AzureOfferCode azureOfferCode; - - /* - * Currency in which prices should be reported. - */ - private AzureCurrency currency; - - /* - * Percentage of buffer that user wants on performance metrics when recommending - * Azure sizes. - */ - private Float scalingFactor; - - /* - * 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; - - /* - * User configurable setting to display the Stage of Assessment. - */ - private AssessmentStage stage; - - /* - * Custom discount percentage. - */ - private Float discountPercentage; - - /* - * Assessment sizing criterion. - */ - private AssessmentSizingCriterion sizingCriterion; - - /* - * Confidence Rating in Percentage. - */ - private Float 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; - - /* - * Schema version. - */ - private String schemaVersion; - - /** - * Creates an instance of MachineAssessmentProperties class. - */ - public MachineAssessmentProperties() { - } - - /** - * Get the assessmentErrorSummary property: Gets or sets the assessment error summary. - * This is the number of - * machines affected by each type of error in this assessment. - * - * @return the assessmentErrorSummary value. - */ - public Map assessmentErrorSummary() { - return this.assessmentErrorSummary; - } - - /** - * Get the monthlyUltraStorageCost property: Gets or sets the aggregate ultra storage cost for all machines in the - * assessment. - * - * @return the monthlyUltraStorageCost value. - */ - public Float monthlyUltraStorageCost() { - return this.monthlyUltraStorageCost; - } - - /** - * Get the costComponents property: Gets the collection of cost components. - * - * @return the costComponents value. - */ - public List costComponents() { - return this.costComponents; - } - - /** - * Get the eaSubscriptionId property: Gets or sets enterprise agreement subscription id. - * - * @return the eaSubscriptionId value. - */ - public String eaSubscriptionId() { - return this.eaSubscriptionId; - } - - /** - * Set the eaSubscriptionId property: Gets or sets enterprise agreement subscription id. - * - * @param eaSubscriptionId the eaSubscriptionId value to set. - * @return the MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties withEaSubscriptionId(String eaSubscriptionId) { - this.eaSubscriptionId = eaSubscriptionId; - 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 MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties 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 MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties withAzureStorageRedundancy(AzureStorageRedundancy azureStorageRedundancy) { - this.azureStorageRedundancy = azureStorageRedundancy; - return this; - } - - /** - * Get the reservedInstance property: Gets or sets the Azure Reserved Instance - 1-Year, 3-Year. - * - * @return the reservedInstance value. - */ - public AzureReservedInstance reservedInstance() { - return this.reservedInstance; - } - - /** - * Set the reservedInstance property: Gets or sets the Azure Reserved Instance - 1-Year, 3-Year. - * - * @param reservedInstance the reservedInstance value to set. - * @return the MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties withReservedInstance(AzureReservedInstance reservedInstance) { - this.reservedInstance = reservedInstance; - 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 MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties withAzureHybridUseBenefit(AzureHybridUseBenefit azureHybridUseBenefit) { - this.azureHybridUseBenefit = azureHybridUseBenefit; - return this; - } - - /** - * Get the azureDiskTypes property: Gets or sets the azure storage type. Premium, Standard etc. - * - * @return the azureDiskTypes value. - */ - public List azureDiskTypes() { - return this.azureDiskTypes; - } - - /** - * Set the azureDiskTypes property: Gets or sets the azure storage type. Premium, Standard etc. - * - * @param azureDiskTypes the azureDiskTypes value to set. - * @return the MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties withAzureDiskTypes(List azureDiskTypes) { - this.azureDiskTypes = azureDiskTypes; - 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 MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties withAzureVmFamilies(List azureVmFamilies) { - this.azureVmFamilies = azureVmFamilies; - return this; - } - - /** - * Get the distributionBySupportStatus property: Gets the distribution of sqlInstances by support status. - * - * @return the distributionBySupportStatus value. - */ - public Map distributionBySupportStatus() { - return this.distributionBySupportStatus; - } - - /** - * Get the distributionByServicePackInsight property: Gets the distribution distribution of sqlInstances by service - * pack insight. - * - * @return the distributionByServicePackInsight value. - */ - public Map distributionByServicePackInsight() { - return this.distributionByServicePackInsight; - } - - /** - * Get the distributionByOsName property: Gets the distribution by os name. - * - * @return the distributionByOsName value. - */ - public Map distributionByOsName() { - return this.distributionByOsName; - } - - /** - * Get the monthlyComputeCost property: Gets or sets the aggregate Compute Cost for all machines in the assessment. - * - * @return the monthlyComputeCost value. - */ - public Float monthlyComputeCost() { - return this.monthlyComputeCost; - } - - /** - * Get the monthlyBandwidthCost property: Gets or sets the aggregate Bandwidth Cost for all machines in the - * assessment. - * - * @return the monthlyBandwidthCost value. - */ - public Float monthlyBandwidthCost() { - return this.monthlyBandwidthCost; - } - - /** - * Get the monthlyStorageCost property: Gets or sets the aggregate Storage Cost for all machines in the assessment. - * - * @return the monthlyStorageCost value. - */ - public Float monthlyStorageCost() { - return this.monthlyStorageCost; - } - - /** - * Get the monthlyPremiumStorageCost property: Gets or sets the aggregate premium storage cost for all machines in - * the - * assessment. - * - * @return the monthlyPremiumStorageCost value. - */ - public Float monthlyPremiumStorageCost() { - return this.monthlyPremiumStorageCost; - } - - /** - * Get the monthlyStandardSsdStorageCost property: Gets or sets the aggregate standard SSD storage cost for all the - * machines in - * the assessment. - * - * @return the monthlyStandardSsdStorageCost value. - */ - public Float monthlyStandardSsdStorageCost() { - return this.monthlyStandardSsdStorageCost; - } - - /** - * Get the suitabilitySummary property: Gets or sets the Cloud suitability summary for all the machines in the - * assessment. - * - * @return the suitabilitySummary value. - */ - public Map suitabilitySummary() { - return this.suitabilitySummary; - } - - /** - * Get the numberOfMachines property: Gets or sets the Number of machines part of the assessment. - * - * @return the numberOfMachines value. - */ - public Integer numberOfMachines() { - return this.numberOfMachines; - } - - /** - * 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 MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties withVmUptime(VmUptime vmUptime) { - this.vmUptime = vmUptime; - return this; - } - - /** - * Get the groupType property: Gets the group type for the assessment. - * - * @return the groupType value. - */ - public GroupType groupType() { - return this.groupType; - } - - /** - * Get the assessmentType property: Assessment type of the assessment. - * - * @return the assessmentType value. - */ - public AssessmentType assessmentType() { - return this.assessmentType; - } - - /** - * 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 MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties withAzureLocation(String azureLocation) { - this.azureLocation = azureLocation; - return this; - } - - /** - * Get the azureOfferCode property: Azure Offer Code. - * - * @return the azureOfferCode value. - */ - public AzureOfferCode azureOfferCode() { - return this.azureOfferCode; - } - - /** - * Set the azureOfferCode property: Azure Offer Code. - * - * @param azureOfferCode the azureOfferCode value to set. - * @return the MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties withAzureOfferCode(AzureOfferCode azureOfferCode) { - this.azureOfferCode = azureOfferCode; - 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 MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties 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 Float 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 MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties withScalingFactor(Float scalingFactor) { - this.scalingFactor = scalingFactor; - return this; - } - - /** - * 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 MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties 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 MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties 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 MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties 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 MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties withPerfDataEndTime(OffsetDateTime perfDataEndTime) { - this.perfDataEndTime = perfDataEndTime; - return this; - } - - /** - * Get the stage property: User configurable setting to display the Stage of Assessment. - * - * @return the stage value. - */ - public AssessmentStage stage() { - return this.stage; - } - - /** - * Get the discountPercentage property: Custom discount percentage. - * - * @return the discountPercentage value. - */ - public Float discountPercentage() { - return this.discountPercentage; - } - - /** - * Set the discountPercentage property: Custom discount percentage. - * - * @param discountPercentage the discountPercentage value to set. - * @return the MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties withDiscountPercentage(Float 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 MachineAssessmentProperties object itself. - */ - public MachineAssessmentProperties withSizingCriterion(AssessmentSizingCriterion sizingCriterion) { - this.sizingCriterion = sizingCriterion; - return this; - } - - /** - * Get the confidenceRatingInPercentage property: Confidence Rating in Percentage. - * - * @return the confidenceRatingInPercentage value. - */ - public Float 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; - } - - /** - * Get the schemaVersion property: Schema version. - * - * @return the schemaVersion value. - */ - public String schemaVersion() { - return this.schemaVersion; - } - - /** - * {@inheritDoc} - */ - @Override - public MachineAssessmentProperties withProvisioningState(ProvisioningState provisioningState) { - super.withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (costComponents() != null) { - costComponents().forEach(e -> e.validate()); - } - if (vmUptime() != null) { - vmUptime().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provisioningState", - provisioningState() == null ? null : provisioningState().toString()); - jsonWriter.writeStringField("eaSubscriptionId", this.eaSubscriptionId); - jsonWriter.writeStringField("azurePricingTier", - this.azurePricingTier == null ? null : this.azurePricingTier.toString()); - jsonWriter.writeStringField("azureStorageRedundancy", - this.azureStorageRedundancy == null ? null : this.azureStorageRedundancy.toString()); - jsonWriter.writeStringField("reservedInstance", - this.reservedInstance == null ? null : this.reservedInstance.toString()); - jsonWriter.writeStringField("azureHybridUseBenefit", - this.azureHybridUseBenefit == null ? null : this.azureHybridUseBenefit.toString()); - jsonWriter.writeArrayField("azureDiskTypes", this.azureDiskTypes, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("azureVmFamilies", this.azureVmFamilies, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeJsonField("vmUptime", this.vmUptime); - jsonWriter.writeStringField("azureLocation", this.azureLocation); - jsonWriter.writeStringField("azureOfferCode", - this.azureOfferCode == null ? null : this.azureOfferCode.toString()); - jsonWriter.writeStringField("currency", this.currency == null ? null : this.currency.toString()); - jsonWriter.writeNumberField("scalingFactor", this.scalingFactor); - 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)); - jsonWriter.writeNumberField("discountPercentage", this.discountPercentage); - jsonWriter.writeStringField("sizingCriterion", - this.sizingCriterion == null ? null : this.sizingCriterion.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MachineAssessmentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MachineAssessmentProperties 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 MachineAssessmentProperties. - */ - public static MachineAssessmentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MachineAssessmentProperties deserializedMachineAssessmentProperties = new MachineAssessmentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedMachineAssessmentProperties - .withProvisioningState(ProvisioningState.fromString(reader.getString())); - } else if ("assessmentErrorSummary".equals(fieldName)) { - Map assessmentErrorSummary = reader.readMap(reader1 -> reader1.getInt()); - deserializedMachineAssessmentProperties.assessmentErrorSummary = assessmentErrorSummary; - } else if ("monthlyUltraStorageCost".equals(fieldName)) { - deserializedMachineAssessmentProperties.monthlyUltraStorageCost - = reader.getNullable(JsonReader::getFloat); - } else if ("costComponents".equals(fieldName)) { - List costComponents = reader.readArray(reader1 -> CostComponent.fromJson(reader1)); - deserializedMachineAssessmentProperties.costComponents = costComponents; - } else if ("eaSubscriptionId".equals(fieldName)) { - deserializedMachineAssessmentProperties.eaSubscriptionId = reader.getString(); - } else if ("azurePricingTier".equals(fieldName)) { - deserializedMachineAssessmentProperties.azurePricingTier - = AzurePricingTier.fromString(reader.getString()); - } else if ("azureStorageRedundancy".equals(fieldName)) { - deserializedMachineAssessmentProperties.azureStorageRedundancy - = AzureStorageRedundancy.fromString(reader.getString()); - } else if ("reservedInstance".equals(fieldName)) { - deserializedMachineAssessmentProperties.reservedInstance - = AzureReservedInstance.fromString(reader.getString()); - } else if ("azureHybridUseBenefit".equals(fieldName)) { - deserializedMachineAssessmentProperties.azureHybridUseBenefit - = AzureHybridUseBenefit.fromString(reader.getString()); - } else if ("azureDiskTypes".equals(fieldName)) { - List azureDiskTypes - = reader.readArray(reader1 -> AzureDiskType.fromString(reader1.getString())); - deserializedMachineAssessmentProperties.azureDiskTypes = azureDiskTypes; - } else if ("azureVmFamilies".equals(fieldName)) { - List azureVmFamilies - = reader.readArray(reader1 -> AzureVmFamily.fromString(reader1.getString())); - deserializedMachineAssessmentProperties.azureVmFamilies = azureVmFamilies; - } else if ("distributionBySupportStatus".equals(fieldName)) { - Map distributionBySupportStatus = reader.readMap(reader1 -> reader1.getInt()); - deserializedMachineAssessmentProperties.distributionBySupportStatus = distributionBySupportStatus; - } else if ("distributionByServicePackInsight".equals(fieldName)) { - Map distributionByServicePackInsight = reader.readMap(reader1 -> reader1.getInt()); - deserializedMachineAssessmentProperties.distributionByServicePackInsight - = distributionByServicePackInsight; - } else if ("distributionByOsName".equals(fieldName)) { - Map distributionByOsName = reader.readMap(reader1 -> reader1.getInt()); - deserializedMachineAssessmentProperties.distributionByOsName = distributionByOsName; - } else if ("monthlyComputeCost".equals(fieldName)) { - deserializedMachineAssessmentProperties.monthlyComputeCost - = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyBandwidthCost".equals(fieldName)) { - deserializedMachineAssessmentProperties.monthlyBandwidthCost - = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyStorageCost".equals(fieldName)) { - deserializedMachineAssessmentProperties.monthlyStorageCost - = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyPremiumStorageCost".equals(fieldName)) { - deserializedMachineAssessmentProperties.monthlyPremiumStorageCost - = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyStandardSsdStorageCost".equals(fieldName)) { - deserializedMachineAssessmentProperties.monthlyStandardSsdStorageCost - = reader.getNullable(JsonReader::getFloat); - } else if ("suitabilitySummary".equals(fieldName)) { - Map suitabilitySummary = reader.readMap(reader1 -> reader1.getInt()); - deserializedMachineAssessmentProperties.suitabilitySummary = suitabilitySummary; - } else if ("numberOfMachines".equals(fieldName)) { - deserializedMachineAssessmentProperties.numberOfMachines = reader.getNullable(JsonReader::getInt); - } else if ("vmUptime".equals(fieldName)) { - deserializedMachineAssessmentProperties.vmUptime = VmUptime.fromJson(reader); - } else if ("groupType".equals(fieldName)) { - deserializedMachineAssessmentProperties.groupType = GroupType.fromString(reader.getString()); - } else if ("assessmentType".equals(fieldName)) { - deserializedMachineAssessmentProperties.assessmentType - = AssessmentType.fromString(reader.getString()); - } else if ("azureLocation".equals(fieldName)) { - deserializedMachineAssessmentProperties.azureLocation = reader.getString(); - } else if ("azureOfferCode".equals(fieldName)) { - deserializedMachineAssessmentProperties.azureOfferCode - = AzureOfferCode.fromString(reader.getString()); - } else if ("currency".equals(fieldName)) { - deserializedMachineAssessmentProperties.currency = AzureCurrency.fromString(reader.getString()); - } else if ("scalingFactor".equals(fieldName)) { - deserializedMachineAssessmentProperties.scalingFactor = reader.getNullable(JsonReader::getFloat); - } else if ("percentile".equals(fieldName)) { - deserializedMachineAssessmentProperties.percentile = Percentile.fromString(reader.getString()); - } else if ("timeRange".equals(fieldName)) { - deserializedMachineAssessmentProperties.timeRange = TimeRange.fromString(reader.getString()); - } else if ("perfDataStartTime".equals(fieldName)) { - deserializedMachineAssessmentProperties.perfDataStartTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("perfDataEndTime".equals(fieldName)) { - deserializedMachineAssessmentProperties.perfDataEndTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("stage".equals(fieldName)) { - deserializedMachineAssessmentProperties.stage = AssessmentStage.fromString(reader.getString()); - } else if ("discountPercentage".equals(fieldName)) { - deserializedMachineAssessmentProperties.discountPercentage - = reader.getNullable(JsonReader::getFloat); - } else if ("sizingCriterion".equals(fieldName)) { - deserializedMachineAssessmentProperties.sizingCriterion - = AssessmentSizingCriterion.fromString(reader.getString()); - } else if ("confidenceRatingInPercentage".equals(fieldName)) { - deserializedMachineAssessmentProperties.confidenceRatingInPercentage - = reader.getNullable(JsonReader::getFloat); - } else if ("pricesTimestamp".equals(fieldName)) { - deserializedMachineAssessmentProperties.pricesTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("createdTimestamp".equals(fieldName)) { - deserializedMachineAssessmentProperties.createdTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("updatedTimestamp".equals(fieldName)) { - deserializedMachineAssessmentProperties.updatedTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("status".equals(fieldName)) { - deserializedMachineAssessmentProperties.status = AssessmentStatus.fromString(reader.getString()); - } else if ("schemaVersion".equals(fieldName)) { - deserializedMachineAssessmentProperties.schemaVersion = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedMachineAssessmentProperties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentSettings.java new file mode 100644 index 000000000000..9c3394511431 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentSettings.java @@ -0,0 +1,593 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 Float scalingFactor; + + /* + * Custom discount percentage. + */ + private Float 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; + + /** + * 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 Float 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(Float scalingFactor) { + this.scalingFactor = scalingFactor; + return this; + } + + /** + * Get the discountPercentage property: Custom discount percentage. + * + * @return the discountPercentage value. + */ + public Float 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(Float 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; + } + + /** + * 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); + 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::getFloat); + } else if ("discountPercentage".equals(fieldName)) { + deserializedMachineAssessmentSettings.discountPercentage = reader.getNullable(JsonReader::getFloat); + } 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 { + reader.skipChildren(); + } + } + + return deserializedMachineAssessmentSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2.java new file mode 100644 index 000000000000..2ba6815ccc44 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.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.migration.assessment.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 the URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(Object 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 the URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(Object body, Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2ListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2ListResult.java new file mode 100644 index 000000000000..9f9247d03c15 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2ListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.MachineAssessmentV2Inner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a MachineAssessmentV2 list operation. + */ +@Fluent +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. + */ + public MachineAssessmentV2ListResult() { + } + + /** + * Get the value property: The MachineAssessmentV2 items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The MachineAssessmentV2 items on this page. + * + * @param value the value value to set. + * @return the MachineAssessmentV2ListResult object itself. + */ + public MachineAssessmentV2ListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the MachineAssessmentV2ListResult object itself. + */ + public MachineAssessmentV2ListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2Properties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2Properties.java new file mode 100644 index 000000000000..1487df2faa05 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2Properties.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2Summary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2Summary.java new file mode 100644 index 000000000000..a701494e3d31 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2Summary.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.MachineAssessmentV2SummaryInner + * object. + * + * @return the inner object. + */ + MachineAssessmentV2SummaryInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2SummaryListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2SummaryListResult.java new file mode 100644 index 000000000000..49f7a64b231c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2SummaryListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.MachineAssessmentV2SummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a MachineAssessmentV2Summary list operation. + */ +@Fluent +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. + */ + public MachineAssessmentV2SummaryListResult() { + } + + /** + * Get the value property: The MachineAssessmentV2Summary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The MachineAssessmentV2Summary items on this page. + * + * @param value the value value to set. + * @return the MachineAssessmentV2SummaryListResult object itself. + */ + public MachineAssessmentV2SummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the MachineAssessmentV2SummaryListResult object itself. + */ + public MachineAssessmentV2SummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2SummaryOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2SummaryOperations.java new file mode 100644 index 000000000000..4996d648082c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentV2SummaryOperations.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 { + /** + * 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); + + /** + * 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); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentsV2Operations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentsV2Operations.java new file mode 100644 index 000000000000..7ea0fafcd42d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineAssessmentsV2Operations.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 { + /** + * 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); + + /** + * 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); + + /** + * 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 the URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object 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 URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineBootType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineBootType.java index 53c1015b57d7..617d7310199d 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineBootType.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineBootType.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for MachineBootType. + * Machine Boot Type. */ public final class MachineBootType extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineGraphAssessmentOptions.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineGraphAssessmentOptions.java new file mode 100644 index 000000000000..cf295158ccd3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineGraphAssessmentOptions.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.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.migration.assessment.fluent.models.MachineGraphAssessmentOptionsInner + * object. + * + * @return the inner object. + */ + MachineGraphAssessmentOptionsInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineGraphAssessmentOptionsListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineGraphAssessmentOptionsListResult.java new file mode 100644 index 000000000000..a4d51cefeb4e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineGraphAssessmentOptionsListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.MachineGraphAssessmentOptionsInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a MachineGraphAssessmentOptions list operation. + */ +@Fluent +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. + */ + public MachineGraphAssessmentOptionsListResult() { + } + + /** + * Get the value property: The MachineGraphAssessmentOptions items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The MachineGraphAssessmentOptions items on this page. + * + * @param value the value value to set. + * @return the MachineGraphAssessmentOptionsListResult object itself. + */ + public MachineGraphAssessmentOptionsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the MachineGraphAssessmentOptionsListResult object itself. + */ + public MachineGraphAssessmentOptionsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineGraphAssessmentOptionsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineGraphAssessmentOptionsOperations.java new file mode 100644 index 000000000000..19febb5d3631 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineGraphAssessmentOptionsOperations.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 { + /** + * 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); + + /** + * 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); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineGraphAssessmentOptionsProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineGraphAssessmentOptionsProperties.java new file mode 100644 index 000000000000..7cd60bb5fc5f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineGraphAssessmentOptionsProperties.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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. + */ +@Fluent +public final class MachineGraphAssessmentOptionsProperties + implements JsonSerializable { + /* + * Gets or sets the edges. + */ + private Map edges; + + /** + * Creates an instance of MachineGraphAssessmentOptionsProperties class. + */ + public MachineGraphAssessmentOptionsProperties() { + } + + /** + * Get the edges property: Gets or sets the edges. + * + * @return the edges value. + */ + public Map edges() { + return this.edges; + } + + /** + * Set the edges property: Gets or sets the edges. + * + * @param edges the edges value to set. + * @return the MachineGraphAssessmentOptionsProperties object itself. + */ + public MachineGraphAssessmentOptionsProperties + withEdges(Map edges) { + this.edges = edges; + return this; + } + + /** + * 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineListResult.java deleted file mode 100644 index b4b0e840a30f..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineListResult.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -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.migration.assessment.fluent.models.MachineInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a Machine list operation. - */ -@Fluent -public final class MachineListResult implements JsonSerializable { - /* - * The Machine items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of MachineListResult class. - */ - public MachineListResult() { - } - - /** - * Get the value property: The Machine items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The Machine items on this page. - * - * @param value the value value to set. - * @return the MachineListResult object itself. - */ - public MachineListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the MachineListResult object itself. - */ - public MachineListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * 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 MachineListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(MachineListResult.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 MachineListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MachineListResult 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 MachineListResult. - */ - public static MachineListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MachineListResult deserializedMachineListResult = new MachineListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> MachineInner.fromJson(reader1)); - deserializedMachineListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedMachineListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedMachineListResult; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineProperties.java deleted file mode 100644 index c42cfabd2852..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachineProperties.java +++ /dev/null @@ -1,456 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; -import java.util.Map; - -/** - * Properties of a machine. - */ -@Immutable -public final class MachineProperties implements JsonSerializable { - /* - * Gets or sets workload summary. - */ - private WorkloadSummary workloadSummary; - - /* - * List of errors for this machine. - */ - private List errors; - - /* - * Gets Processor details of the host. - */ - private ProcessorInfo hostProcessor; - - /* - * Gets the product support status related details. - */ - private ProductSupportStatus productSupportStatus; - - /* - * Site id of machine discovered in private data center. - */ - private String discoveryMachineArmId; - - /* - * The data center management server ARM Id for the machine. - */ - private String datacenterManagementServerArmId; - - /* - * The data center management server name for the machine. - */ - private String datacenterManagementServerName; - - /* - * Boot type of machine discovered in private data center. - */ - private MachineBootType bootType; - - /* - * Display Name of the Machine. - */ - private String displayName; - - /* - * Megabytes of memory found allocated for the machine in private data center. - */ - private Float megabytesOfMemory; - - /* - * Number of CPU cores found on the machine. - */ - private Integer numberOfCores; - - /* - * 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; - - /* - * Description for the machine. - */ - private String description; - - /* - * When was machine first created. - */ - private OffsetDateTime createdTimestamp; - - /* - * Disks attached to the machine discovered in private data center. - */ - private Map disks; - - /* - * Gets the References to the groups that this machine is member of. - */ - private List groups; - - /* - * Network adapters attached to the machine discovered in private data center. - */ - private Map networkAdapters; - - /* - * SQL instances discovered on the machine. - */ - private List sqlInstances; - - /* - * Web applications discovered on the machine. - */ - private List webApplications; - - /* - * When was machine last updated. - */ - private OffsetDateTime updatedTimestamp; - - /** - * Creates an instance of MachineProperties class. - */ - public MachineProperties() { - } - - /** - * Get the workloadSummary property: Gets or sets workload summary. - * - * @return the workloadSummary value. - */ - public WorkloadSummary workloadSummary() { - return this.workloadSummary; - } - - /** - * Get the errors property: List of errors for this machine. - * - * @return the errors value. - */ - public List errors() { - return this.errors; - } - - /** - * Get the hostProcessor property: Gets Processor details of the host. - * - * @return the hostProcessor value. - */ - public ProcessorInfo hostProcessor() { - return this.hostProcessor; - } - - /** - * Get the productSupportStatus property: Gets the product support status related details. - * - * @return the productSupportStatus value. - */ - public ProductSupportStatus productSupportStatus() { - return this.productSupportStatus; - } - - /** - * Get the discoveryMachineArmId property: Site id of machine discovered in private data center. - * - * @return the discoveryMachineArmId value. - */ - public String discoveryMachineArmId() { - return this.discoveryMachineArmId; - } - - /** - * Get the datacenterManagementServerArmId property: The data center management server ARM Id for the machine. - * - * @return the datacenterManagementServerArmId value. - */ - public String datacenterManagementServerArmId() { - return this.datacenterManagementServerArmId; - } - - /** - * Get the datacenterManagementServerName property: The data center management server name for the machine. - * - * @return the datacenterManagementServerName value. - */ - public String datacenterManagementServerName() { - return this.datacenterManagementServerName; - } - - /** - * 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 displayName property: Display Name of the Machine. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the megabytesOfMemory property: Megabytes of memory found allocated for the machine in private data center. - * - * @return the megabytesOfMemory value. - */ - public Float 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 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 description property: Description for the machine. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the createdTimestamp property: When was machine first created. - * - * @return the createdTimestamp value. - */ - public OffsetDateTime createdTimestamp() { - return this.createdTimestamp; - } - - /** - * Get the disks property: Disks attached to the machine discovered in private data center. - * - * @return the disks value. - */ - public Map disks() { - return this.disks; - } - - /** - * Get the groups property: Gets the References to the groups that this machine is member of. - * - * @return the groups value. - */ - public List groups() { - return this.groups; - } - - /** - * Get the networkAdapters property: Network adapters attached to the machine discovered in private data center. - * - * @return the networkAdapters value. - */ - public Map networkAdapters() { - return this.networkAdapters; - } - - /** - * Get the sqlInstances property: SQL instances discovered on the machine. - * - * @return the sqlInstances value. - */ - public List sqlInstances() { - return this.sqlInstances; - } - - /** - * Get the webApplications property: Web applications discovered on the machine. - * - * @return the webApplications value. - */ - public List webApplications() { - return this.webApplications; - } - - /** - * 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 (workloadSummary() != null) { - workloadSummary().validate(); - } - if (errors() != null) { - errors().forEach(e -> e.validate()); - } - if (hostProcessor() != null) { - hostProcessor().validate(); - } - if (productSupportStatus() != null) { - productSupportStatus().validate(); - } - if (disks() != null) { - disks().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - if (networkAdapters() != null) { - networkAdapters().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MachineProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MachineProperties 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 MachineProperties. - */ - public static MachineProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MachineProperties deserializedMachineProperties = new MachineProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("workloadSummary".equals(fieldName)) { - deserializedMachineProperties.workloadSummary = WorkloadSummary.fromJson(reader); - } else if ("errors".equals(fieldName)) { - List errors = reader.readArray(reader1 -> Error.fromJson(reader1)); - deserializedMachineProperties.errors = errors; - } else if ("hostProcessor".equals(fieldName)) { - deserializedMachineProperties.hostProcessor = ProcessorInfo.fromJson(reader); - } else if ("productSupportStatus".equals(fieldName)) { - deserializedMachineProperties.productSupportStatus = ProductSupportStatus.fromJson(reader); - } else if ("discoveryMachineArmId".equals(fieldName)) { - deserializedMachineProperties.discoveryMachineArmId = reader.getString(); - } else if ("datacenterManagementServerArmId".equals(fieldName)) { - deserializedMachineProperties.datacenterManagementServerArmId = reader.getString(); - } else if ("datacenterManagementServerName".equals(fieldName)) { - deserializedMachineProperties.datacenterManagementServerName = reader.getString(); - } else if ("bootType".equals(fieldName)) { - deserializedMachineProperties.bootType = MachineBootType.fromString(reader.getString()); - } else if ("displayName".equals(fieldName)) { - deserializedMachineProperties.displayName = reader.getString(); - } else if ("megabytesOfMemory".equals(fieldName)) { - deserializedMachineProperties.megabytesOfMemory = reader.getNullable(JsonReader::getFloat); - } else if ("numberOfCores".equals(fieldName)) { - deserializedMachineProperties.numberOfCores = reader.getNullable(JsonReader::getInt); - } else if ("operatingSystemType".equals(fieldName)) { - deserializedMachineProperties.operatingSystemType = reader.getString(); - } else if ("operatingSystemName".equals(fieldName)) { - deserializedMachineProperties.operatingSystemName = reader.getString(); - } else if ("operatingSystemVersion".equals(fieldName)) { - deserializedMachineProperties.operatingSystemVersion = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedMachineProperties.description = reader.getString(); - } else if ("createdTimestamp".equals(fieldName)) { - deserializedMachineProperties.createdTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("disks".equals(fieldName)) { - Map disks = reader.readMap(reader1 -> Disk.fromJson(reader1)); - deserializedMachineProperties.disks = disks; - } else if ("groups".equals(fieldName)) { - List groups = reader.readArray(reader1 -> reader1.getString()); - deserializedMachineProperties.groups = groups; - } else if ("networkAdapters".equals(fieldName)) { - Map networkAdapters - = reader.readMap(reader1 -> NetworkAdapter.fromJson(reader1)); - deserializedMachineProperties.networkAdapters = networkAdapters; - } else if ("sqlInstances".equals(fieldName)) { - List sqlInstances = reader.readArray(reader1 -> reader1.getString()); - deserializedMachineProperties.sqlInstances = sqlInstances; - } else if ("webApplications".equals(fieldName)) { - List webApplications = reader.readArray(reader1 -> reader1.getString()); - deserializedMachineProperties.webApplications = webApplications; - } else if ("updatedTimestamp".equals(fieldName)) { - deserializedMachineProperties.updatedTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedMachineProperties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachinesOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachinesOperations.java deleted file mode 100644 index 9df82549ae98..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MachinesOperations.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 MachinesOperations. - */ -public interface MachinesOperations { - /** - * List Machine 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 Machine list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); - - /** - * List Machine resources by AssessmentProject. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project 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 Machine list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, String filter, - Integer pageSize, String continuationToken, Integer totalRecordCount, Context context); - - /** - * Get a Machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param machineName Assessible 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 Machine along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String projectName, String machineName, - Context context); - - /** - * Get a Machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param machineName Assessible 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 Machine. - */ - Machine get(String resourceGroupName, String projectName, String machineName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementCostComponent.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementCostComponent.java new file mode 100644 index 000000000000..32ddd63837ec --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementCostComponent.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Management Cost Component. + */ +@Fluent +public final class ManagementCostComponent implements JsonSerializable { + /* + * Name of Management Cost Component. + */ + private ManagementCostComponentName name; + + /* + * Cost of Management Component. + */ + private Float value; + + /** + * Creates an instance of ManagementCostComponent class. + */ + public ManagementCostComponent() { + } + + /** + * Get the name property: Name of Management Cost Component. + * + * @return the name value. + */ + public ManagementCostComponentName name() { + return this.name; + } + + /** + * Set the name property: Name of Management Cost Component. + * + * @param name the name value to set. + * @return the ManagementCostComponent object itself. + */ + public ManagementCostComponent withName(ManagementCostComponentName name) { + this.name = name; + return this; + } + + /** + * Get the value property: Cost of Management Component. + * + * @return the value value. + */ + public Float value() { + return this.value; + } + + /** + * Set the value property: Cost of Management Component. + * + * @param value the value value to set. + * @return the ManagementCostComponent object itself. + */ + public ManagementCostComponent withValue(Float value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model ManagementCostComponent")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementCostComponent.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeNumberField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementCostComponent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementCostComponent 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 ManagementCostComponent. + */ + public static ManagementCostComponent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementCostComponent deserializedManagementCostComponent = new ManagementCostComponent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedManagementCostComponent.name + = ManagementCostComponentName.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedManagementCostComponent.value = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementCostComponent; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementCostComponentName.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementCostComponentName.java new file mode 100644 index 000000000000..f29a29c89abc --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementCostComponentName.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Management Cost Component Names. + */ +public final class ManagementCostComponentName extends ExpandableStringEnum { + /** + * Static value Unknown for ManagementCostComponentName. + */ + public static final ManagementCostComponentName UNKNOWN = fromString("Unknown"); + + /** + * Static value SystemCenterLicenseCost for ManagementCostComponentName. + */ + public static final ManagementCostComponentName SYSTEM_CENTER_LICENSE_COST = fromString("SystemCenterLicenseCost"); + + /** + * Static value VSphereManagementCost for ManagementCostComponentName. + */ + public static final ManagementCostComponentName VSPHERE_MANAGEMENT_COST = fromString("VSphereManagementCost"); + + /** + * Static value ThirdPartyManagementCost for ManagementCostComponentName. + */ + public static final ManagementCostComponentName THIRD_PARTY_MANAGEMENT_COST + = fromString("ThirdPartyManagementCost"); + + /** + * Static value OtherMonitoringCost for ManagementCostComponentName. + */ + public static final ManagementCostComponentName OTHER_MONITORING_COST = fromString("OtherMonitoringCost"); + + /** + * Static value OtherDataProtectionCost for ManagementCostComponentName. + */ + public static final ManagementCostComponentName OTHER_DATA_PROTECTION_COST = fromString("OtherDataProtectionCost"); + + /** + * Static value OtherPatchingCost for ManagementCostComponentName. + */ + public static final ManagementCostComponentName OTHER_PATCHING_COST = fromString("OtherPatchingCost"); + + /** + * Static value AzureMonitoringCost for ManagementCostComponentName. + */ + public static final ManagementCostComponentName AZURE_MONITORING_COST = fromString("AzureMonitoringCost"); + + /** + * Static value AzurePatchingCost for ManagementCostComponentName. + */ + public static final ManagementCostComponentName AZURE_PATCHING_COST = fromString("AzurePatchingCost"); + + /** + * Static value AzureDataProtectionCost for ManagementCostComponentName. + */ + public static final ManagementCostComponentName AZURE_DATA_PROTECTION_COST = fromString("AzureDataProtectionCost"); + + /** + * Static value AzureArcMonitoringCost for ManagementCostComponentName. + */ + public static final ManagementCostComponentName AZURE_ARC_MONITORING_COST = fromString("AzureArcMonitoringCost"); + + /** + * Static value AzureArcPatchingCost for ManagementCostComponentName. + */ + public static final ManagementCostComponentName AZURE_ARC_PATCHING_COST = fromString("AzureArcPatchingCost"); + + /** + * Creates a new instance of ManagementCostComponentName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagementCostComponentName() { + } + + /** + * Creates or finds a ManagementCostComponentName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagementCostComponentName. + */ + public static ManagementCostComponentName fromString(String name) { + return fromString(name, ManagementCostComponentName.class); + } + + /** + * Gets known ManagementCostComponentName values. + * + * @return known ManagementCostComponentName values. + */ + public static Collection values() { + return values(ManagementCostComponentName.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementCostDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementCostDetails.java new file mode 100644 index 000000000000..9f54435d72b2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementCostDetails.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 Cost Details. + */ +@Immutable +public final class ManagementCostDetails implements JsonSerializable { + /* + * Management Cost. + */ + private Float managementCost; + + /* + * Management Cost Components. + */ + private List managementCostComponents; + + /** + * Creates an instance of ManagementCostDetails class. + */ + public ManagementCostDetails() { + } + + /** + * Get the managementCost property: Management Cost. + * + * @return the managementCost value. + */ + public Float managementCost() { + return this.managementCost; + } + + /** + * Get the managementCostComponents property: Management Cost Components. + * + * @return the managementCostComponents value. + */ + public List managementCostComponents() { + return this.managementCostComponents; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managementCostComponents() != null) { + managementCostComponents().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementCostDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementCostDetails 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 ManagementCostDetails. + */ + public static ManagementCostDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementCostDetails deserializedManagementCostDetails = new ManagementCostDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("managementCost".equals(fieldName)) { + deserializedManagementCostDetails.managementCost = reader.getNullable(JsonReader::getFloat); + } else if ("managementCostComponents".equals(fieldName)) { + List managementCostComponents + = reader.readArray(reader1 -> ManagementCostComponent.fromJson(reader1)); + deserializedManagementCostDetails.managementCostComponents = managementCostComponents; + } else { + reader.skipChildren(); + } + } + + return deserializedManagementCostDetails; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementDetails.java new file mode 100644 index 000000000000..6e908d654334 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementDetails.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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 -> ManagementDetailsReadinessSummaryItem.fromJson(reader1)); + deserializedManagementDetails.readinessSummary = readinessSummary; + } else { + reader.skipChildren(); + } + } + + return deserializedManagementDetails; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementDetailsReadinessSummaryItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementDetailsReadinessSummaryItem.java new file mode 100644 index 000000000000..f528fe807672 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementDetailsReadinessSummaryItem.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 ManagementDetailsReadinessSummaryItem + implements JsonSerializable { + /* + * The name. + */ + private CloudSuitabilityCommon name; + + /* + * The value. + */ + private Integer value; + + /** + * Creates an instance of ManagementDetailsReadinessSummaryItem class. + */ + public ManagementDetailsReadinessSummaryItem() { + } + + /** + * 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 ManagementDetailsReadinessSummaryItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementDetailsReadinessSummaryItem 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 ManagementDetailsReadinessSummaryItem. + */ + public static ManagementDetailsReadinessSummaryItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementDetailsReadinessSummaryItem deserializedManagementDetailsReadinessSummaryItem + = new ManagementDetailsReadinessSummaryItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedManagementDetailsReadinessSummaryItem.name + = CloudSuitabilityCommon.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedManagementDetailsReadinessSummaryItem.value = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementDetailsReadinessSummaryItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementSettings.java new file mode 100644 index 000000000000..5f5e369b8e8c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ManagementSettings.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Management settings. + */ +@Fluent +public final class ManagementSettings implements JsonSerializable { + /* + * HyperV Virtualization Management Settings. + */ + private HypervVirtualizationManagementSettings hypervVirtualizationManagementSettings; + + /* + * Third Party Management Settings. + */ + private ThirdPartyManagementSettings thirdPartyManagementSettings; + + /* + * Other Management Costs Settings. + */ + private OtherManagementCostsSettings otherManagementCostsSettings; + + /** + * Creates an instance of ManagementSettings class. + */ + public ManagementSettings() { + } + + /** + * Get the hypervVirtualizationManagementSettings property: HyperV Virtualization Management Settings. + * + * @return the hypervVirtualizationManagementSettings value. + */ + public HypervVirtualizationManagementSettings hypervVirtualizationManagementSettings() { + return this.hypervVirtualizationManagementSettings; + } + + /** + * Set the hypervVirtualizationManagementSettings property: HyperV Virtualization Management Settings. + * + * @param hypervVirtualizationManagementSettings the hypervVirtualizationManagementSettings value to set. + * @return the ManagementSettings object itself. + */ + public ManagementSettings withHypervVirtualizationManagementSettings( + HypervVirtualizationManagementSettings hypervVirtualizationManagementSettings) { + this.hypervVirtualizationManagementSettings = hypervVirtualizationManagementSettings; + return this; + } + + /** + * Get the thirdPartyManagementSettings property: Third Party Management Settings. + * + * @return the thirdPartyManagementSettings value. + */ + public ThirdPartyManagementSettings thirdPartyManagementSettings() { + return this.thirdPartyManagementSettings; + } + + /** + * Set the thirdPartyManagementSettings property: Third Party Management Settings. + * + * @param thirdPartyManagementSettings the thirdPartyManagementSettings value to set. + * @return the ManagementSettings object itself. + */ + public ManagementSettings + withThirdPartyManagementSettings(ThirdPartyManagementSettings thirdPartyManagementSettings) { + this.thirdPartyManagementSettings = thirdPartyManagementSettings; + return this; + } + + /** + * Get the otherManagementCostsSettings property: Other Management Costs Settings. + * + * @return the otherManagementCostsSettings value. + */ + public OtherManagementCostsSettings otherManagementCostsSettings() { + return this.otherManagementCostsSettings; + } + + /** + * Set the otherManagementCostsSettings property: Other Management Costs Settings. + * + * @param otherManagementCostsSettings the otherManagementCostsSettings value to set. + * @return the ManagementSettings object itself. + */ + public ManagementSettings + withOtherManagementCostsSettings(OtherManagementCostsSettings otherManagementCostsSettings) { + this.otherManagementCostsSettings = otherManagementCostsSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hypervVirtualizationManagementSettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property hypervVirtualizationManagementSettings in model ManagementSettings")); + } else { + hypervVirtualizationManagementSettings().validate(); + } + if (thirdPartyManagementSettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property thirdPartyManagementSettings in model ManagementSettings")); + } else { + thirdPartyManagementSettings().validate(); + } + if (otherManagementCostsSettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property otherManagementCostsSettings in model ManagementSettings")); + } else { + otherManagementCostsSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("hypervVirtualizationManagementSettings", + this.hypervVirtualizationManagementSettings); + jsonWriter.writeJsonField("thirdPartyManagementSettings", this.thirdPartyManagementSettings); + jsonWriter.writeJsonField("otherManagementCostsSettings", this.otherManagementCostsSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementSettings 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 ManagementSettings. + */ + public static ManagementSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementSettings deserializedManagementSettings = new ManagementSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hypervVirtualizationManagementSettings".equals(fieldName)) { + deserializedManagementSettings.hypervVirtualizationManagementSettings + = HypervVirtualizationManagementSettings.fromJson(reader); + } else if ("thirdPartyManagementSettings".equals(fieldName)) { + deserializedManagementSettings.thirdPartyManagementSettings + = ThirdPartyManagementSettings.fromJson(reader); + } else if ("otherManagementCostsSettings".equals(fieldName)) { + deserializedManagementSettings.otherManagementCostsSettings + = OtherManagementCostsSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrateWorkloadType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrateWorkloadType.java new file mode 100644 index 000000000000..6246342327cc --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrateWorkloadType.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Migration Workload type. + */ +public final class MigrateWorkloadType extends ExpandableStringEnum { + /** + * Static value Unknown for MigrateWorkloadType. + */ + public static final MigrateWorkloadType UNKNOWN = fromString("Unknown"); + + /** + * Static value Machine for MigrateWorkloadType. + */ + public static final MigrateWorkloadType MACHINE = fromString("Machine"); + + /** + * Static value Server for MigrateWorkloadType. + */ + public static final MigrateWorkloadType SERVER = fromString("Server"); + + /** + * Static value Instance for MigrateWorkloadType. + */ + public static final MigrateWorkloadType INSTANCE = fromString("Instance"); + + /** + * Static value WebServer for MigrateWorkloadType. + */ + public static final MigrateWorkloadType WEB_SERVER = fromString("WebServer"); + + /** + * Static value WebApplication for MigrateWorkloadType. + */ + public static final MigrateWorkloadType WEB_APPLICATION = fromString("WebApplication"); + + /** + * Static value Database for MigrateWorkloadType. + */ + public static final MigrateWorkloadType DATABASE = fromString("Database"); + + /** + * Static value Host for MigrateWorkloadType. + */ + public static final MigrateWorkloadType HOST = fromString("Host"); + + /** + * Static value ManagementServer for MigrateWorkloadType. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationDetails.java new file mode 100644 index 000000000000..e52da5f54139 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationDetails.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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 -> MigrationDetailsReadinessSummaryItem.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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationDetailsReadinessSummaryItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationDetailsReadinessSummaryItem.java new file mode 100644 index 000000000000..64005d5e684c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationDetailsReadinessSummaryItem.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 MigrationDetailsReadinessSummaryItem + implements JsonSerializable { + /* + * The name. + */ + private CloudSuitabilityCommon name; + + /* + * The value. + */ + private Integer value; + + /** + * Creates an instance of MigrationDetailsReadinessSummaryItem class. + */ + public MigrationDetailsReadinessSummaryItem() { + } + + /** + * 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 MigrationDetailsReadinessSummaryItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationDetailsReadinessSummaryItem 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 MigrationDetailsReadinessSummaryItem. + */ + public static MigrationDetailsReadinessSummaryItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationDetailsReadinessSummaryItem deserializedMigrationDetailsReadinessSummaryItem + = new MigrationDetailsReadinessSummaryItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMigrationDetailsReadinessSummaryItem.name + = CloudSuitabilityCommon.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedMigrationDetailsReadinessSummaryItem.value = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationDetailsReadinessSummaryItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationIssues.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationIssues.java new file mode 100644 index 000000000000..d381cef6cc7e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationIssues.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationIssuesCategory.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationIssuesCategory.java new file mode 100644 index 000000000000..7bc554bb6757 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationIssuesCategory.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Migration Issues Category. + */ +public final class MigrationIssuesCategory extends ExpandableStringEnum { + /** + * Static value Issue for MigrationIssuesCategory. + */ + public static final MigrationIssuesCategory ISSUE = fromString("Issue"); + + /** + * Static value Warning for MigrationIssuesCategory. + */ + public static final MigrationIssuesCategory WARNING = fromString("Warning"); + + /** + * Static value Internal for MigrationIssuesCategory. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationPlatform.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationPlatform.java new file mode 100644 index 000000000000..cea02e597514 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationPlatform.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Migration Platform. + */ +public final class MigrationPlatform extends ExpandableStringEnum { + /** + * Static value Unknown for MigrationPlatform. + */ + public static final MigrationPlatform UNKNOWN = fromString("Unknown"); + + /** + * Static value PaaS for MigrationPlatform. + */ + public static final MigrationPlatform PAAS = fromString("PaaS"); + + /** + * Static value IaaS for MigrationPlatform. + */ + public static final MigrationPlatform IAAS = fromString("IaaS"); + + /** + * Static value SaaS for MigrationPlatform. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationStrategy.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationStrategy.java new file mode 100644 index 000000000000..d6b45507a0a5 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationStrategy.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Migration Strategy. + */ +public final class MigrationStrategy extends ExpandableStringEnum { + /** + * Static value Unknown for MigrationStrategy. + */ + public static final MigrationStrategy UNKNOWN = fromString("Unknown"); + + /** + * Static value OptimizeForCost for MigrationStrategy. + */ + public static final MigrationStrategy OPTIMIZE_FOR_COST = fromString("OptimizeForCost"); + + /** + * Static value IaaSOnly for MigrationStrategy. + */ + public static final MigrationStrategy IAA_SONLY = fromString("IaaSOnly"); + + /** + * Static value OptimizeForPaas for MigrationStrategy. + */ + public static final MigrationStrategy OPTIMIZE_FOR_PAAS = fromString("OptimizeForPaas"); + + /** + * Static value AVSOnly for MigrationStrategy. + */ + public static final MigrationStrategy AVSONLY = fromString("AVSOnly"); + + /** + * Creates a new instance of MigrationStrategy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrationStrategy() { + } + + /** + * Creates or finds a MigrationStrategy from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationStrategy. + */ + public static MigrationStrategy fromString(String name) { + return fromString(name, MigrationStrategy.class); + } + + /** + * Gets known MigrationStrategy values. + * + * @return known MigrationStrategy values. + */ + public static Collection values() { + return values(MigrationStrategy.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationSuitability.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationSuitability.java new file mode 100644 index 000000000000..93790cd474e8 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationSuitability.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationType.java new file mode 100644 index 000000000000..ca300e58e797 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Migration Type. + */ +public final class MigrationType extends ExpandableStringEnum { + /** + * Static value Unknown for MigrationType. + */ + public static final MigrationType UNKNOWN = fromString("Unknown"); + + /** + * Static value Replatform for MigrationType. + */ + public static final MigrationType REPLATFORM = fromString("Replatform"); + + /** + * Static value Rehost for MigrationType. + */ + public static final MigrationType REHOST = fromString("Rehost"); + + /** + * Static value Retain for MigrationType. + */ + public static final MigrationType RETAIN = fromString("Retain"); + + /** + * Static value Rearchitect for MigrationType. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationTypeSummaries.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationTypeSummaries.java new file mode 100644 index 000000000000..604809478ca2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationTypeSummaries.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 machine properties class. + */ +@Immutable +public final class MigrationTypeSummaries implements JsonSerializable { + /* + * Gets the migration type. + */ + private MigrationType migrationType; + + /* + * Gets the Platform. + */ + private MigrationPlatform platform; + + /* + * Gets the readiness summary. + */ + private List readinessSummary; + + /** + * Creates an instance of MigrationTypeSummaries class. + */ + public MigrationTypeSummaries() { + } + + /** + * Get the migrationType property: Gets the migration type. + * + * @return the migrationType value. + */ + public MigrationType migrationType() { + return this.migrationType; + } + + /** + * Get the platform property: Gets the Platform. + * + * @return the platform value. + */ + public MigrationPlatform platform() { + return this.platform; + } + + /** + * Get the readinessSummary property: Gets the readiness 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 MigrationTypeSummaries from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationTypeSummaries 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 MigrationTypeSummaries. + */ + public static MigrationTypeSummaries fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationTypeSummaries deserializedMigrationTypeSummaries = new MigrationTypeSummaries(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("migrationType".equals(fieldName)) { + deserializedMigrationTypeSummaries.migrationType = MigrationType.fromString(reader.getString()); + } else if ("platform".equals(fieldName)) { + deserializedMigrationTypeSummaries.platform = MigrationPlatform.fromString(reader.getString()); + } else if ("readinessSummary".equals(fieldName)) { + List readinessSummary + = reader.readArray(reader1 -> MigrationTypeSummariesReadinessSummaryItem.fromJson(reader1)); + deserializedMigrationTypeSummaries.readinessSummary = readinessSummary; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationTypeSummaries; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationTypeSummariesReadinessSummaryItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationTypeSummariesReadinessSummaryItem.java new file mode 100644 index 000000000000..f28582da0c84 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MigrationTypeSummariesReadinessSummaryItem.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 MigrationTypeSummariesReadinessSummaryItem + implements JsonSerializable { + /* + * The name. + */ + private CloudSuitabilityCommon name; + + /* + * The value. + */ + private Integer value; + + /** + * Creates an instance of MigrationTypeSummariesReadinessSummaryItem class. + */ + public MigrationTypeSummariesReadinessSummaryItem() { + } + + /** + * 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 MigrationTypeSummariesReadinessSummaryItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationTypeSummariesReadinessSummaryItem 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 MigrationTypeSummariesReadinessSummaryItem. + */ + public static MigrationTypeSummariesReadinessSummaryItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationTypeSummariesReadinessSummaryItem deserializedMigrationTypeSummariesReadinessSummaryItem + = new MigrationTypeSummariesReadinessSummaryItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMigrationTypeSummariesReadinessSummaryItem.name + = CloudSuitabilityCommon.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedMigrationTypeSummariesReadinessSummaryItem.value + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationTypeSummariesReadinessSummaryItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MoreInformation.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MoreInformation.java new file mode 100644 index 000000000000..4b98f7b219d4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MoreInformation.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MultiSubnetIntent.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MultiSubnetIntent.java index cc091ef618fc..5c580edccff1 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MultiSubnetIntent.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/MultiSubnetIntent.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for MultiSubnetIntent. + * Multi Subnet Intent. */ public final class MultiSubnetIntent extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/NetworkAdapter.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/NetworkAdapter.java deleted file mode 100644 index b4976325579e..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/NetworkAdapter.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * A network adapter discovered on a machine. - */ -@Immutable -public final class NetworkAdapter implements JsonSerializable { - /* - * MAC Address of the network adapter. - */ - private String macAddress; - - /* - * List of IP Addresses on the network adapter. - */ - private List ipAddresses; - - /* - * User friendly name of the network adapter. - */ - private String displayName; - - /** - * Creates an instance of NetworkAdapter class. - */ - public NetworkAdapter() { - } - - /** - * Get the macAddress property: MAC Address of the network adapter. - * - * @return the macAddress value. - */ - public String macAddress() { - return this.macAddress; - } - - /** - * Get the ipAddresses property: List of IP Addresses on the network adapter. - * - * @return the ipAddresses value. - */ - public List ipAddresses() { - return this.ipAddresses; - } - - /** - * Get the displayName property: User friendly name of the network adapter. - * - * @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(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of NetworkAdapter from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NetworkAdapter 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 NetworkAdapter. - */ - public static NetworkAdapter fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - NetworkAdapter deserializedNetworkAdapter = new NetworkAdapter(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("macAddress".equals(fieldName)) { - deserializedNetworkAdapter.macAddress = reader.getString(); - } else if ("ipAddresses".equals(fieldName)) { - List ipAddresses = reader.readArray(reader1 -> reader1.getString()); - deserializedNetworkAdapter.ipAddresses = ipAddresses; - } else if ("displayName".equals(fieldName)) { - deserializedNetworkAdapter.displayName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedNetworkAdapter; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/NetworkSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/NetworkSettings.java new file mode 100644 index 000000000000..bb4310a3a825 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/NetworkSettings.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Network settings. + */ +@Fluent +public final class NetworkSettings implements JsonSerializable { + /* + * Network maintenance cost percentage. + */ + private float maintenanceCostPercentage; + + /* + * Number of physical servers per cabinet + */ + private int physicalServersPerCabinet; + + /* + * Average cost per cabinet + */ + private float averageCostPerCabinet; + + /** + * Creates an instance of NetworkSettings class. + */ + public NetworkSettings() { + } + + /** + * Get the maintenanceCostPercentage property: Network maintenance cost percentage. + * + * @return the maintenanceCostPercentage value. + */ + public float maintenanceCostPercentage() { + return this.maintenanceCostPercentage; + } + + /** + * Set the maintenanceCostPercentage property: Network maintenance cost percentage. + * + * @param maintenanceCostPercentage the maintenanceCostPercentage value to set. + * @return the NetworkSettings object itself. + */ + public NetworkSettings withMaintenanceCostPercentage(float maintenanceCostPercentage) { + this.maintenanceCostPercentage = maintenanceCostPercentage; + return this; + } + + /** + * Get the physicalServersPerCabinet property: Number of physical servers per cabinet. + * + * @return the physicalServersPerCabinet value. + */ + public int physicalServersPerCabinet() { + return this.physicalServersPerCabinet; + } + + /** + * Set the physicalServersPerCabinet property: Number of physical servers per cabinet. + * + * @param physicalServersPerCabinet the physicalServersPerCabinet value to set. + * @return the NetworkSettings object itself. + */ + public NetworkSettings withPhysicalServersPerCabinet(int physicalServersPerCabinet) { + this.physicalServersPerCabinet = physicalServersPerCabinet; + return this; + } + + /** + * Get the averageCostPerCabinet property: Average cost per cabinet. + * + * @return the averageCostPerCabinet value. + */ + public float averageCostPerCabinet() { + return this.averageCostPerCabinet; + } + + /** + * Set the averageCostPerCabinet property: Average cost per cabinet. + * + * @param averageCostPerCabinet the averageCostPerCabinet value to set. + * @return the NetworkSettings object itself. + */ + public NetworkSettings withAverageCostPerCabinet(float averageCostPerCabinet) { + this.averageCostPerCabinet = averageCostPerCabinet; + 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.writeFloatField("maintenanceCostPercentage", this.maintenanceCostPercentage); + jsonWriter.writeIntField("physicalServersPerCabinet", this.physicalServersPerCabinet); + jsonWriter.writeFloatField("averageCostPerCabinet", this.averageCostPerCabinet); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSettings 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 NetworkSettings. + */ + public static NetworkSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSettings deserializedNetworkSettings = new NetworkSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maintenanceCostPercentage".equals(fieldName)) { + deserializedNetworkSettings.maintenanceCostPercentage = reader.getFloat(); + } else if ("physicalServersPerCabinet".equals(fieldName)) { + deserializedNetworkSettings.physicalServersPerCabinet = reader.getInt(); + } else if ("averageCostPerCabinet".equals(fieldName)) { + deserializedNetworkSettings.averageCostPerCabinet = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/NetworkSkuType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/NetworkSkuType.java new file mode 100644 index 000000000000..5c12d93d8977 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/NetworkSkuType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Different network skus. + */ +public final class NetworkSkuType extends ExpandableStringEnum { + /** + * Static value Unknown for NetworkSkuType. + */ + public static final NetworkSkuType UNKNOWN = fromString("Unknown"); + + /** + * Static value None for NetworkSkuType. + */ + public static final NetworkSkuType NONE = fromString("None"); + + /** + * Static value ExpressRouteUltra for NetworkSkuType. + */ + public static final NetworkSkuType EXPRESS_ROUTE_ULTRA = fromString("ExpressRouteUltra"); + + /** + * Creates a new instance of NetworkSkuType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkSkuType() { + } + + /** + * Creates or finds a NetworkSkuType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkSkuType. + */ + public static NetworkSkuType fromString(String name) { + return fromString(name, NetworkSkuType.class); + } + + /** + * Gets known NetworkSkuType values. + * + * @return known NetworkSkuType values. + */ + public static Collection values() { + return values(NetworkSkuType.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/NodePool.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/NodePool.java new file mode 100644 index 000000000000..71359b0d4b3d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/NodePool.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Data model of Node Pool. + */ +@Immutable +public final class NodePool implements JsonSerializable { + /* + * Gets id. + */ + private String id; + + /* + * Gets name. + */ + private String name; + + /* + * Gets cluster name. + */ + private String clusterName; + + /* + * Gets mode. + */ + private NodePoolMode mode; + + /* + * Gets os type. + */ + private OSType osType; + + /* + * Gets arm sku name. + */ + private String armSkuName; + + /* + * Gets node count. + */ + private int nodeCount; + + /* + * Gets pod count. + */ + private int podCount; + + /* + * Gets monthly cost. + */ + private float monthlyCost; + + /* + * Gets pod approximate monthly cost. + */ + private float podApproxMonthlyCost; + + /** + * Creates an instance of NodePool class. + */ + public NodePool() { + } + + /** + * Get the id property: Gets id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Gets name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the clusterName property: Gets cluster name. + * + * @return the clusterName value. + */ + public String clusterName() { + return this.clusterName; + } + + /** + * Get the mode property: Gets mode. + * + * @return the mode value. + */ + public NodePoolMode mode() { + return this.mode; + } + + /** + * Get the osType property: Gets os type. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + + /** + * Get the armSkuName property: Gets arm sku name. + * + * @return the armSkuName value. + */ + public String armSkuName() { + return this.armSkuName; + } + + /** + * Get the nodeCount property: Gets node count. + * + * @return the nodeCount value. + */ + public int nodeCount() { + return this.nodeCount; + } + + /** + * Get the podCount property: Gets pod count. + * + * @return the podCount value. + */ + public int podCount() { + return this.podCount; + } + + /** + * Get the monthlyCost property: Gets monthly cost. + * + * @return the monthlyCost value. + */ + public float monthlyCost() { + return this.monthlyCost; + } + + /** + * Get the podApproxMonthlyCost property: Gets pod approximate monthly cost. + * + * @return the podApproxMonthlyCost value. + */ + public float podApproxMonthlyCost() { + return this.podApproxMonthlyCost; + } + + /** + * 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 NodePool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NodePool 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 NodePool. + */ + public static NodePool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NodePool deserializedNodePool = new NodePool(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNodePool.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNodePool.name = reader.getString(); + } else if ("clusterName".equals(fieldName)) { + deserializedNodePool.clusterName = reader.getString(); + } else if ("mode".equals(fieldName)) { + deserializedNodePool.mode = NodePoolMode.fromString(reader.getString()); + } else if ("osType".equals(fieldName)) { + deserializedNodePool.osType = OSType.fromString(reader.getString()); + } else if ("armSkuName".equals(fieldName)) { + deserializedNodePool.armSkuName = reader.getString(); + } else if ("nodeCount".equals(fieldName)) { + deserializedNodePool.nodeCount = reader.getInt(); + } else if ("podCount".equals(fieldName)) { + deserializedNodePool.podCount = reader.getInt(); + } else if ("monthlyCost".equals(fieldName)) { + deserializedNodePool.monthlyCost = reader.getFloat(); + } else if ("podApproxMonthlyCost".equals(fieldName)) { + deserializedNodePool.podApproxMonthlyCost = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedNodePool; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/NodePoolMode.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/NodePoolMode.java new file mode 100644 index 000000000000..7946971db77a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/NodePoolMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Node Pool Mode. + */ +public final class NodePoolMode extends ExpandableStringEnum { + /** + * Static value User for NodePoolMode. + */ + public static final NodePoolMode USER = fromString("User"); + + /** + * Static value System for NodePoolMode. + */ + public static final NodePoolMode SYSTEM = fromString("System"); + + /** + * Creates a new instance of NodePoolMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NodePoolMode() { + } + + /** + * Creates or finds a NodePoolMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding NodePoolMode. + */ + public static NodePoolMode fromString(String name) { + return fromString(name, NodePoolMode.class); + } + + /** + * Gets known NodePoolMode values. + * + * @return known NodePoolMode values. + */ + public static Collection values() { + return values(NodePoolMode.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OSType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OSType.java new file mode 100644 index 000000000000..86a97ff9b1ba --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OSType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Operating System Type. + */ +public final class OSType extends ExpandableStringEnum { + /** + * Static value Linux for OSType. + */ + public static final OSType LINUX = fromString("Linux"); + + /** + * Static value Windows for OSType. + */ + public static final OSType WINDOWS = fromString("Windows"); + + /** + * Creates a new instance of OSType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OSType() { + } + + /** + * Creates or finds a OSType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OSType. + */ + public static OSType fromString(String name) { + return fromString(name, OSType.class); + } + + /** + * Gets known OSType values. + * + * @return known OSType values. + */ + public static Collection values() { + return values(OSType.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremiseSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremiseSettings.java new file mode 100644 index 000000000000..0c73639e1e4b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremiseSettings.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * On-premise settings. + */ +@Fluent +public final class OnPremiseSettings implements JsonSerializable { + /* + * Compute settings. + */ + private ComputeSettings computeSettings; + + /* + * Storage settings. + */ + private StorageSettings storageSettings; + + /* + * Network settings. + */ + private NetworkSettings networkSettings; + + /* + * Facility settings. + */ + private FacilitySettings facilitySettings; + + /* + * Labour settings. + */ + private LaborSettings laborSettings; + + /* + * Security settings. + */ + private SecuritySettings securitySettings; + + /* + * Management settings. + */ + private ManagementSettings managementSettings; + + /** + * Creates an instance of OnPremiseSettings class. + */ + public OnPremiseSettings() { + } + + /** + * Get the computeSettings property: Compute settings. + * + * @return the computeSettings value. + */ + public ComputeSettings computeSettings() { + return this.computeSettings; + } + + /** + * Set the computeSettings property: Compute settings. + * + * @param computeSettings the computeSettings value to set. + * @return the OnPremiseSettings object itself. + */ + public OnPremiseSettings withComputeSettings(ComputeSettings computeSettings) { + this.computeSettings = computeSettings; + return this; + } + + /** + * Get the storageSettings property: Storage settings. + * + * @return the storageSettings value. + */ + public StorageSettings storageSettings() { + return this.storageSettings; + } + + /** + * Set the storageSettings property: Storage settings. + * + * @param storageSettings the storageSettings value to set. + * @return the OnPremiseSettings object itself. + */ + public OnPremiseSettings withStorageSettings(StorageSettings storageSettings) { + this.storageSettings = storageSettings; + return this; + } + + /** + * Get the networkSettings property: Network settings. + * + * @return the networkSettings value. + */ + public NetworkSettings networkSettings() { + return this.networkSettings; + } + + /** + * Set the networkSettings property: Network settings. + * + * @param networkSettings the networkSettings value to set. + * @return the OnPremiseSettings object itself. + */ + public OnPremiseSettings withNetworkSettings(NetworkSettings networkSettings) { + this.networkSettings = networkSettings; + return this; + } + + /** + * Get the facilitySettings property: Facility settings. + * + * @return the facilitySettings value. + */ + public FacilitySettings facilitySettings() { + return this.facilitySettings; + } + + /** + * Set the facilitySettings property: Facility settings. + * + * @param facilitySettings the facilitySettings value to set. + * @return the OnPremiseSettings object itself. + */ + public OnPremiseSettings withFacilitySettings(FacilitySettings facilitySettings) { + this.facilitySettings = facilitySettings; + return this; + } + + /** + * Get the laborSettings property: Labour settings. + * + * @return the laborSettings value. + */ + public LaborSettings laborSettings() { + return this.laborSettings; + } + + /** + * Set the laborSettings property: Labour settings. + * + * @param laborSettings the laborSettings value to set. + * @return the OnPremiseSettings object itself. + */ + public OnPremiseSettings withLaborSettings(LaborSettings laborSettings) { + this.laborSettings = laborSettings; + return this; + } + + /** + * Get the securitySettings property: Security settings. + * + * @return the securitySettings value. + */ + public SecuritySettings securitySettings() { + return this.securitySettings; + } + + /** + * Set the securitySettings property: Security settings. + * + * @param securitySettings the securitySettings value to set. + * @return the OnPremiseSettings object itself. + */ + public OnPremiseSettings withSecuritySettings(SecuritySettings securitySettings) { + this.securitySettings = securitySettings; + return this; + } + + /** + * Get the managementSettings property: Management settings. + * + * @return the managementSettings value. + */ + public ManagementSettings managementSettings() { + return this.managementSettings; + } + + /** + * Set the managementSettings property: Management settings. + * + * @param managementSettings the managementSettings value to set. + * @return the OnPremiseSettings object itself. + */ + public OnPremiseSettings withManagementSettings(ManagementSettings managementSettings) { + this.managementSettings = managementSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (computeSettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property computeSettings in model OnPremiseSettings")); + } else { + computeSettings().validate(); + } + if (storageSettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property storageSettings in model OnPremiseSettings")); + } else { + storageSettings().validate(); + } + if (networkSettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkSettings in model OnPremiseSettings")); + } else { + networkSettings().validate(); + } + if (facilitySettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property facilitySettings in model OnPremiseSettings")); + } else { + facilitySettings().validate(); + } + if (laborSettings() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property laborSettings in model OnPremiseSettings")); + } else { + laborSettings().validate(); + } + if (securitySettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property securitySettings in model OnPremiseSettings")); + } else { + securitySettings().validate(); + } + if (managementSettings() != null) { + managementSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OnPremiseSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("computeSettings", this.computeSettings); + jsonWriter.writeJsonField("storageSettings", this.storageSettings); + jsonWriter.writeJsonField("networkSettings", this.networkSettings); + jsonWriter.writeJsonField("facilitySettings", this.facilitySettings); + jsonWriter.writeJsonField("laborSettings", this.laborSettings); + jsonWriter.writeJsonField("securitySettings", this.securitySettings); + jsonWriter.writeJsonField("managementSettings", this.managementSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OnPremiseSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OnPremiseSettings 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 OnPremiseSettings. + */ + public static OnPremiseSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OnPremiseSettings deserializedOnPremiseSettings = new OnPremiseSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeSettings".equals(fieldName)) { + deserializedOnPremiseSettings.computeSettings = ComputeSettings.fromJson(reader); + } else if ("storageSettings".equals(fieldName)) { + deserializedOnPremiseSettings.storageSettings = StorageSettings.fromJson(reader); + } else if ("networkSettings".equals(fieldName)) { + deserializedOnPremiseSettings.networkSettings = NetworkSettings.fromJson(reader); + } else if ("facilitySettings".equals(fieldName)) { + deserializedOnPremiseSettings.facilitySettings = FacilitySettings.fromJson(reader); + } else if ("laborSettings".equals(fieldName)) { + deserializedOnPremiseSettings.laborSettings = LaborSettings.fromJson(reader); + } else if ("securitySettings".equals(fieldName)) { + deserializedOnPremiseSettings.securitySettings = SecuritySettings.fromJson(reader); + } else if ("managementSettings".equals(fieldName)) { + deserializedOnPremiseSettings.managementSettings = ManagementSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOnPremiseSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesIaasSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesIaasSummary.java new file mode 100644 index 000000000000..4237ee8eb1ef --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesIaasSummary.java @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 on premises IAAS summary. + */ +@Immutable +public final class OnPremisesIaasSummary implements JsonSerializable { + /* + * The number of servers. + */ + private Integer servers; + + /* + * The number of cores. + */ + private Integer cores; + + /* + * Total memory in GB. + */ + private Float memoryGB; + + /* + * The CPU utilization. + */ + private Float cpuUtilization; + + /* + * The memory utilization. + */ + private Float memoryUtilization; + + /* + * The storage utilization. + */ + private Float storageUtilization; + + /* + * The on premises PaaS cost. + */ + private CostDetails onPremisesIaasCostDetails; + + /* + * The on premises PaaS cost. + */ + private CostDetails onPremisesIaasCostForDecommissioned; + + /* + * The OS licensing details. + */ + private List osLicensingDetails; + + /* + * The distribution by operating system. + */ + private List distributionByOperatingSystem; + + /* + * The SQL on premises utilization insights. + */ + private UtilizationData onPremisesUtilizationData; + + /* + * The distribution by virtualization. + */ + private List distributionByVirtualization; + + /* + * Iaas OS Support Status Distribution. + */ + private SupportStatusDistribution iaasOsSupportStatusDistribution; + + /* + * Iaas Sql Support Status Distribution. + */ + private SupportStatusDistribution iaasSqlSupportStatusDistribution; + + /* + * OS Service Pack Insight. + */ + private ServicePackInsight osServicePackInsight; + + /* + * Sql Service Pack Insight. + */ + private ServicePackInsight sqlServicePackInsight; + + /* + * Distribution by Operating System Version. + */ + private List distributionByOperatingSystemVersion; + + /* + * Distribution by Sql Version. + */ + private List distributionBySqlVersion; + + /* + * Distribution by Sql Edition. + */ + private List distributionBySqlEdition; + + /* + * The on premises Iaas Sustainability details. + */ + private CarbonEmissionsDetails onPremisesIaasSustainabilityDetails; + + /* + * The on premises Iaas Sustainability details for Decommissioned. + */ + private CarbonEmissionsDetails onPremisesIaasDecommissionedSustainabilityDetails; + + /** + * Creates an instance of OnPremisesIaasSummary class. + */ + public OnPremisesIaasSummary() { + } + + /** + * Get the servers property: The number of servers. + * + * @return the servers value. + */ + public Integer servers() { + return this.servers; + } + + /** + * Get the cores property: The number of cores. + * + * @return the cores value. + */ + public Integer cores() { + return this.cores; + } + + /** + * Get the memoryGB property: Total memory in GB. + * + * @return the memoryGB value. + */ + public Float memoryGB() { + return this.memoryGB; + } + + /** + * Get the cpuUtilization property: The CPU utilization. + * + * @return the cpuUtilization value. + */ + public Float cpuUtilization() { + return this.cpuUtilization; + } + + /** + * Get the memoryUtilization property: The memory utilization. + * + * @return the memoryUtilization value. + */ + public Float memoryUtilization() { + return this.memoryUtilization; + } + + /** + * Get the storageUtilization property: The storage utilization. + * + * @return the storageUtilization value. + */ + public Float storageUtilization() { + return this.storageUtilization; + } + + /** + * Get the onPremisesIaasCostDetails property: The on premises PaaS cost. + * + * @return the onPremisesIaasCostDetails value. + */ + public CostDetails onPremisesIaasCostDetails() { + return this.onPremisesIaasCostDetails; + } + + /** + * Get the onPremisesIaasCostForDecommissioned property: The on premises PaaS cost. + * + * @return the onPremisesIaasCostForDecommissioned value. + */ + public CostDetails onPremisesIaasCostForDecommissioned() { + return this.onPremisesIaasCostForDecommissioned; + } + + /** + * Get the osLicensingDetails property: The OS licensing details. + * + * @return the osLicensingDetails value. + */ + public List osLicensingDetails() { + return this.osLicensingDetails; + } + + /** + * Get the distributionByOperatingSystem property: The distribution by operating system. + * + * @return the distributionByOperatingSystem value. + */ + public List distributionByOperatingSystem() { + return this.distributionByOperatingSystem; + } + + /** + * Get the onPremisesUtilizationData property: The SQL on premises utilization insights. + * + * @return the onPremisesUtilizationData value. + */ + public UtilizationData onPremisesUtilizationData() { + return this.onPremisesUtilizationData; + } + + /** + * Get the distributionByVirtualization property: The distribution by virtualization. + * + * @return the distributionByVirtualization value. + */ + public List distributionByVirtualization() { + return this.distributionByVirtualization; + } + + /** + * Get the iaasOsSupportStatusDistribution property: Iaas OS Support Status Distribution. + * + * @return the iaasOsSupportStatusDistribution value. + */ + public SupportStatusDistribution iaasOsSupportStatusDistribution() { + return this.iaasOsSupportStatusDistribution; + } + + /** + * Get the iaasSqlSupportStatusDistribution property: Iaas Sql Support Status Distribution. + * + * @return the iaasSqlSupportStatusDistribution value. + */ + public SupportStatusDistribution iaasSqlSupportStatusDistribution() { + return this.iaasSqlSupportStatusDistribution; + } + + /** + * Get the osServicePackInsight property: OS Service Pack Insight. + * + * @return the osServicePackInsight value. + */ + public ServicePackInsight osServicePackInsight() { + return this.osServicePackInsight; + } + + /** + * Get the sqlServicePackInsight property: Sql Service Pack Insight. + * + * @return the sqlServicePackInsight value. + */ + public ServicePackInsight sqlServicePackInsight() { + return this.sqlServicePackInsight; + } + + /** + * Get the distributionByOperatingSystemVersion property: Distribution by Operating System Version. + * + * @return the distributionByOperatingSystemVersion value. + */ + public List distributionByOperatingSystemVersion() { + return this.distributionByOperatingSystemVersion; + } + + /** + * Get the distributionBySqlVersion property: Distribution by Sql Version. + * + * @return the distributionBySqlVersion value. + */ + public List distributionBySqlVersion() { + return this.distributionBySqlVersion; + } + + /** + * Get the distributionBySqlEdition property: Distribution by Sql Edition. + * + * @return the distributionBySqlEdition value. + */ + public List distributionBySqlEdition() { + return this.distributionBySqlEdition; + } + + /** + * Get the onPremisesIaasSustainabilityDetails property: The on premises Iaas Sustainability details. + * + * @return the onPremisesIaasSustainabilityDetails value. + */ + public CarbonEmissionsDetails onPremisesIaasSustainabilityDetails() { + return this.onPremisesIaasSustainabilityDetails; + } + + /** + * Get the onPremisesIaasDecommissionedSustainabilityDetails property: The on premises Iaas Sustainability details + * for Decommissioned. + * + * @return the onPremisesIaasDecommissionedSustainabilityDetails value. + */ + public CarbonEmissionsDetails onPremisesIaasDecommissionedSustainabilityDetails() { + return this.onPremisesIaasDecommissionedSustainabilityDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (onPremisesIaasCostDetails() != null) { + onPremisesIaasCostDetails().validate(); + } + if (onPremisesIaasCostForDecommissioned() != null) { + onPremisesIaasCostForDecommissioned().validate(); + } + if (osLicensingDetails() != null) { + osLicensingDetails().forEach(e -> e.validate()); + } + if (distributionByOperatingSystem() != null) { + distributionByOperatingSystem().forEach(e -> e.validate()); + } + if (onPremisesUtilizationData() != null) { + onPremisesUtilizationData().validate(); + } + if (distributionByVirtualization() != null) { + distributionByVirtualization().forEach(e -> e.validate()); + } + if (iaasOsSupportStatusDistribution() != null) { + iaasOsSupportStatusDistribution().validate(); + } + if (iaasSqlSupportStatusDistribution() != null) { + iaasSqlSupportStatusDistribution().validate(); + } + if (osServicePackInsight() != null) { + osServicePackInsight().validate(); + } + if (sqlServicePackInsight() != null) { + sqlServicePackInsight().validate(); + } + if (distributionByOperatingSystemVersion() != null) { + distributionByOperatingSystemVersion().forEach(e -> e.validate()); + } + if (distributionBySqlVersion() != null) { + distributionBySqlVersion().forEach(e -> e.validate()); + } + if (distributionBySqlEdition() != null) { + distributionBySqlEdition().forEach(e -> e.validate()); + } + if (onPremisesIaasSustainabilityDetails() != null) { + onPremisesIaasSustainabilityDetails().validate(); + } + if (onPremisesIaasDecommissionedSustainabilityDetails() != null) { + onPremisesIaasDecommissionedSustainabilityDetails().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OnPremisesIaasSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OnPremisesIaasSummary 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 OnPremisesIaasSummary. + */ + public static OnPremisesIaasSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OnPremisesIaasSummary deserializedOnPremisesIaasSummary = new OnPremisesIaasSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("servers".equals(fieldName)) { + deserializedOnPremisesIaasSummary.servers = reader.getNullable(JsonReader::getInt); + } else if ("cores".equals(fieldName)) { + deserializedOnPremisesIaasSummary.cores = reader.getNullable(JsonReader::getInt); + } else if ("memoryGB".equals(fieldName)) { + deserializedOnPremisesIaasSummary.memoryGB = reader.getNullable(JsonReader::getFloat); + } else if ("cpuUtilization".equals(fieldName)) { + deserializedOnPremisesIaasSummary.cpuUtilization = reader.getNullable(JsonReader::getFloat); + } else if ("memoryUtilization".equals(fieldName)) { + deserializedOnPremisesIaasSummary.memoryUtilization = reader.getNullable(JsonReader::getFloat); + } else if ("storageUtilization".equals(fieldName)) { + deserializedOnPremisesIaasSummary.storageUtilization = reader.getNullable(JsonReader::getFloat); + } else if ("onPremisesIaasCostDetails".equals(fieldName)) { + deserializedOnPremisesIaasSummary.onPremisesIaasCostDetails = CostDetails.fromJson(reader); + } else if ("onPremisesIaasCostForDecommissioned".equals(fieldName)) { + deserializedOnPremisesIaasSummary.onPremisesIaasCostForDecommissioned + = CostDetails.fromJson(reader); + } else if ("osLicensingDetails".equals(fieldName)) { + List osLicensingDetails + = reader.readArray(reader1 -> IaasOsLicensingDetails.fromJson(reader1)); + deserializedOnPremisesIaasSummary.osLicensingDetails = osLicensingDetails; + } else if ("distributionByOperatingSystem".equals(fieldName)) { + List distributionByOperatingSystem + = reader.readArray(reader1 -> DistributionByOperatingSystem.fromJson(reader1)); + deserializedOnPremisesIaasSummary.distributionByOperatingSystem = distributionByOperatingSystem; + } else if ("onPremisesUtilizationData".equals(fieldName)) { + deserializedOnPremisesIaasSummary.onPremisesUtilizationData = UtilizationData.fromJson(reader); + } else if ("distributionByVirtualization".equals(fieldName)) { + List distributionByVirtualization + = reader.readArray(reader1 -> DistributionByVirtualization.fromJson(reader1)); + deserializedOnPremisesIaasSummary.distributionByVirtualization = distributionByVirtualization; + } else if ("iaasOsSupportStatusDistribution".equals(fieldName)) { + deserializedOnPremisesIaasSummary.iaasOsSupportStatusDistribution + = SupportStatusDistribution.fromJson(reader); + } else if ("iaasSqlSupportStatusDistribution".equals(fieldName)) { + deserializedOnPremisesIaasSummary.iaasSqlSupportStatusDistribution + = SupportStatusDistribution.fromJson(reader); + } else if ("osServicePackInsight".equals(fieldName)) { + deserializedOnPremisesIaasSummary.osServicePackInsight = ServicePackInsight.fromJson(reader); + } else if ("sqlServicePackInsight".equals(fieldName)) { + deserializedOnPremisesIaasSummary.sqlServicePackInsight = ServicePackInsight.fromJson(reader); + } else if ("distributionByOperatingSystemVersion".equals(fieldName)) { + List distributionByOperatingSystemVersion + = reader.readArray(reader1 -> DistributionByType.fromJson(reader1)); + deserializedOnPremisesIaasSummary.distributionByOperatingSystemVersion + = distributionByOperatingSystemVersion; + } else if ("distributionBySqlVersion".equals(fieldName)) { + List distributionBySqlVersion + = reader.readArray(reader1 -> DistributionByType.fromJson(reader1)); + deserializedOnPremisesIaasSummary.distributionBySqlVersion = distributionBySqlVersion; + } else if ("distributionBySqlEdition".equals(fieldName)) { + List distributionBySqlEdition + = reader.readArray(reader1 -> DistributionByType.fromJson(reader1)); + deserializedOnPremisesIaasSummary.distributionBySqlEdition = distributionBySqlEdition; + } else if ("onPremisesIaasSustainabilityDetails".equals(fieldName)) { + deserializedOnPremisesIaasSummary.onPremisesIaasSustainabilityDetails + = CarbonEmissionsDetails.fromJson(reader); + } else if ("onPremisesIaasDecommissionedSustainabilityDetails".equals(fieldName)) { + deserializedOnPremisesIaasSummary.onPremisesIaasDecommissionedSustainabilityDetails + = CarbonEmissionsDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOnPremisesIaasSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesPaasLicensingCost.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesPaasLicensingCost.java new file mode 100644 index 000000000000..ee5503f55e08 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesPaasLicensingCost.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 on premises paas licensing cost. + */ +@Immutable +public final class OnPremisesPaasLicensingCost implements JsonSerializable { + /* + * The version. + */ + private String version; + + /* + * The total cost. + */ + private Float totalCost; + + /* + * The decommissioned server cost. + */ + private Float decomissionServerCost; + + /** + * Creates an instance of OnPremisesPaasLicensingCost class. + */ + public OnPremisesPaasLicensingCost() { + } + + /** + * Get the version property: The version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the totalCost property: The total cost. + * + * @return the totalCost value. + */ + public Float totalCost() { + return this.totalCost; + } + + /** + * Get the decomissionServerCost property: The decommissioned server cost. + * + * @return the decomissionServerCost value. + */ + public Float decomissionServerCost() { + return this.decomissionServerCost; + } + + /** + * 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 OnPremisesPaasLicensingCost from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OnPremisesPaasLicensingCost 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 OnPremisesPaasLicensingCost. + */ + public static OnPremisesPaasLicensingCost fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OnPremisesPaasLicensingCost deserializedOnPremisesPaasLicensingCost = new OnPremisesPaasLicensingCost(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedOnPremisesPaasLicensingCost.version = reader.getString(); + } else if ("totalCost".equals(fieldName)) { + deserializedOnPremisesPaasLicensingCost.totalCost = reader.getNullable(JsonReader::getFloat); + } else if ("decomissionServerCost".equals(fieldName)) { + deserializedOnPremisesPaasLicensingCost.decomissionServerCost + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedOnPremisesPaasLicensingCost; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesPaasSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesPaasSummary.java new file mode 100644 index 000000000000..1548da6de04e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesPaasSummary.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Shows platform as a service (PaaS) summary. + */ +@Immutable +public final class OnPremisesPaasSummary implements JsonSerializable { + /* + * Total servers. + */ + private Integer totalServers; + + /* + * CPU utilization percentage. + */ + private Float cpuUtilization; + + /* + * Memory utilization percentage. + */ + private Float memoryUtilization; + + /* + * The on premises PaaS cost. + */ + private CostDetails totalOnPremisesPaasCost; + + /* + * The on premises PaaS cost. + */ + private CostDetails onPremisesPaasCostForDecommisioned; + + /* + * The on premises paas licensing cost. + */ + private OnPremisesPaasLicensingCost onPremisesPaasLicensingCost; + + /* + * The on premises SQL summary. + */ + private OnPremisesSqlSummary onPremisesSqlSummary; + + /* + * The on premises web application summary. + */ + private OnPremisesWebAppSummary onPremisesWebAppSummary; + + /* + * OS Support Status Distribution. + */ + private SupportStatusDistribution osSupportStatusDistribution; + + /* + * Sql Support Status Distribution. + */ + private SupportStatusDistribution sqlSupportStatusDistribution; + + /* + * OS Service Pack Insight. + */ + private ServicePackInsight osServicePackInsight; + + /* + * Sql Service Pack Insight. + */ + private ServicePackInsight sqlServicePackInsight; + + /* + * The on premises PaaS sustainability details. + */ + private CarbonEmissionsDetails onPremisesPaasSustainabilityDetails; + + /* + * The on premises Paas Sustainability details for Decommissioned. + */ + private CarbonEmissionsDetails onPremisesPaasDecommissionedSustainabilityDetails; + + /** + * Creates an instance of OnPremisesPaasSummary class. + */ + public OnPremisesPaasSummary() { + } + + /** + * Get the totalServers property: Total servers. + * + * @return the totalServers value. + */ + public Integer totalServers() { + return this.totalServers; + } + + /** + * Get the cpuUtilization property: CPU utilization percentage. + * + * @return the cpuUtilization value. + */ + public Float cpuUtilization() { + return this.cpuUtilization; + } + + /** + * Get the memoryUtilization property: Memory utilization percentage. + * + * @return the memoryUtilization value. + */ + public Float memoryUtilization() { + return this.memoryUtilization; + } + + /** + * Get the totalOnPremisesPaasCost property: The on premises PaaS cost. + * + * @return the totalOnPremisesPaasCost value. + */ + public CostDetails totalOnPremisesPaasCost() { + return this.totalOnPremisesPaasCost; + } + + /** + * Get the onPremisesPaasCostForDecommisioned property: The on premises PaaS cost. + * + * @return the onPremisesPaasCostForDecommisioned value. + */ + public CostDetails onPremisesPaasCostForDecommisioned() { + return this.onPremisesPaasCostForDecommisioned; + } + + /** + * Get the onPremisesPaasLicensingCost property: The on premises paas licensing cost. + * + * @return the onPremisesPaasLicensingCost value. + */ + public OnPremisesPaasLicensingCost onPremisesPaasLicensingCost() { + return this.onPremisesPaasLicensingCost; + } + + /** + * Get the onPremisesSqlSummary property: The on premises SQL summary. + * + * @return the onPremisesSqlSummary value. + */ + public OnPremisesSqlSummary onPremisesSqlSummary() { + return this.onPremisesSqlSummary; + } + + /** + * Get the onPremisesWebAppSummary property: The on premises web application summary. + * + * @return the onPremisesWebAppSummary value. + */ + public OnPremisesWebAppSummary onPremisesWebAppSummary() { + return this.onPremisesWebAppSummary; + } + + /** + * Get the osSupportStatusDistribution property: OS Support Status Distribution. + * + * @return the osSupportStatusDistribution value. + */ + public SupportStatusDistribution osSupportStatusDistribution() { + return this.osSupportStatusDistribution; + } + + /** + * Get the sqlSupportStatusDistribution property: Sql Support Status Distribution. + * + * @return the sqlSupportStatusDistribution value. + */ + public SupportStatusDistribution sqlSupportStatusDistribution() { + return this.sqlSupportStatusDistribution; + } + + /** + * Get the osServicePackInsight property: OS Service Pack Insight. + * + * @return the osServicePackInsight value. + */ + public ServicePackInsight osServicePackInsight() { + return this.osServicePackInsight; + } + + /** + * Get the sqlServicePackInsight property: Sql Service Pack Insight. + * + * @return the sqlServicePackInsight value. + */ + public ServicePackInsight sqlServicePackInsight() { + return this.sqlServicePackInsight; + } + + /** + * Get the onPremisesPaasSustainabilityDetails property: The on premises PaaS sustainability details. + * + * @return the onPremisesPaasSustainabilityDetails value. + */ + public CarbonEmissionsDetails onPremisesPaasSustainabilityDetails() { + return this.onPremisesPaasSustainabilityDetails; + } + + /** + * Get the onPremisesPaasDecommissionedSustainabilityDetails property: The on premises Paas Sustainability details + * for Decommissioned. + * + * @return the onPremisesPaasDecommissionedSustainabilityDetails value. + */ + public CarbonEmissionsDetails onPremisesPaasDecommissionedSustainabilityDetails() { + return this.onPremisesPaasDecommissionedSustainabilityDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (totalOnPremisesPaasCost() != null) { + totalOnPremisesPaasCost().validate(); + } + if (onPremisesPaasCostForDecommisioned() != null) { + onPremisesPaasCostForDecommisioned().validate(); + } + if (onPremisesPaasLicensingCost() != null) { + onPremisesPaasLicensingCost().validate(); + } + if (onPremisesSqlSummary() != null) { + onPremisesSqlSummary().validate(); + } + if (onPremisesWebAppSummary() != null) { + onPremisesWebAppSummary().validate(); + } + if (osSupportStatusDistribution() != null) { + osSupportStatusDistribution().validate(); + } + if (sqlSupportStatusDistribution() != null) { + sqlSupportStatusDistribution().validate(); + } + if (osServicePackInsight() != null) { + osServicePackInsight().validate(); + } + if (sqlServicePackInsight() != null) { + sqlServicePackInsight().validate(); + } + if (onPremisesPaasSustainabilityDetails() != null) { + onPremisesPaasSustainabilityDetails().validate(); + } + if (onPremisesPaasDecommissionedSustainabilityDetails() != null) { + onPremisesPaasDecommissionedSustainabilityDetails().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OnPremisesPaasSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OnPremisesPaasSummary 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 OnPremisesPaasSummary. + */ + public static OnPremisesPaasSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OnPremisesPaasSummary deserializedOnPremisesPaasSummary = new OnPremisesPaasSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalServers".equals(fieldName)) { + deserializedOnPremisesPaasSummary.totalServers = reader.getNullable(JsonReader::getInt); + } else if ("cpuUtilization".equals(fieldName)) { + deserializedOnPremisesPaasSummary.cpuUtilization = reader.getNullable(JsonReader::getFloat); + } else if ("memoryUtilization".equals(fieldName)) { + deserializedOnPremisesPaasSummary.memoryUtilization = reader.getNullable(JsonReader::getFloat); + } else if ("totalOnPremisesPaasCost".equals(fieldName)) { + deserializedOnPremisesPaasSummary.totalOnPremisesPaasCost = CostDetails.fromJson(reader); + } else if ("onPremisesPaasCostForDecommisioned".equals(fieldName)) { + deserializedOnPremisesPaasSummary.onPremisesPaasCostForDecommisioned = CostDetails.fromJson(reader); + } else if ("onPremisesPaasLicensingCost".equals(fieldName)) { + deserializedOnPremisesPaasSummary.onPremisesPaasLicensingCost + = OnPremisesPaasLicensingCost.fromJson(reader); + } else if ("onPremisesSqlSummary".equals(fieldName)) { + deserializedOnPremisesPaasSummary.onPremisesSqlSummary = OnPremisesSqlSummary.fromJson(reader); + } else if ("onPremisesWebAppSummary".equals(fieldName)) { + deserializedOnPremisesPaasSummary.onPremisesWebAppSummary + = OnPremisesWebAppSummary.fromJson(reader); + } else if ("osSupportStatusDistribution".equals(fieldName)) { + deserializedOnPremisesPaasSummary.osSupportStatusDistribution + = SupportStatusDistribution.fromJson(reader); + } else if ("sqlSupportStatusDistribution".equals(fieldName)) { + deserializedOnPremisesPaasSummary.sqlSupportStatusDistribution + = SupportStatusDistribution.fromJson(reader); + } else if ("osServicePackInsight".equals(fieldName)) { + deserializedOnPremisesPaasSummary.osServicePackInsight = ServicePackInsight.fromJson(reader); + } else if ("sqlServicePackInsight".equals(fieldName)) { + deserializedOnPremisesPaasSummary.sqlServicePackInsight = ServicePackInsight.fromJson(reader); + } else if ("onPremisesPaasSustainabilityDetails".equals(fieldName)) { + deserializedOnPremisesPaasSummary.onPremisesPaasSustainabilityDetails + = CarbonEmissionsDetails.fromJson(reader); + } else if ("onPremisesPaasDecommissionedSustainabilityDetails".equals(fieldName)) { + deserializedOnPremisesPaasSummary.onPremisesPaasDecommissionedSustainabilityDetails + = CarbonEmissionsDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOnPremisesPaasSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesSqlSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesSqlSummary.java new file mode 100644 index 000000000000..4e15a77c6276 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesSqlSummary.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 on premises SQL summary. + */ +@Immutable +public final class OnPremisesSqlSummary implements JsonSerializable { + /* + * The number of SQL instances. + */ + private Integer sqlInstances; + + /* + * The number of SQL databases. + */ + private Integer sqlDatabases; + + /* + * Distribution by SQL version. + */ + private List distributionBySqlVersion; + + /* + * The SQL on premises utilization insights. + */ + private UtilizationData sqlOnPremisesUtilizationData; + + /* + * Distribution by Sql Edition. + */ + private List distributionBySqlEdition; + + /** + * Creates an instance of OnPremisesSqlSummary class. + */ + public OnPremisesSqlSummary() { + } + + /** + * Get the sqlInstances property: The number of SQL instances. + * + * @return the sqlInstances value. + */ + public Integer sqlInstances() { + return this.sqlInstances; + } + + /** + * Get the sqlDatabases property: The number of SQL databases. + * + * @return the sqlDatabases value. + */ + public Integer sqlDatabases() { + return this.sqlDatabases; + } + + /** + * Get the distributionBySqlVersion property: Distribution by SQL version. + * + * @return the distributionBySqlVersion value. + */ + public List distributionBySqlVersion() { + return this.distributionBySqlVersion; + } + + /** + * Get the sqlOnPremisesUtilizationData property: The SQL on premises utilization insights. + * + * @return the sqlOnPremisesUtilizationData value. + */ + public UtilizationData sqlOnPremisesUtilizationData() { + return this.sqlOnPremisesUtilizationData; + } + + /** + * Get the distributionBySqlEdition property: Distribution by Sql Edition. + * + * @return the distributionBySqlEdition value. + */ + public List distributionBySqlEdition() { + return this.distributionBySqlEdition; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (distributionBySqlVersion() != null) { + distributionBySqlVersion().forEach(e -> e.validate()); + } + if (sqlOnPremisesUtilizationData() != null) { + sqlOnPremisesUtilizationData().validate(); + } + if (distributionBySqlEdition() != null) { + distributionBySqlEdition().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OnPremisesSqlSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OnPremisesSqlSummary 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 OnPremisesSqlSummary. + */ + public static OnPremisesSqlSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OnPremisesSqlSummary deserializedOnPremisesSqlSummary = new OnPremisesSqlSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sqlInstances".equals(fieldName)) { + deserializedOnPremisesSqlSummary.sqlInstances = reader.getNullable(JsonReader::getInt); + } else if ("sqlDatabases".equals(fieldName)) { + deserializedOnPremisesSqlSummary.sqlDatabases = reader.getNullable(JsonReader::getInt); + } else if ("distributionBySqlVersion".equals(fieldName)) { + List distributionBySqlVersion + = reader.readArray(reader1 -> SqlVersionDetails.fromJson(reader1)); + deserializedOnPremisesSqlSummary.distributionBySqlVersion = distributionBySqlVersion; + } else if ("sqlOnPremisesUtilizationData".equals(fieldName)) { + deserializedOnPremisesSqlSummary.sqlOnPremisesUtilizationData = UtilizationData.fromJson(reader); + } else if ("distributionBySqlEdition".equals(fieldName)) { + List distributionBySqlEdition + = reader.readArray(reader1 -> DistributionByType.fromJson(reader1)); + deserializedOnPremisesSqlSummary.distributionBySqlEdition = distributionBySqlEdition; + } else { + reader.skipChildren(); + } + } + + return deserializedOnPremisesSqlSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesWebAppSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesWebAppSummary.java new file mode 100644 index 000000000000..6e849bac9227 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesWebAppSummary.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 on premises web application summary. + */ +@Immutable +public final class OnPremisesWebAppSummary implements JsonSerializable { + /* + * The number of web servers. + */ + private Integer numberOfWebServers; + + /* + * The number of web applications. + */ + private Integer numberOfWebApplications; + + /* + * The number of web applications per web application type. + */ + private List numberOfWebAppsPerType; + + /** + * Creates an instance of OnPremisesWebAppSummary class. + */ + public OnPremisesWebAppSummary() { + } + + /** + * Get the numberOfWebServers property: The number of web servers. + * + * @return the numberOfWebServers value. + */ + public Integer numberOfWebServers() { + return this.numberOfWebServers; + } + + /** + * Get the numberOfWebApplications property: The number of web applications. + * + * @return the numberOfWebApplications value. + */ + public Integer numberOfWebApplications() { + return this.numberOfWebApplications; + } + + /** + * Get the numberOfWebAppsPerType property: The number of web applications per web application type. + * + * @return the numberOfWebAppsPerType value. + */ + public List numberOfWebAppsPerType() { + return this.numberOfWebAppsPerType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (numberOfWebAppsPerType() != null) { + numberOfWebAppsPerType().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OnPremisesWebAppSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OnPremisesWebAppSummary 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 OnPremisesWebAppSummary. + */ + public static OnPremisesWebAppSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OnPremisesWebAppSummary deserializedOnPremisesWebAppSummary = new OnPremisesWebAppSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("numberOfWebServers".equals(fieldName)) { + deserializedOnPremisesWebAppSummary.numberOfWebServers = reader.getNullable(JsonReader::getInt); + } else if ("numberOfWebApplications".equals(fieldName)) { + deserializedOnPremisesWebAppSummary.numberOfWebApplications + = reader.getNullable(JsonReader::getInt); + } else if ("numberOfWebAppsPerType".equals(fieldName)) { + List numberOfWebAppsPerType = reader + .readArray(reader1 -> OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem.fromJson(reader1)); + deserializedOnPremisesWebAppSummary.numberOfWebAppsPerType = numberOfWebAppsPerType; + } else { + reader.skipChildren(); + } + } + + return deserializedOnPremisesWebAppSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem.java new file mode 100644 index 000000000000..09b87b0362d4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * The generic name value pair. + */ +@Fluent +public final class OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem + implements JsonSerializable { + /* + * The name. + */ + private String name; + + /* + * The value. + */ + private Integer value; + + /** + * Creates an instance of OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem class. + */ + public OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem() { + } + + /** + * Get the name property: The name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name. + * + * @param name the name value to set. + * @return the OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem object itself. + */ + public OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value. + * + * @return the value value. + */ + public Integer value() { + return this.value; + } + + /** + * Set the value property: The value. + * + * @param value the value value to set. + * @return the OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem object itself. + */ + public OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem withValue(Integer value) { + this.value = value; + 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("name", this.name); + jsonWriter.writeNumberField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem 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 OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem. + */ + public static OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem deserializedOnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem + = new OnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedOnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem.value + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedOnPremisesWebAppSummaryNumberOfWebAppsPerTypeItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OptimizationLogic.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OptimizationLogic.java deleted file mode 100644 index 64fb19c3fff2..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OptimizationLogic.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for OptimizationLogic. - */ -public final class OptimizationLogic extends ExpandableStringEnum { - /** - * Static value MinimizeCost for OptimizationLogic. - */ - public static final OptimizationLogic MINIMIZE_COST = fromString("MinimizeCost"); - - /** - * Static value ModernizeToPaaS for OptimizationLogic. - */ - public static final OptimizationLogic MODERNIZE_TO_PAAS = fromString("ModernizeToPaaS"); - - /** - * Static value ModernizeToAzureSqlMi for OptimizationLogic. - */ - public static final OptimizationLogic MODERNIZE_TO_AZURE_SQL_MI = fromString("ModernizeToAzureSqlMi"); - - /** - * Static value ModernizeToAzureSqlDb for OptimizationLogic. - */ - public static final OptimizationLogic MODERNIZE_TO_AZURE_SQL_DB = fromString("ModernizeToAzureSqlDb"); - - /** - * Creates a new instance of OptimizationLogic value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public OptimizationLogic() { - } - - /** - * Creates or finds a OptimizationLogic from its string representation. - * - * @param name a name to look for. - * @return the corresponding OptimizationLogic. - */ - public static OptimizationLogic fromString(String name) { - return fromString(name, OptimizationLogic.class); - } - - /** - * Gets known OptimizationLogic values. - * - * @return known OptimizationLogic values. - */ - public static Collection values() { - return values(OptimizationLogic.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OsLicense.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OsLicense.java index e2b45e2cb16f..0467bf612452 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OsLicense.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OsLicense.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for OsLicense. + * Os License. */ public final class OsLicense extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OtherManagementCostsSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OtherManagementCostsSettings.java new file mode 100644 index 000000000000..e7e3cc3eeefe --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OtherManagementCostsSettings.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Other Management Costs Settings. + */ +@Fluent +public final class OtherManagementCostsSettings implements JsonSerializable { + /* + * Monitoring Cost Per Server Per Year. + */ + private float monitoringCostPerServerPerYear; + + /* + * Patching Cost Per Server Per Year. + */ + private float patchingCostPerServerPerYear; + + /* + * Data Protection Cost Per Server Per Year. + */ + private float dataProtectionCostPerServerPerYear; + + /** + * Creates an instance of OtherManagementCostsSettings class. + */ + public OtherManagementCostsSettings() { + } + + /** + * Get the monitoringCostPerServerPerYear property: Monitoring Cost Per Server Per Year. + * + * @return the monitoringCostPerServerPerYear value. + */ + public float monitoringCostPerServerPerYear() { + return this.monitoringCostPerServerPerYear; + } + + /** + * Set the monitoringCostPerServerPerYear property: Monitoring Cost Per Server Per Year. + * + * @param monitoringCostPerServerPerYear the monitoringCostPerServerPerYear value to set. + * @return the OtherManagementCostsSettings object itself. + */ + public OtherManagementCostsSettings withMonitoringCostPerServerPerYear(float monitoringCostPerServerPerYear) { + this.monitoringCostPerServerPerYear = monitoringCostPerServerPerYear; + return this; + } + + /** + * Get the patchingCostPerServerPerYear property: Patching Cost Per Server Per Year. + * + * @return the patchingCostPerServerPerYear value. + */ + public float patchingCostPerServerPerYear() { + return this.patchingCostPerServerPerYear; + } + + /** + * Set the patchingCostPerServerPerYear property: Patching Cost Per Server Per Year. + * + * @param patchingCostPerServerPerYear the patchingCostPerServerPerYear value to set. + * @return the OtherManagementCostsSettings object itself. + */ + public OtherManagementCostsSettings withPatchingCostPerServerPerYear(float patchingCostPerServerPerYear) { + this.patchingCostPerServerPerYear = patchingCostPerServerPerYear; + return this; + } + + /** + * Get the dataProtectionCostPerServerPerYear property: Data Protection Cost Per Server Per Year. + * + * @return the dataProtectionCostPerServerPerYear value. + */ + public float dataProtectionCostPerServerPerYear() { + return this.dataProtectionCostPerServerPerYear; + } + + /** + * Set the dataProtectionCostPerServerPerYear property: Data Protection Cost Per Server Per Year. + * + * @param dataProtectionCostPerServerPerYear the dataProtectionCostPerServerPerYear value to set. + * @return the OtherManagementCostsSettings object itself. + */ + public OtherManagementCostsSettings + withDataProtectionCostPerServerPerYear(float dataProtectionCostPerServerPerYear) { + this.dataProtectionCostPerServerPerYear = dataProtectionCostPerServerPerYear; + 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.writeFloatField("monitoringCostPerServerPerYear", this.monitoringCostPerServerPerYear); + jsonWriter.writeFloatField("patchingCostPerServerPerYear", this.patchingCostPerServerPerYear); + jsonWriter.writeFloatField("dataProtectionCostPerServerPerYear", this.dataProtectionCostPerServerPerYear); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OtherManagementCostsSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OtherManagementCostsSettings 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 OtherManagementCostsSettings. + */ + public static OtherManagementCostsSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OtherManagementCostsSettings deserializedOtherManagementCostsSettings = new OtherManagementCostsSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("monitoringCostPerServerPerYear".equals(fieldName)) { + deserializedOtherManagementCostsSettings.monitoringCostPerServerPerYear = reader.getFloat(); + } else if ("patchingCostPerServerPerYear".equals(fieldName)) { + deserializedOtherManagementCostsSettings.patchingCostPerServerPerYear = reader.getFloat(); + } else if ("dataProtectionCostPerServerPerYear".equals(fieldName)) { + deserializedOtherManagementCostsSettings.dataProtectionCostPerServerPerYear = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedOtherManagementCostsSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OverviewSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OverviewSummary.java new file mode 100644 index 000000000000..ff6d8e51a04a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OverviewSummary.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.OverviewSummaryInner; + +/** + * An immutable client-side representation of OverviewSummary. + */ +public interface OverviewSummary { + /** + * 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. + */ + OverviewSummaryProperties 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.migration.assessment.fluent.models.OverviewSummaryInner object. + * + * @return the inner object. + */ + OverviewSummaryInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OverviewSummaryListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OverviewSummaryListResult.java new file mode 100644 index 000000000000..77a75fe4bcee --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OverviewSummaryListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.OverviewSummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a OverviewSummary list operation. + */ +@Fluent +public final class OverviewSummaryListResult implements JsonSerializable { + /* + * The OverviewSummary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OverviewSummaryListResult class. + */ + public OverviewSummaryListResult() { + } + + /** + * Get the value property: The OverviewSummary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The OverviewSummary items on this page. + * + * @param value the value value to set. + * @return the OverviewSummaryListResult object itself. + */ + public OverviewSummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the OverviewSummaryListResult object itself. + */ + public OverviewSummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 OverviewSummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OverviewSummaryListResult.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 OverviewSummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OverviewSummaryListResult 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 OverviewSummaryListResult. + */ + public static OverviewSummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OverviewSummaryListResult deserializedOverviewSummaryListResult = new OverviewSummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OverviewSummaryInner.fromJson(reader1)); + deserializedOverviewSummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOverviewSummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOverviewSummaryListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OverviewSummaryProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OverviewSummaryProperties.java new file mode 100644 index 000000000000..6abf0f42022d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/OverviewSummaryProperties.java @@ -0,0 +1,601 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Overview summary properties class. + */ +@Immutable +public final class OverviewSummaryProperties implements JsonSerializable { + /* + * The total Azure cost.. + */ + private Float totalAzureCost; + + /* + * The total Azure IaaS cost. + */ + private Float totalAzureIaasCost; + + /* + * The total Azure PaaS cost. + */ + private Float totalAzurePaasCost; + + /* + * The total Avs cost. + */ + private Float totalAzureAvsCost; + + /* + * The windows ahub saving. + */ + private Float windowsAhubSavings; + + /* + * The linux ahub saving. + */ + private Float linuxAhubSavings; + + /* + * The sql ahub saving. + */ + private Float sqlAhubSavings; + + /* + * The total on premises cost. + */ + private Float totalOnPremisesCost; + + /* + * ESU Savings 4 Years. + */ + private Float esuSavingsFor4Years; + + /* + * The management cost saving. + */ + private Float managementCostSavings; + + /* + * The security cost saving. + */ + private Float securityCostSavings; + + /* + * Shows the year-on-year cost overall. + */ + private YearOnYearEstimates yearOnYearEstimates; + + /* + * Shows the discovered servers by virtualization platform. + */ + private ServersDiscovered serversDiscovered; + + /* + * The SQL on premises utilization insights. + */ + private UtilizationData utilizationData; + + /* + * Shows the infrastructure as a service machine OS distribution. + */ + private IaasOsDistribution iaasOsDistribution; + + /* + * OS Support Status Distribution. + */ + private SupportStatusDistribution osSupportStatusDistribution; + + /* + * Sql Support Status Distribution. + */ + private SupportStatusDistribution sqlSupportStatusDistribution; + + /* + * Shows the distribution of platforms. + */ + private PaasDistribution paasDistribution; + + /* + * The total Azure arc enabled on-premises cost assuming all on-premises infra is arc enabled. + */ + private Float azureArcEnabledOnPremisesCost; + + /* + * The final cost including azure and azure arc enabled on-premises considering the remaining on-prem infra is arc + * enabled. + */ + private Float futureCostIncludingAzureArc; + + /* + * ESU Savings in 4 Years considering the remaining on-prem infra each year is arc enabled. + */ + private Float futureEsuSavingsFor4YearsIncludingAzureArc; + + /* + * The management cost saving considering the remaining on-prem infra is arc enabled + */ + private Float futureManagementCostSavingsIncludingAzureArc; + + /* + * The security cost saving considering the remaining on-prem infra is arc enabled. + */ + private Float futureSecurityCostSavingsIncludingAzureArc; + + /* + * The total cost of services offered by azure arc. + */ + private Float azureArcServicesCost; + + /* + * The Iaas component of the future azure cost based on the final migration percentage. + */ + private Float futureAzureIaasCost; + + /* + * The Paas component of the future azure cost based on the final migration percentage. + */ + private Float futureAzurePaasCost; + + /* + * The future azure arc cost based on the final migration percentage. + */ + private Float futureAzureArcEnabledOnPremisesCost; + + /* + * The total cost of services offered by azure arc based on the final migration percentage. + */ + private Float futureAzureArcServicesCost; + + /* + * The total on-premises sustainability estimates. + */ + private CarbonEmissionsDetails totalOnPremisesSustainabilityDetails; + + /* + * The total azure sustainability estimates. + */ + private CarbonEmissionsDetails totalAzureSustainabilityDetails; + + /** + * Creates an instance of OverviewSummaryProperties class. + */ + public OverviewSummaryProperties() { + } + + /** + * Get the totalAzureCost property: The total Azure cost.. + * + * @return the totalAzureCost value. + */ + public Float totalAzureCost() { + return this.totalAzureCost; + } + + /** + * Get the totalAzureIaasCost property: The total Azure IaaS cost. + * + * @return the totalAzureIaasCost value. + */ + public Float totalAzureIaasCost() { + return this.totalAzureIaasCost; + } + + /** + * Get the totalAzurePaasCost property: The total Azure PaaS cost. + * + * @return the totalAzurePaasCost value. + */ + public Float totalAzurePaasCost() { + return this.totalAzurePaasCost; + } + + /** + * Get the totalAzureAvsCost property: The total Avs cost. + * + * @return the totalAzureAvsCost value. + */ + public Float totalAzureAvsCost() { + return this.totalAzureAvsCost; + } + + /** + * Get the windowsAhubSavings property: The windows ahub saving. + * + * @return the windowsAhubSavings value. + */ + public Float windowsAhubSavings() { + return this.windowsAhubSavings; + } + + /** + * Get the linuxAhubSavings property: The linux ahub saving. + * + * @return the linuxAhubSavings value. + */ + public Float linuxAhubSavings() { + return this.linuxAhubSavings; + } + + /** + * Get the sqlAhubSavings property: The sql ahub saving. + * + * @return the sqlAhubSavings value. + */ + public Float sqlAhubSavings() { + return this.sqlAhubSavings; + } + + /** + * Get the totalOnPremisesCost property: The total on premises cost. + * + * @return the totalOnPremisesCost value. + */ + public Float totalOnPremisesCost() { + return this.totalOnPremisesCost; + } + + /** + * Get the esuSavingsFor4Years property: ESU Savings 4 Years. + * + * @return the esuSavingsFor4Years value. + */ + public Float esuSavingsFor4Years() { + return this.esuSavingsFor4Years; + } + + /** + * Get the managementCostSavings property: The management cost saving. + * + * @return the managementCostSavings value. + */ + public Float managementCostSavings() { + return this.managementCostSavings; + } + + /** + * Get the securityCostSavings property: The security cost saving. + * + * @return the securityCostSavings value. + */ + public Float securityCostSavings() { + return this.securityCostSavings; + } + + /** + * Get the yearOnYearEstimates property: Shows the year-on-year cost overall. + * + * @return the yearOnYearEstimates value. + */ + public YearOnYearEstimates yearOnYearEstimates() { + return this.yearOnYearEstimates; + } + + /** + * Get the serversDiscovered property: Shows the discovered servers by virtualization platform. + * + * @return the serversDiscovered value. + */ + public ServersDiscovered serversDiscovered() { + return this.serversDiscovered; + } + + /** + * Get the utilizationData property: The SQL on premises utilization insights. + * + * @return the utilizationData value. + */ + public UtilizationData utilizationData() { + return this.utilizationData; + } + + /** + * Get the iaasOsDistribution property: Shows the infrastructure as a service machine OS distribution. + * + * @return the iaasOsDistribution value. + */ + public IaasOsDistribution iaasOsDistribution() { + return this.iaasOsDistribution; + } + + /** + * Get the osSupportStatusDistribution property: OS Support Status Distribution. + * + * @return the osSupportStatusDistribution value. + */ + public SupportStatusDistribution osSupportStatusDistribution() { + return this.osSupportStatusDistribution; + } + + /** + * Get the sqlSupportStatusDistribution property: Sql Support Status Distribution. + * + * @return the sqlSupportStatusDistribution value. + */ + public SupportStatusDistribution sqlSupportStatusDistribution() { + return this.sqlSupportStatusDistribution; + } + + /** + * Get the paasDistribution property: Shows the distribution of platforms. + * + * @return the paasDistribution value. + */ + public PaasDistribution paasDistribution() { + return this.paasDistribution; + } + + /** + * Get the azureArcEnabledOnPremisesCost property: The total Azure arc enabled on-premises cost assuming all + * on-premises infra is arc enabled. + * + * @return the azureArcEnabledOnPremisesCost value. + */ + public Float azureArcEnabledOnPremisesCost() { + return this.azureArcEnabledOnPremisesCost; + } + + /** + * Get the futureCostIncludingAzureArc property: The final cost including azure and azure arc enabled on-premises + * considering the remaining on-prem infra is arc enabled. + * + * @return the futureCostIncludingAzureArc value. + */ + public Float futureCostIncludingAzureArc() { + return this.futureCostIncludingAzureArc; + } + + /** + * Get the futureEsuSavingsFor4YearsIncludingAzureArc property: ESU Savings in 4 Years considering the remaining + * on-prem infra each year is arc enabled. + * + * @return the futureEsuSavingsFor4YearsIncludingAzureArc value. + */ + public Float futureEsuSavingsFor4YearsIncludingAzureArc() { + return this.futureEsuSavingsFor4YearsIncludingAzureArc; + } + + /** + * Get the futureManagementCostSavingsIncludingAzureArc property: The management cost saving considering the + * remaining on-prem infra is arc enabled. + * + * @return the futureManagementCostSavingsIncludingAzureArc value. + */ + public Float futureManagementCostSavingsIncludingAzureArc() { + return this.futureManagementCostSavingsIncludingAzureArc; + } + + /** + * Get the futureSecurityCostSavingsIncludingAzureArc property: The security cost saving considering the remaining + * on-prem infra is arc enabled. + * + * @return the futureSecurityCostSavingsIncludingAzureArc value. + */ + public Float futureSecurityCostSavingsIncludingAzureArc() { + return this.futureSecurityCostSavingsIncludingAzureArc; + } + + /** + * Get the azureArcServicesCost property: The total cost of services offered by azure arc. + * + * @return the azureArcServicesCost value. + */ + public Float azureArcServicesCost() { + return this.azureArcServicesCost; + } + + /** + * Get the futureAzureIaasCost property: The Iaas component of the future azure cost based on the final migration + * percentage. + * + * @return the futureAzureIaasCost value. + */ + public Float futureAzureIaasCost() { + return this.futureAzureIaasCost; + } + + /** + * Get the futureAzurePaasCost property: The Paas component of the future azure cost based on the final migration + * percentage. + * + * @return the futureAzurePaasCost value. + */ + public Float futureAzurePaasCost() { + return this.futureAzurePaasCost; + } + + /** + * Get the futureAzureArcEnabledOnPremisesCost property: The future azure arc cost based on the final migration + * percentage. + * + * @return the futureAzureArcEnabledOnPremisesCost value. + */ + public Float futureAzureArcEnabledOnPremisesCost() { + return this.futureAzureArcEnabledOnPremisesCost; + } + + /** + * Get the futureAzureArcServicesCost property: The total cost of services offered by azure arc based on the final + * migration percentage. + * + * @return the futureAzureArcServicesCost value. + */ + public Float futureAzureArcServicesCost() { + return this.futureAzureArcServicesCost; + } + + /** + * Get the totalOnPremisesSustainabilityDetails property: The total on-premises sustainability estimates. + * + * @return the totalOnPremisesSustainabilityDetails value. + */ + public CarbonEmissionsDetails totalOnPremisesSustainabilityDetails() { + return this.totalOnPremisesSustainabilityDetails; + } + + /** + * Get the totalAzureSustainabilityDetails property: The total azure sustainability estimates. + * + * @return the totalAzureSustainabilityDetails value. + */ + public CarbonEmissionsDetails totalAzureSustainabilityDetails() { + return this.totalAzureSustainabilityDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (yearOnYearEstimates() != null) { + yearOnYearEstimates().validate(); + } + if (serversDiscovered() != null) { + serversDiscovered().validate(); + } + if (utilizationData() != null) { + utilizationData().validate(); + } + if (iaasOsDistribution() != null) { + iaasOsDistribution().validate(); + } + if (osSupportStatusDistribution() != null) { + osSupportStatusDistribution().validate(); + } + if (sqlSupportStatusDistribution() != null) { + sqlSupportStatusDistribution().validate(); + } + if (paasDistribution() != null) { + paasDistribution().validate(); + } + if (totalOnPremisesSustainabilityDetails() != null) { + totalOnPremisesSustainabilityDetails().validate(); + } + if (totalAzureSustainabilityDetails() != null) { + totalAzureSustainabilityDetails().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OverviewSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OverviewSummaryProperties 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 OverviewSummaryProperties. + */ + public static OverviewSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OverviewSummaryProperties deserializedOverviewSummaryProperties = new OverviewSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalOnPremisesSustainabilityDetails".equals(fieldName)) { + deserializedOverviewSummaryProperties.totalOnPremisesSustainabilityDetails + = CarbonEmissionsDetails.fromJson(reader); + } else if ("totalAzureSustainabilityDetails".equals(fieldName)) { + deserializedOverviewSummaryProperties.totalAzureSustainabilityDetails + = CarbonEmissionsDetails.fromJson(reader); + } else if ("totalAzureCost".equals(fieldName)) { + deserializedOverviewSummaryProperties.totalAzureCost = reader.getNullable(JsonReader::getFloat); + } else if ("totalAzureIaasCost".equals(fieldName)) { + deserializedOverviewSummaryProperties.totalAzureIaasCost = reader.getNullable(JsonReader::getFloat); + } else if ("totalAzurePaasCost".equals(fieldName)) { + deserializedOverviewSummaryProperties.totalAzurePaasCost = reader.getNullable(JsonReader::getFloat); + } else if ("totalAzureAvsCost".equals(fieldName)) { + deserializedOverviewSummaryProperties.totalAzureAvsCost = reader.getNullable(JsonReader::getFloat); + } else if ("windowsAhubSavings".equals(fieldName)) { + deserializedOverviewSummaryProperties.windowsAhubSavings = reader.getNullable(JsonReader::getFloat); + } else if ("linuxAhubSavings".equals(fieldName)) { + deserializedOverviewSummaryProperties.linuxAhubSavings = reader.getNullable(JsonReader::getFloat); + } else if ("sqlAhubSavings".equals(fieldName)) { + deserializedOverviewSummaryProperties.sqlAhubSavings = reader.getNullable(JsonReader::getFloat); + } else if ("totalOnPremisesCost".equals(fieldName)) { + deserializedOverviewSummaryProperties.totalOnPremisesCost + = reader.getNullable(JsonReader::getFloat); + } else if ("esuSavingsFor4years".equals(fieldName)) { + deserializedOverviewSummaryProperties.esuSavingsFor4Years + = reader.getNullable(JsonReader::getFloat); + } else if ("managementCostSavings".equals(fieldName)) { + deserializedOverviewSummaryProperties.managementCostSavings + = reader.getNullable(JsonReader::getFloat); + } else if ("securityCostSavings".equals(fieldName)) { + deserializedOverviewSummaryProperties.securityCostSavings + = reader.getNullable(JsonReader::getFloat); + } else if ("yearOnYearEstimates".equals(fieldName)) { + deserializedOverviewSummaryProperties.yearOnYearEstimates = YearOnYearEstimates.fromJson(reader); + } else if ("serversDiscovered".equals(fieldName)) { + deserializedOverviewSummaryProperties.serversDiscovered = ServersDiscovered.fromJson(reader); + } else if ("utilizationData".equals(fieldName)) { + deserializedOverviewSummaryProperties.utilizationData = UtilizationData.fromJson(reader); + } else if ("iaasOsDistribution".equals(fieldName)) { + deserializedOverviewSummaryProperties.iaasOsDistribution = IaasOsDistribution.fromJson(reader); + } else if ("osSupportStatusDistribution".equals(fieldName)) { + deserializedOverviewSummaryProperties.osSupportStatusDistribution + = SupportStatusDistribution.fromJson(reader); + } else if ("sqlSupportStatusDistribution".equals(fieldName)) { + deserializedOverviewSummaryProperties.sqlSupportStatusDistribution + = SupportStatusDistribution.fromJson(reader); + } else if ("paasDistribution".equals(fieldName)) { + deserializedOverviewSummaryProperties.paasDistribution = PaasDistribution.fromJson(reader); + } else if ("azureArcEnabledOnPremisesCost".equals(fieldName)) { + deserializedOverviewSummaryProperties.azureArcEnabledOnPremisesCost + = reader.getNullable(JsonReader::getFloat); + } else if ("futureCostIncludingAzureArc".equals(fieldName)) { + deserializedOverviewSummaryProperties.futureCostIncludingAzureArc + = reader.getNullable(JsonReader::getFloat); + } else if ("futureEsuSavingsFor4YearsIncludingAzureArc".equals(fieldName)) { + deserializedOverviewSummaryProperties.futureEsuSavingsFor4YearsIncludingAzureArc + = reader.getNullable(JsonReader::getFloat); + } else if ("futureManagementCostSavingsIncludingAzureArc".equals(fieldName)) { + deserializedOverviewSummaryProperties.futureManagementCostSavingsIncludingAzureArc + = reader.getNullable(JsonReader::getFloat); + } else if ("futureSecurityCostSavingsIncludingAzureArc".equals(fieldName)) { + deserializedOverviewSummaryProperties.futureSecurityCostSavingsIncludingAzureArc + = reader.getNullable(JsonReader::getFloat); + } else if ("azureArcServicesCost".equals(fieldName)) { + deserializedOverviewSummaryProperties.azureArcServicesCost + = reader.getNullable(JsonReader::getFloat); + } else if ("futureAzureIaasCost".equals(fieldName)) { + deserializedOverviewSummaryProperties.futureAzureIaasCost + = reader.getNullable(JsonReader::getFloat); + } else if ("futureAzurePaasCost".equals(fieldName)) { + deserializedOverviewSummaryProperties.futureAzurePaasCost + = reader.getNullable(JsonReader::getFloat); + } else if ("futureAzureArcEnabledOnPremisesCost".equals(fieldName)) { + deserializedOverviewSummaryProperties.futureAzureArcEnabledOnPremisesCost + = reader.getNullable(JsonReader::getFloat); + } else if ("futureAzureArcServicesCost".equals(fieldName)) { + deserializedOverviewSummaryProperties.futureAzureArcServicesCost + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedOverviewSummaryProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PaasDistribution.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PaasDistribution.java new file mode 100644 index 000000000000..65f21ed610c9 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PaasDistribution.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Shows the distribution of platforms. + */ +@Immutable +public final class PaasDistribution implements JsonSerializable { + /* + * Number of SQL Server machines. + */ + private Integer sqlServers; + + /* + * Number of IIS Web servers. + */ + private Integer iisWebServers; + + /* + * Distribution of webapps for each target type. + */ + private List webAppDistribution; + + /** + * Creates an instance of PaasDistribution class. + */ + public PaasDistribution() { + } + + /** + * Get the sqlServers property: Number of SQL Server machines. + * + * @return the sqlServers value. + */ + public Integer sqlServers() { + return this.sqlServers; + } + + /** + * Get the iisWebServers property: Number of IIS Web servers. + * + * @return the iisWebServers value. + */ + public Integer iisWebServers() { + return this.iisWebServers; + } + + /** + * Get the webAppDistribution property: Distribution of webapps for each target type. + * + * @return the webAppDistribution value. + */ + public List webAppDistribution() { + return this.webAppDistribution; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (webAppDistribution() != null) { + webAppDistribution().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PaasDistribution from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PaasDistribution 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 PaasDistribution. + */ + public static PaasDistribution fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PaasDistribution deserializedPaasDistribution = new PaasDistribution(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sqlServers".equals(fieldName)) { + deserializedPaasDistribution.sqlServers = reader.getNullable(JsonReader::getInt); + } else if ("iisWebServers".equals(fieldName)) { + deserializedPaasDistribution.iisWebServers = reader.getNullable(JsonReader::getInt); + } else if ("webAppDistribution".equals(fieldName)) { + List webAppDistribution + = reader.readArray(reader1 -> PaasDistributionWebAppDistributionItem.fromJson(reader1)); + deserializedPaasDistribution.webAppDistribution = webAppDistribution; + } else { + reader.skipChildren(); + } + } + + return deserializedPaasDistribution; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PaasDistributionWebAppDistributionItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PaasDistributionWebAppDistributionItem.java new file mode 100644 index 000000000000..ab63cf15619a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PaasDistributionWebAppDistributionItem.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * The generic name value pair. + */ +@Fluent +public final class PaasDistributionWebAppDistributionItem + implements JsonSerializable { + /* + * The name. + */ + private String name; + + /* + * The value. + */ + private Integer value; + + /** + * Creates an instance of PaasDistributionWebAppDistributionItem class. + */ + public PaasDistributionWebAppDistributionItem() { + } + + /** + * Get the name property: The name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name. + * + * @param name the name value to set. + * @return the PaasDistributionWebAppDistributionItem object itself. + */ + public PaasDistributionWebAppDistributionItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value. + * + * @return the value value. + */ + public Integer value() { + return this.value; + } + + /** + * Set the value property: The value. + * + * @param value the value value to set. + * @return the PaasDistributionWebAppDistributionItem object itself. + */ + public PaasDistributionWebAppDistributionItem withValue(Integer value) { + this.value = value; + 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("name", this.name); + jsonWriter.writeNumberField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PaasDistributionWebAppDistributionItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PaasDistributionWebAppDistributionItem 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 PaasDistributionWebAppDistributionItem. + */ + public static PaasDistributionWebAppDistributionItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PaasDistributionWebAppDistributionItem deserializedPaasDistributionWebAppDistributionItem + = new PaasDistributionWebAppDistributionItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPaasDistributionWebAppDistributionItem.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedPaasDistributionWebAppDistributionItem.value = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedPaasDistributionWebAppDistributionItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PaasSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PaasSummary.java new file mode 100644 index 000000000000..ae116f3f29b0 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PaasSummary.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.PaasSummaryInner; + +/** + * An immutable client-side representation of PaasSummary. + */ +public interface PaasSummary { + /** + * 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. + */ + PaasSummaryProperties 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.migration.assessment.fluent.models.PaasSummaryInner object. + * + * @return the inner object. + */ + PaasSummaryInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PaasSummaryListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PaasSummaryListResult.java new file mode 100644 index 000000000000..6fef9cb6c0a6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PaasSummaryListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.PaasSummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a PaasSummary list operation. + */ +@Fluent +public final class PaasSummaryListResult implements JsonSerializable { + /* + * The PaasSummary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PaasSummaryListResult class. + */ + public PaasSummaryListResult() { + } + + /** + * Get the value property: The PaasSummary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The PaasSummary items on this page. + * + * @param value the value value to set. + * @return the PaasSummaryListResult object itself. + */ + public PaasSummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the PaasSummaryListResult object itself. + */ + public PaasSummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 PaasSummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PaasSummaryListResult.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 PaasSummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PaasSummaryListResult 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 PaasSummaryListResult. + */ + public static PaasSummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PaasSummaryListResult deserializedPaasSummaryListResult = new PaasSummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> PaasSummaryInner.fromJson(reader1)); + deserializedPaasSummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPaasSummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPaasSummaryListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PaasSummaryProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PaasSummaryProperties.java new file mode 100644 index 000000000000..107a7e2f6421 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PaasSummaryProperties.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Paas summary properties class. + */ +@Immutable +public final class PaasSummaryProperties implements JsonSerializable { + /* + * Shows the PaaS Azure summary. + */ + private AzurePaasSummary azure; + + /* + * Shows platform as a service (PaaS) summary. + */ + private OnPremisesPaasSummary onPremises; + + /** + * Creates an instance of PaasSummaryProperties class. + */ + public PaasSummaryProperties() { + } + + /** + * Get the azure property: Shows the PaaS Azure summary. + * + * @return the azure value. + */ + public AzurePaasSummary azure() { + return this.azure; + } + + /** + * Get the onPremises property: Shows platform as a service (PaaS) summary. + * + * @return the onPremises value. + */ + public OnPremisesPaasSummary onPremises() { + return this.onPremises; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azure() != null) { + azure().validate(); + } + if (onPremises() != null) { + onPremises().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PaasSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PaasSummaryProperties 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 PaasSummaryProperties. + */ + public static PaasSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PaasSummaryProperties deserializedPaasSummaryProperties = new PaasSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azure".equals(fieldName)) { + deserializedPaasSummaryProperties.azure = AzurePaasSummary.fromJson(reader); + } else if ("onPremises".equals(fieldName)) { + deserializedPaasSummaryProperties.onPremises = OnPremisesPaasSummary.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPaasSummaryProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Percentile.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Percentile.java index 90a049f1381c..aa415325e0a7 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Percentile.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Percentile.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for Percentile. + * Percentile for Performance Data. */ public final class Percentile extends ExpandableStringEnum { /** @@ -31,6 +31,11 @@ public final class Percentile extends ExpandableStringEnum { */ public static final Percentile PERCENTILE99 = fromString("Percentile99"); + /** + * Static value PercentileUnknown for Percentile. + */ + public static final Percentile PERCENTILE_UNKNOWN = fromString("PercentileUnknown"); + /** * Creates a new instance of Percentile value. * diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PerformanceData.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PerformanceData.java new file mode 100644 index 000000000000..b8f6ccb4badf --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PerformanceData.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PremiumDiskSupport.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PremiumDiskSupport.java new file mode 100644 index 000000000000..1a37c35acafb --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PremiumDiskSupport.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Premium Disk Support. + */ +public final class PremiumDiskSupport extends ExpandableStringEnum { + /** + * Static value PremiumDiskSupported for PremiumDiskSupport. + */ + public static final PremiumDiskSupport PREMIUM_DISK_SUPPORTED = fromString("PremiumDiskSupported"); + + /** + * Static value PremiumDiskNotSupported for PremiumDiskSupport. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PricingTier.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PricingTier.java new file mode 100644 index 000000000000..5b3188e4f293 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PricingTier.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Pricing Tier for Azure. + */ +public final class PricingTier extends ExpandableStringEnum { + /** + * Static value Standard for PricingTier. + */ + public static final PricingTier STANDARD = fromString("Standard"); + + /** + * Static value Free for PricingTier. + */ + public static final PricingTier FREE = fromString("Free"); + + /** + * Creates a new instance of PricingTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PricingTier() { + } + + /** + * Creates or finds a PricingTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding PricingTier. + */ + public static PricingTier fromString(String name) { + return fromString(name, PricingTier.class); + } + + /** + * Gets known PricingTier values. + * + * @return known PricingTier values. + */ + public static Collection values() { + return values(PricingTier.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PrivateEndpointConnectionOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PrivateEndpointConnectionOperations.java index b06928bf5c7b..358e678652ee 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PrivateEndpointConnectionOperations.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PrivateEndpointConnectionOperations.java @@ -24,7 +24,7 @@ public interface PrivateEndpointConnectionOperations { * @return the response of a PrivateEndpointConnection list operation as paginated response with * {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List PrivateEndpointConnection resources by AssessmentProject. @@ -38,7 +38,7 @@ public interface PrivateEndpointConnectionOperations { * @return the response of a PrivateEndpointConnection list operation as paginated response with * {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PrivateLinkResourceOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PrivateLinkResourceOperations.java index adee3d9569f2..7ccb8474a25b 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PrivateLinkResourceOperations.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/PrivateLinkResourceOperations.java @@ -22,7 +22,7 @@ public interface PrivateLinkResourceOperations { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a PrivateLinkResource list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List PrivateLinkResource resources by AssessmentProject. @@ -35,8 +35,7 @@ public interface PrivateLinkResourceOperations { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a PrivateLinkResource list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** * Get a PrivateLinkResource. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ProjectProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ProjectProperties.java index 2914f1aadee0..c1450009a83a 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ProjectProperties.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ProjectProperties.java @@ -7,6 +7,7 @@ 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 com.azure.resourcemanager.migration.assessment.fluent.models.PrivateEndpointConnectionInner; @@ -18,7 +19,12 @@ * Properties of a project. */ @Fluent -public final class ProjectProperties extends AzureResourceProperties { +public final class ProjectProperties implements JsonSerializable { + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + /* * Time when this project was created. Date-Time represented in ISO-8601 format. */ @@ -80,6 +86,15 @@ public final class ProjectProperties extends AzureResourceProperties { public ProjectProperties() { } + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + /** * Get the createdTimestamp property: Time when this project was created. Date-Time represented in ISO-8601 format. * @@ -247,21 +262,11 @@ public ProjectProperties withCustomerStorageAccountArmId(String customerStorageA return this; } - /** - * {@inheritDoc} - */ - @Override - public ProjectProperties withProvisioningState(ProvisioningState provisioningState) { - super.withProvisioningState(provisioningState); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (privateEndpointConnections() != null) { privateEndpointConnections().forEach(e -> e.validate()); @@ -274,8 +279,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provisioningState", - provisioningState() == null ? null : provisioningState().toString()); jsonWriter.writeStringField("assessmentSolutionId", this.assessmentSolutionId); jsonWriter.writeStringField("projectStatus", this.projectStatus == null ? null : this.projectStatus.toString()); jsonWriter.writeStringField("customerWorkspaceId", this.customerWorkspaceId); @@ -301,8 +304,7 @@ public static ProjectProperties fromJson(JsonReader jsonReader) throws IOExcepti reader.nextToken(); if ("provisioningState".equals(fieldName)) { - deserializedProjectProperties - .withProvisioningState(ProvisioningState.fromString(reader.getString())); + deserializedProjectProperties.provisioningState = ProvisioningState.fromString(reader.getString()); } else if ("createdTimestamp".equals(fieldName)) { deserializedProjectProperties.createdTimestamp = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/RecommendationResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/RecommendationResult.java new file mode 100644 index 000000000000..b1e1014b4dae --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/RecommendationResult.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Data model of Recommendation Result. + */ +@Immutable +public final class RecommendationResult implements JsonSerializable { + /* + * Gets cores and memory request. + */ + private ComputeResource request; + + /* + * Gets cores and memory limit. + */ + private ComputeResource limit; + + /* + * Gets cluster name. + */ + private String clusterName; + + /** + * Creates an instance of RecommendationResult class. + */ + public RecommendationResult() { + } + + /** + * Get the request property: Gets cores and memory request. + * + * @return the request value. + */ + public ComputeResource request() { + return this.request; + } + + /** + * Get the limit property: Gets cores and memory limit. + * + * @return the limit value. + */ + public ComputeResource limit() { + return this.limit; + } + + /** + * Get the clusterName property: Gets cluster name. + * + * @return the clusterName value. + */ + public String clusterName() { + return this.clusterName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (request() != null) { + request().validate(); + } + if (limit() != null) { + limit().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecommendationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecommendationResult 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 RecommendationResult. + */ + public static RecommendationResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecommendationResult deserializedRecommendationResult = new RecommendationResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("request".equals(fieldName)) { + deserializedRecommendationResult.request = ComputeResource.fromJson(reader); + } else if ("limit".equals(fieldName)) { + deserializedRecommendationResult.limit = ComputeResource.fromJson(reader); + } else if ("clusterName".equals(fieldName)) { + deserializedRecommendationResult.clusterName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRecommendationResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/RecommendedAvsNodeTypeSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/RecommendedAvsNodeTypeSummary.java new file mode 100644 index 000000000000..8ed6f0c4c988 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/RecommendedAvsNodeTypeSummary.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Azure Avs Node summary. + */ +@Immutable +public final class RecommendedAvsNodeTypeSummary implements JsonSerializable { + /* + * AVS node type. + */ + private String avsNodeType; + + /* + * Number of nodes. + */ + private Integer numberOfNodes; + + /* + * Failures to tolerate and RAID level for the Node. + */ + private FttAndRaidLevel failuresToTolerateAndRaidLevel; + + /** + * Creates an instance of RecommendedAvsNodeTypeSummary class. + */ + public RecommendedAvsNodeTypeSummary() { + } + + /** + * Get the avsNodeType property: AVS node type. + * + * @return the avsNodeType value. + */ + public String avsNodeType() { + return this.avsNodeType; + } + + /** + * Get the numberOfNodes property: Number of nodes. + * + * @return the numberOfNodes value. + */ + public Integer numberOfNodes() { + return this.numberOfNodes; + } + + /** + * Get the failuresToTolerateAndRaidLevel property: Failures to tolerate and RAID level for the Node. + * + * @return the failuresToTolerateAndRaidLevel value. + */ + public FttAndRaidLevel failuresToTolerateAndRaidLevel() { + return this.failuresToTolerateAndRaidLevel; + } + + /** + * 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 RecommendedAvsNodeTypeSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecommendedAvsNodeTypeSummary 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 RecommendedAvsNodeTypeSummary. + */ + public static RecommendedAvsNodeTypeSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecommendedAvsNodeTypeSummary deserializedRecommendedAvsNodeTypeSummary + = new RecommendedAvsNodeTypeSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("avsNodeType".equals(fieldName)) { + deserializedRecommendedAvsNodeTypeSummary.avsNodeType = reader.getString(); + } else if ("numberOfNodes".equals(fieldName)) { + deserializedRecommendedAvsNodeTypeSummary.numberOfNodes = reader.getNullable(JsonReader::getInt); + } else if ("failuresToTolerateAndRaidLevel".equals(fieldName)) { + deserializedRecommendedAvsNodeTypeSummary.failuresToTolerateAndRaidLevel + = FttAndRaidLevel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRecommendedAvsNodeTypeSummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/RecommendedFor.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/RecommendedFor.java new file mode 100644 index 000000000000..e0d7958ef9f8 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/RecommendedFor.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/RecommendedSuitability.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/RecommendedSuitability.java deleted file mode 100644 index 7292b910a294..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/RecommendedSuitability.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for RecommendedSuitability. - */ -public final class RecommendedSuitability extends ExpandableStringEnum { - /** - * Static value Unknown for RecommendedSuitability. - */ - public static final RecommendedSuitability UNKNOWN = fromString("Unknown"); - - /** - * Static value SuitableForSqlDB for RecommendedSuitability. - */ - public static final RecommendedSuitability SUITABLE_FOR_SQL_DB = fromString("SuitableForSqlDB"); - - /** - * Static value SuitableForSqlMI for RecommendedSuitability. - */ - public static final RecommendedSuitability SUITABLE_FOR_SQL_MI = fromString("SuitableForSqlMI"); - - /** - * Static value SuitableForVM for RecommendedSuitability. - */ - public static final RecommendedSuitability SUITABLE_FOR_VM = fromString("SuitableForVM"); - - /** - * Static value PotentiallySuitableForVM for RecommendedSuitability. - */ - public static final RecommendedSuitability POTENTIALLY_SUITABLE_FOR_VM = fromString("PotentiallySuitableForVM"); - - /** - * Static value ReadinessUnknown for RecommendedSuitability. - */ - public static final RecommendedSuitability READINESS_UNKNOWN = fromString("ReadinessUnknown"); - - /** - * Static value NotSuitable for RecommendedSuitability. - */ - public static final RecommendedSuitability NOT_SUITABLE = fromString("NotSuitable"); - - /** - * Static value SuitableForSqlVM for RecommendedSuitability. - */ - public static final RecommendedSuitability SUITABLE_FOR_SQL_VM = fromString("SuitableForSqlVM"); - - /** - * Static value ConditionallySuitableForSqlDB for RecommendedSuitability. - */ - public static final RecommendedSuitability CONDITIONALLY_SUITABLE_FOR_SQL_DB - = fromString("ConditionallySuitableForSqlDB"); - - /** - * Static value ConditionallySuitableForSqlMI for RecommendedSuitability. - */ - public static final RecommendedSuitability CONDITIONALLY_SUITABLE_FOR_SQL_MI - = fromString("ConditionallySuitableForSqlMI"); - - /** - * Static value ConditionallySuitableForVM for RecommendedSuitability. - */ - public static final RecommendedSuitability CONDITIONALLY_SUITABLE_FOR_VM = fromString("ConditionallySuitableForVM"); - - /** - * Static value ConditionallySuitableForSqlVM for RecommendedSuitability. - */ - public static final RecommendedSuitability CONDITIONALLY_SUITABLE_FOR_SQL_VM - = fromString("ConditionallySuitableForSqlVM"); - - /** - * Creates a new instance of RecommendedSuitability value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecommendedSuitability() { - } - - /** - * Creates or finds a RecommendedSuitability from its string representation. - * - * @param name a name to look for. - * @return the corresponding RecommendedSuitability. - */ - public static RecommendedSuitability fromString(String name) { - return fromString(name, RecommendedSuitability.class); - } - - /** - * Gets known RecommendedSuitability values. - * - * @return known RecommendedSuitability values. - */ - public static Collection values() { - return values(RecommendedSuitability.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/RecommendedVmFamilySummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/RecommendedVmFamilySummary.java new file mode 100644 index 000000000000..1d2fc37a5aa6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/RecommendedVmFamilySummary.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 recommended VM family summary. + */ +@Immutable +public final class RecommendedVmFamilySummary implements JsonSerializable { + /* + * The Azure VM family. + */ + private String azureVmFamily; + + /* + * The number of machines. + */ + private Integer numberOfMachines; + + /** + * Creates an instance of RecommendedVmFamilySummary class. + */ + public RecommendedVmFamilySummary() { + } + + /** + * Get the azureVmFamily property: The Azure VM family. + * + * @return the azureVmFamily value. + */ + public String azureVmFamily() { + return this.azureVmFamily; + } + + /** + * Get the numberOfMachines property: The number of machines. + * + * @return the numberOfMachines value. + */ + public Integer numberOfMachines() { + return this.numberOfMachines; + } + + /** + * 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 RecommendedVmFamilySummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecommendedVmFamilySummary 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 RecommendedVmFamilySummary. + */ + public static RecommendedVmFamilySummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecommendedVmFamilySummary deserializedRecommendedVmFamilySummary = new RecommendedVmFamilySummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureVmFamily".equals(fieldName)) { + deserializedRecommendedVmFamilySummary.azureVmFamily = reader.getString(); + } else if ("numberOfMachines".equals(fieldName)) { + deserializedRecommendedVmFamilySummary.numberOfMachines = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedRecommendedVmFamilySummary; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ReportDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ReportDetails.java new file mode 100644 index 000000000000..516687fd5611 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ReportDetails.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Business case report details. + */ +@Immutable +public final class ReportDetails implements JsonSerializable { + /* + * Report type. + */ + private ReportType reportType; + + /* + * Report status. + */ + private ReportStatus reportStatus; + + /** + * Creates an instance of ReportDetails class. + */ + public ReportDetails() { + } + + /** + * Get the reportType property: Report type. + * + * @return the reportType value. + */ + public ReportType reportType() { + return this.reportType; + } + + /** + * Get the reportStatus property: Report status. + * + * @return the reportStatus value. + */ + public ReportStatus reportStatus() { + return this.reportStatus; + } + + /** + * 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 ReportDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReportDetails 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 ReportDetails. + */ + public static ReportDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReportDetails deserializedReportDetails = new ReportDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("reportType".equals(fieldName)) { + deserializedReportDetails.reportType = ReportType.fromString(reader.getString()); + } else if ("reportStatus".equals(fieldName)) { + deserializedReportDetails.reportStatus = ReportStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedReportDetails; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ReportDownloadUrl.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ReportDownloadUrl.java new file mode 100644 index 000000000000..c86cde9f6ea8 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ReportDownloadUrl.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.resourcemanager.migration.assessment.fluent.models.ReportDownloadUrlInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of ReportDownloadUrl. + */ +public interface ReportDownloadUrl { + /** + * Gets the businessCaseReportUrl property: Hyperlink to download report. + * + * @return the businessCaseReportUrl value. + */ + String businessCaseReportUrl(); + + /** + * Gets the expirationTime property: Expiry date of download url. + * + * @return the expirationTime value. + */ + OffsetDateTime expirationTime(); + + /** + * Gets the inner com.azure.resourcemanager.migration.assessment.fluent.models.ReportDownloadUrlInner object. + * + * @return the inner object. + */ + ReportDownloadUrlInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ReportStatus.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ReportStatus.java new file mode 100644 index 000000000000..e1ebdbcd1c40 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ReportStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Business case supported report status types. + */ +public final class ReportStatus extends ExpandableStringEnum { + /** + * Static value Unknown for ReportStatus. + */ + public static final ReportStatus UNKNOWN = fromString("Unknown"); + + /** + * Static value None for ReportStatus. + */ + public static final ReportStatus NONE = fromString("None"); + + /** + * Static value InProgress for ReportStatus. + */ + public static final ReportStatus IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Failed for ReportStatus. + */ + public static final ReportStatus FAILED = fromString("Failed"); + + /** + * Static value Completed for ReportStatus. + */ + public static final ReportStatus COMPLETED = fromString("Completed"); + + /** + * Creates a new instance of ReportStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReportStatus() { + } + + /** + * Creates or finds a ReportStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReportStatus. + */ + public static ReportStatus fromString(String name) { + return fromString(name, ReportStatus.class); + } + + /** + * Gets known ReportStatus values. + * + * @return known ReportStatus values. + */ + public static Collection values() { + return values(ReportStatus.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ReportType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ReportType.java new file mode 100644 index 000000000000..a0dd12200dd6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ReportType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Business case supported report types. + */ +public final class ReportType extends ExpandableStringEnum { + /** + * Static value Unknown for ReportType. + */ + public static final ReportType UNKNOWN = fromString("Unknown"); + + /** + * Static value Excel for ReportType. + */ + public static final ReportType EXCEL = fromString("Excel"); + + /** + * Creates a new instance of ReportType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReportType() { + } + + /** + * Creates or finds a ReportType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReportType. + */ + public static ReportType fromString(String name) { + return fromString(name, ReportType.class); + } + + /** + * Gets known ReportType values. + * + * @return known ReportType values. + */ + public static Collection values() { + return values(ReportType.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingComponent.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingComponent.java new file mode 100644 index 000000000000..2255383e156d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingComponent.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Class to represent the component of the cost. + */ +@Fluent +public final class SavingComponent implements JsonSerializable { + /* + * Gets the name of the component. + */ + private SavingComponentName name; + + /* + * The value of the component. + */ + private Float value; + + /* + * The textual description of the component. + */ + private String description; + + /** + * Creates an instance of SavingComponent class. + */ + public SavingComponent() { + } + + /** + * Get the name property: Gets the name of the component. + * + * @return the name value. + */ + public SavingComponentName name() { + return this.name; + } + + /** + * Get the value property: The value of the component. + * + * @return the value value. + */ + public Float value() { + return this.value; + } + + /** + * Set the value property: The value of the component. + * + * @param value the value value to set. + * @return the SavingComponent object itself. + */ + public SavingComponent withValue(Float value) { + this.value = value; + return this; + } + + /** + * Get the description property: The textual description of the component. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The textual description of the component. + * + * @param description the description value to set. + * @return the SavingComponent object itself. + */ + public SavingComponent withDescription(String description) { + this.description = description; + 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("value", this.value); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SavingComponent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SavingComponent 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 SavingComponent. + */ + public static SavingComponent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SavingComponent deserializedSavingComponent = new SavingComponent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSavingComponent.name = SavingComponentName.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedSavingComponent.value = reader.getNullable(JsonReader::getFloat); + } else if ("description".equals(fieldName)) { + deserializedSavingComponent.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSavingComponent; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingComponentName.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingComponentName.java new file mode 100644 index 000000000000..16d47c85d2a7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingComponentName.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Saving Component Name. + */ +public final class SavingComponentName extends ExpandableStringEnum { + /** + * Static value MonthlyLinuxAzureHybridCostSavings for SavingComponentName. + */ + public static final SavingComponentName MONTHLY_LINUX_AZURE_HYBRID_COST_SAVINGS + = fromString("MonthlyLinuxAzureHybridCostSavings"); + + /** + * Static value MonthlyAzureHybridCostSavings for SavingComponentName. + */ + public static final SavingComponentName MONTHLY_AZURE_HYBRID_COST_SAVINGS + = fromString("MonthlyAzureHybridCostSavings"); + + /** + * Creates a new instance of SavingComponentName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SavingComponentName() { + } + + /** + * Creates or finds a SavingComponentName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SavingComponentName. + */ + public static SavingComponentName fromString(String name) { + return fromString(name, SavingComponentName.class); + } + + /** + * Gets known SavingComponentName values. + * + * @return known SavingComponentName values. + */ + public static Collection values() { + return values(SavingComponentName.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsDetailsCommon.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsDetailsCommon.java new file mode 100644 index 000000000000..885cf23ccb38 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsDetailsCommon.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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 -> SavingsDetailsCommonSavingsDetailItem.fromJson(reader1)); + deserializedSavingsDetailsCommon.savingsDetail = savingsDetail; + } else { + reader.skipChildren(); + } + } + + return deserializedSavingsDetailsCommon; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsDetailsCommonSavingsDetailItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsDetailsCommonSavingsDetailItem.java new file mode 100644 index 000000000000..34b60ff13281 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsDetailsCommonSavingsDetailItem.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SavingsDetailsCommonSavingsDetailItem + implements JsonSerializable { + /* + * The name. + */ + private SavingsType name; + + /* + * The value. + */ + private Float value; + + /** + * Creates an instance of SavingsDetailsCommonSavingsDetailItem class. + */ + public SavingsDetailsCommonSavingsDetailItem() { + } + + /** + * 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 Float 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 SavingsDetailsCommonSavingsDetailItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SavingsDetailsCommonSavingsDetailItem 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 SavingsDetailsCommonSavingsDetailItem. + */ + public static SavingsDetailsCommonSavingsDetailItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SavingsDetailsCommonSavingsDetailItem deserializedSavingsDetailsCommonSavingsDetailItem + = new SavingsDetailsCommonSavingsDetailItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSavingsDetailsCommonSavingsDetailItem.name = SavingsType.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedSavingsDetailsCommonSavingsDetailItem.value = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedSavingsDetailsCommonSavingsDetailItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsOption.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsOption.java new file mode 100644 index 000000000000..b42a3ef6f497 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsOption.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Gets the business case savings option type. + */ +public final class SavingsOption extends ExpandableStringEnum { + /** + * Static value Unknown for SavingsOption. + */ + public static final SavingsOption UNKNOWN = fromString("Unknown"); + + /** + * Static value RI3Year for SavingsOption. + */ + public static final SavingsOption RI3YEAR = fromString("RI3Year"); + + /** + * Static value SavingsPlan3Year for SavingsOption. + */ + public static final SavingsOption SAVINGS_PLAN3YEAR = fromString("SavingsPlan3Year"); + + /** + * Creates a new instance of SavingsOption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SavingsOption() { + } + + /** + * Creates or finds a SavingsOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding SavingsOption. + */ + public static SavingsOption fromString(String name) { + return fromString(name, SavingsOption.class); + } + + /** + * Gets known SavingsOption values. + * + * @return known SavingsOption values. + */ + public static Collection values() { + return values(SavingsOption.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsOptions.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsOptions.java new file mode 100644 index 000000000000..4d9cfcd09c55 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsOptions.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The savings options. + */ +public final class SavingsOptions extends ExpandableStringEnum { + /** + * Static value None for SavingsOptions. + */ + public static final SavingsOptions NONE = fromString("None"); + + /** + * Static value RI1Year for SavingsOptions. + */ + public static final SavingsOptions RI1YEAR = fromString("RI1Year"); + + /** + * Static value RI3Year for SavingsOptions. + */ + public static final SavingsOptions RI3YEAR = fromString("RI3Year"); + + /** + * Static value SavingsPlan1Year for SavingsOptions. + */ + public static final SavingsOptions SAVINGS_PLAN1YEAR = fromString("SavingsPlan1Year"); + + /** + * Static value SavingsPlan3Year for SavingsOptions. + */ + public static final SavingsOptions SAVINGS_PLAN3YEAR = fromString("SavingsPlan3Year"); + + /** + * Static value CustomAzureOfferCode for SavingsOptions. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsSettings.java new file mode 100644 index 000000000000..16e72e42a2f4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsSettings.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsType.java new file mode 100644 index 000000000000..28544b6c75a3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SavingsType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Savings type. + */ +public final class SavingsType extends ExpandableStringEnum { + /** + * Static value MonthlyAzureHybridCostSavings for SavingsType. + */ + public static final SavingsType MONTHLY_AZURE_HYBRID_COST_SAVINGS = fromString("MonthlyAzureHybridCostSavings"); + + /** + * Static value MonthlyLinuxAzureHybridCostSavings for SavingsType. + */ + public static final SavingsType MONTHLY_LINUX_AZURE_HYBRID_COST_SAVINGS + = fromString("MonthlyLinuxAzureHybridCostSavings"); + + /** + * Static value MonthlyAhubSqlCostSavings for SavingsType. + */ + public static final SavingsType MONTHLY_AHUB_SQL_COST_SAVINGS = fromString("MonthlyAhubSqlCostSavings"); + + /** + * Static value MonthlyVcfByolCostDifference for SavingsType. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Scope.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Scope.java new file mode 100644 index 000000000000..a75d15f623e3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Scope.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ScopeType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ScopeType.java new file mode 100644 index 000000000000..9f25153cdc5a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ScopeType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Scope type. + */ +public final class ScopeType extends ExpandableStringEnum { + /** + * Static value ServerGroupId for ScopeType. + */ + public static final ScopeType SERVER_GROUP_ID = fromString("ServerGroupId"); + + /** + * Static value AzureResourceGraphQuery for ScopeType. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SecuritySettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SecuritySettings.java new file mode 100644 index 000000000000..e597c8c4ba29 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SecuritySettings.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Security settings. + */ +@Fluent +public final class SecuritySettings implements JsonSerializable { + /* + * Physical servers per administrator. + */ + private float serverSecurityCostPerServerPerYear; + + /* + * Virtual machines per administrator. + */ + private float sqlServerSecurityCostPerServerPerYear; + + /** + * Creates an instance of SecuritySettings class. + */ + public SecuritySettings() { + } + + /** + * Get the serverSecurityCostPerServerPerYear property: Physical servers per administrator. + * + * @return the serverSecurityCostPerServerPerYear value. + */ + public float serverSecurityCostPerServerPerYear() { + return this.serverSecurityCostPerServerPerYear; + } + + /** + * Set the serverSecurityCostPerServerPerYear property: Physical servers per administrator. + * + * @param serverSecurityCostPerServerPerYear the serverSecurityCostPerServerPerYear value to set. + * @return the SecuritySettings object itself. + */ + public SecuritySettings withServerSecurityCostPerServerPerYear(float serverSecurityCostPerServerPerYear) { + this.serverSecurityCostPerServerPerYear = serverSecurityCostPerServerPerYear; + return this; + } + + /** + * Get the sqlServerSecurityCostPerServerPerYear property: Virtual machines per administrator. + * + * @return the sqlServerSecurityCostPerServerPerYear value. + */ + public float sqlServerSecurityCostPerServerPerYear() { + return this.sqlServerSecurityCostPerServerPerYear; + } + + /** + * Set the sqlServerSecurityCostPerServerPerYear property: Virtual machines per administrator. + * + * @param sqlServerSecurityCostPerServerPerYear the sqlServerSecurityCostPerServerPerYear value to set. + * @return the SecuritySettings object itself. + */ + public SecuritySettings withSqlServerSecurityCostPerServerPerYear(float sqlServerSecurityCostPerServerPerYear) { + this.sqlServerSecurityCostPerServerPerYear = sqlServerSecurityCostPerServerPerYear; + 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.writeFloatField("serverSecurityCostPerServerPerYear", this.serverSecurityCostPerServerPerYear); + jsonWriter.writeFloatField("sqlServerSecurityCostPerServerPerYear", this.sqlServerSecurityCostPerServerPerYear); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecuritySettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecuritySettings 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 SecuritySettings. + */ + public static SecuritySettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecuritySettings deserializedSecuritySettings = new SecuritySettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serverSecurityCostPerServerPerYear".equals(fieldName)) { + deserializedSecuritySettings.serverSecurityCostPerServerPerYear = reader.getFloat(); + } else if ("sqlServerSecurityCostPerServerPerYear".equals(fieldName)) { + deserializedSecuritySettings.sqlServerSecurityCostPerServerPerYear = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecuritySettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SecuritySuitability.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SecuritySuitability.java new file mode 100644 index 000000000000..a712e2e502bd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SecuritySuitability.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ServerCollectorsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ServerCollectorsOperations.java index 2ab5fa88ed9d..9171390dd5b3 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ServerCollectorsOperations.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ServerCollectorsOperations.java @@ -22,7 +22,7 @@ public interface ServerCollectorsOperations { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a ServerCollector list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List ServerCollector resources by AssessmentProject. @@ -35,8 +35,7 @@ public interface ServerCollectorsOperations { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a ServerCollector list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** * Get a ServerCollector. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ServersDiscovered.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ServersDiscovered.java new file mode 100644 index 000000000000..7faacb799a8f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ServersDiscovered.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Shows the discovered servers by virtualization platform. + */ +@Immutable +public final class ServersDiscovered implements JsonSerializable { + /* + * Number of servers on VMWare. + */ + private Integer vmWare; + + /* + * Number of servers on HyperV. + */ + private Integer hyperV; + + /* + * Number of physical servers. + */ + private Integer physical; + + /* + * Number of servers whose virtualization is unknown. + */ + private Integer notApplicable; + + /** + * Creates an instance of ServersDiscovered class. + */ + public ServersDiscovered() { + } + + /** + * Get the vmWare property: Number of servers on VMWare. + * + * @return the vmWare value. + */ + public Integer vmWare() { + return this.vmWare; + } + + /** + * Get the hyperV property: Number of servers on HyperV. + * + * @return the hyperV value. + */ + public Integer hyperV() { + return this.hyperV; + } + + /** + * Get the physical property: Number of physical servers. + * + * @return the physical value. + */ + public Integer physical() { + return this.physical; + } + + /** + * Get the notApplicable property: Number of servers whose virtualization is unknown. + * + * @return the notApplicable value. + */ + public Integer notApplicable() { + return this.notApplicable; + } + + /** + * 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 ServersDiscovered from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServersDiscovered 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 ServersDiscovered. + */ + public static ServersDiscovered fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServersDiscovered deserializedServersDiscovered = new ServersDiscovered(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmWare".equals(fieldName)) { + deserializedServersDiscovered.vmWare = reader.getNullable(JsonReader::getInt); + } else if ("hyperV".equals(fieldName)) { + deserializedServersDiscovered.hyperV = reader.getNullable(JsonReader::getInt); + } else if ("physical".equals(fieldName)) { + deserializedServersDiscovered.physical = reader.getNullable(JsonReader::getInt); + } else if ("notApplicable".equals(fieldName)) { + deserializedServersDiscovered.notApplicable = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedServersDiscovered; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ServicePackInsight.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ServicePackInsight.java new file mode 100644 index 000000000000..3636a516f25e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ServicePackInsight.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Service Pack Insight. + */ +@Immutable +public final class ServicePackInsight implements JsonSerializable { + /* + * Unknown support. + */ + private Integer unknownServicePack; + + /* + * Patched Service Pack Insight. + */ + private Integer patched; + + /* + * Unpatched Service Pack Insight. + */ + private Integer unpatched; + + /** + * Creates an instance of ServicePackInsight class. + */ + public ServicePackInsight() { + } + + /** + * Get the unknownServicePack property: Unknown support. + * + * @return the unknownServicePack value. + */ + public Integer unknownServicePack() { + return this.unknownServicePack; + } + + /** + * Get the patched property: Patched Service Pack Insight. + * + * @return the patched value. + */ + public Integer patched() { + return this.patched; + } + + /** + * Get the unpatched property: Unpatched Service Pack Insight. + * + * @return the unpatched value. + */ + public Integer unpatched() { + return this.unpatched; + } + + /** + * 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 ServicePackInsight from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServicePackInsight 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 ServicePackInsight. + */ + public static ServicePackInsight fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServicePackInsight deserializedServicePackInsight = new ServicePackInsight(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("unknownServicePack".equals(fieldName)) { + deserializedServicePackInsight.unknownServicePack = reader.getNullable(JsonReader::getInt); + } else if ("patched".equals(fieldName)) { + deserializedServicePackInsight.patched = reader.getNullable(JsonReader::getInt); + } else if ("unpatched".equals(fieldName)) { + deserializedServicePackInsight.unpatched = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedServicePackInsight; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Settings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Settings.java new file mode 100644 index 000000000000..1a78cd477782 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Settings.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Business case settings. + */ +@Fluent +public final class Settings implements JsonSerializable { + /* + * Azure settings for a business case. + */ + private AzureSettings azureSettings; + + /* + * On-premise settings. + */ + private OnPremiseSettings onPremiseSettings; + + /* + * Azure arc settings. + */ + private AzureArcSettings azureArcSettings; + + /** + * Creates an instance of Settings class. + */ + public Settings() { + } + + /** + * Get the azureSettings property: Azure settings for a business case. + * + * @return the azureSettings value. + */ + public AzureSettings azureSettings() { + return this.azureSettings; + } + + /** + * Set the azureSettings property: Azure settings for a business case. + * + * @param azureSettings the azureSettings value to set. + * @return the Settings object itself. + */ + public Settings withAzureSettings(AzureSettings azureSettings) { + this.azureSettings = azureSettings; + return this; + } + + /** + * Get the onPremiseSettings property: On-premise settings. + * + * @return the onPremiseSettings value. + */ + public OnPremiseSettings onPremiseSettings() { + return this.onPremiseSettings; + } + + /** + * Set the onPremiseSettings property: On-premise settings. + * + * @param onPremiseSettings the onPremiseSettings value to set. + * @return the Settings object itself. + */ + public Settings withOnPremiseSettings(OnPremiseSettings onPremiseSettings) { + this.onPremiseSettings = onPremiseSettings; + return this; + } + + /** + * Get the azureArcSettings property: Azure arc settings. + * + * @return the azureArcSettings value. + */ + public AzureArcSettings azureArcSettings() { + return this.azureArcSettings; + } + + /** + * Set the azureArcSettings property: Azure arc settings. + * + * @param azureArcSettings the azureArcSettings value to set. + * @return the Settings object itself. + */ + public Settings withAzureArcSettings(AzureArcSettings azureArcSettings) { + this.azureArcSettings = azureArcSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureSettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property azureSettings in model Settings")); + } else { + azureSettings().validate(); + } + if (onPremiseSettings() != null) { + onPremiseSettings().validate(); + } + if (azureArcSettings() != null) { + azureArcSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Settings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("azureSettings", this.azureSettings); + jsonWriter.writeJsonField("onPremiseSettings", this.onPremiseSettings); + jsonWriter.writeJsonField("azureArcSettings", this.azureArcSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Settings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Settings 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 Settings. + */ + public static Settings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Settings deserializedSettings = new Settings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureSettings".equals(fieldName)) { + deserializedSettings.azureSettings = AzureSettings.fromJson(reader); + } else if ("onPremiseSettings".equals(fieldName)) { + deserializedSettings.onPremiseSettings = OnPremiseSettings.fromJson(reader); + } else if ("azureArcSettings".equals(fieldName)) { + deserializedSettings.azureArcSettings = AzureArcSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SharedResourcesDto.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SharedResourcesDto.java deleted file mode 100644 index 9e0948cf6143..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SharedResourcesDto.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Shared Resources. - */ -@Immutable -public final class SharedResourcesDto implements JsonSerializable { - /* - * Gets the list of shared data disks. - */ - private List sharedDataDisks; - - /* - * Gets the list of shared log disks. - */ - private List sharedLogDisks; - - /* - * Gets the list of shared Temporary database disks. - */ - private List sharedTempDbDisks; - - /* - * Gets number of mounts of shared disks. - */ - private Integer numberOfMounts; - - /* - * Gets quorum witness. - */ - private AzureQuorumWitnessDto quorumWitness; - - /** - * Creates an instance of SharedResourcesDto class. - */ - public SharedResourcesDto() { - } - - /** - * Get the sharedDataDisks property: Gets the list of shared data disks. - * - * @return the sharedDataDisks value. - */ - public List sharedDataDisks() { - return this.sharedDataDisks; - } - - /** - * Get the sharedLogDisks property: Gets the list of shared log disks. - * - * @return the sharedLogDisks value. - */ - public List sharedLogDisks() { - return this.sharedLogDisks; - } - - /** - * Get the sharedTempDbDisks property: Gets the list of shared Temporary database disks. - * - * @return the sharedTempDbDisks value. - */ - public List sharedTempDbDisks() { - return this.sharedTempDbDisks; - } - - /** - * Get the numberOfMounts property: Gets number of mounts of shared disks. - * - * @return the numberOfMounts value. - */ - public Integer numberOfMounts() { - return this.numberOfMounts; - } - - /** - * Get the quorumWitness property: Gets quorum witness. - * - * @return the quorumWitness value. - */ - public AzureQuorumWitnessDto quorumWitness() { - return this.quorumWitness; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sharedDataDisks() != null) { - sharedDataDisks().forEach(e -> e.validate()); - } - if (sharedLogDisks() != null) { - sharedLogDisks().forEach(e -> e.validate()); - } - if (sharedTempDbDisks() != null) { - sharedTempDbDisks().forEach(e -> e.validate()); - } - if (quorumWitness() != null) { - quorumWitness().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SharedResourcesDto from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SharedResourcesDto 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 SharedResourcesDto. - */ - public static SharedResourcesDto fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SharedResourcesDto deserializedSharedResourcesDto = new SharedResourcesDto(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sharedDataDisks".equals(fieldName)) { - List sharedDataDisks - = reader.readArray(reader1 -> AzureManagedDiskSkuDto.fromJson(reader1)); - deserializedSharedResourcesDto.sharedDataDisks = sharedDataDisks; - } else if ("sharedLogDisks".equals(fieldName)) { - List sharedLogDisks - = reader.readArray(reader1 -> AzureManagedDiskSkuDto.fromJson(reader1)); - deserializedSharedResourcesDto.sharedLogDisks = sharedLogDisks; - } else if ("sharedTempDbDisks".equals(fieldName)) { - List sharedTempDbDisks - = reader.readArray(reader1 -> AzureManagedDiskSkuDto.fromJson(reader1)); - deserializedSharedResourcesDto.sharedTempDbDisks = sharedTempDbDisks; - } else if ("numberOfMounts".equals(fieldName)) { - deserializedSharedResourcesDto.numberOfMounts = reader.getNullable(JsonReader::getInt); - } else if ("quorumWitness".equals(fieldName)) { - deserializedSharedResourcesDto.quorumWitness = AzureQuorumWitnessDto.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSharedResourcesDto; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuDetails.java new file mode 100644 index 000000000000..deaa45d4f615 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuDetails.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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 -> SkuDetailsCapabilitiesItem.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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuDetailsCapabilitiesItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuDetailsCapabilitiesItem.java new file mode 100644 index 000000000000..32287df727d3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuDetailsCapabilitiesItem.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SkuDetailsCapabilitiesItem implements JsonSerializable { + /* + * The name. + */ + private String name; + + /* + * The value. + */ + private String value; + + /** + * Creates an instance of SkuDetailsCapabilitiesItem class. + */ + public SkuDetailsCapabilitiesItem() { + } + + /** + * 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 SkuDetailsCapabilitiesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuDetailsCapabilitiesItem 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 SkuDetailsCapabilitiesItem. + */ + public static SkuDetailsCapabilitiesItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuDetailsCapabilitiesItem deserializedSkuDetailsCapabilitiesItem = new SkuDetailsCapabilitiesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSkuDetailsCapabilitiesItem.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedSkuDetailsCapabilitiesItem.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSkuDetailsCapabilitiesItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuKind.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuKind.java new file mode 100644 index 000000000000..17d89ebf5b62 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuKind.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Sku Kind. + */ +public final class SkuKind extends ExpandableStringEnum { + /** + * Static value Endpoint for SkuKind. + */ + public static final SkuKind ENDPOINT = fromString("Endpoint"); + + /** + * Static value Details for SkuKind. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuReplicationMode.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuReplicationMode.java index b88a07962eb8..ae29f8db855a 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuReplicationMode.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuReplicationMode.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for SkuReplicationMode. + * Sku Replication Mode. */ public final class SkuReplicationMode extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuType.java new file mode 100644 index 000000000000..fc3026998861 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SkuType.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Sku type. + */ +public final class SkuType extends ExpandableStringEnum { + /** + * Static value Unknown for SkuType. + */ + public static final SkuType UNKNOWN = fromString("Unknown"); + + /** + * Static value Compute for SkuType. + */ + public static final SkuType COMPUTE = fromString("Compute"); + + /** + * Static value Storage for SkuType. + */ + public static final SkuType STORAGE = fromString("Storage"); + + /** + * Static value Network for SkuType. + */ + public static final SkuType NETWORK = fromString("Network"); + + /** + * Static value AppServicePlan for SkuType. + */ + public static final SkuType APP_SERVICE_PLAN = fromString("AppServicePlan"); + + /** + * Static value AzureSpringApps for SkuType. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SourceDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SourceDetails.java new file mode 100644 index 000000000000..98e188b91c92 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SourceDetails.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessedNetworkAdapter.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessedNetworkAdapter.java deleted file mode 100644 index 91c090ff3c94..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessedNetworkAdapter.java +++ /dev/null @@ -1,372 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * SQL Assessed Network Adapter. - */ -@Fluent -public final class SqlAssessedNetworkAdapter implements JsonSerializable { - /* - * Gets the suitability. - */ - private CloudSuitability suitability; - - /* - * Gets the suitability detail. - */ - private AzureNetworkAdapterSuitabilityDetail suitabilityDetail; - - /* - * Gets the suitability explanation. - */ - private AzureNetworkAdapterSuitabilityExplanation suitabilityExplanation; - - /* - * Gets the monthly bandwidth costs. - */ - private Float monthlyBandwidthCosts; - - /* - * Gets the net gigabytes transmitted per month. - */ - private Float netGigabytesTransmittedPerMonth; - - /* - * Gets the name. - */ - private String name; - - /* - * Gets the display name. - */ - private String displayName; - - /* - * Gets the mac address. - */ - private String macAddress; - - /* - * Gets the ip addresses. - */ - private List ipAddresses; - - /* - * Gets the megabytes per second received. - */ - private Float megabytesPerSecondReceived; - - /* - * Gets the megabytes per second transmitted. - */ - private Float megabytesPerSecondTransmitted; - - /** - * Creates an instance of SqlAssessedNetworkAdapter class. - */ - public SqlAssessedNetworkAdapter() { - } - - /** - * Get the suitability property: Gets the suitability. - * - * @return the suitability value. - */ - public CloudSuitability suitability() { - return this.suitability; - } - - /** - * Set the suitability property: Gets the suitability. - * - * @param suitability the suitability value to set. - * @return the SqlAssessedNetworkAdapter object itself. - */ - public SqlAssessedNetworkAdapter withSuitability(CloudSuitability suitability) { - this.suitability = suitability; - return this; - } - - /** - * Get the suitabilityDetail property: Gets the suitability detail. - * - * @return the suitabilityDetail value. - */ - public AzureNetworkAdapterSuitabilityDetail suitabilityDetail() { - return this.suitabilityDetail; - } - - /** - * Set the suitabilityDetail property: Gets the suitability detail. - * - * @param suitabilityDetail the suitabilityDetail value to set. - * @return the SqlAssessedNetworkAdapter object itself. - */ - public SqlAssessedNetworkAdapter withSuitabilityDetail(AzureNetworkAdapterSuitabilityDetail suitabilityDetail) { - this.suitabilityDetail = suitabilityDetail; - return this; - } - - /** - * Get the suitabilityExplanation property: Gets the suitability explanation. - * - * @return the suitabilityExplanation value. - */ - public AzureNetworkAdapterSuitabilityExplanation suitabilityExplanation() { - return this.suitabilityExplanation; - } - - /** - * Set the suitabilityExplanation property: Gets the suitability explanation. - * - * @param suitabilityExplanation the suitabilityExplanation value to set. - * @return the SqlAssessedNetworkAdapter object itself. - */ - public SqlAssessedNetworkAdapter - withSuitabilityExplanation(AzureNetworkAdapterSuitabilityExplanation suitabilityExplanation) { - this.suitabilityExplanation = suitabilityExplanation; - return this; - } - - /** - * Get the monthlyBandwidthCosts property: Gets the monthly bandwidth costs. - * - * @return the monthlyBandwidthCosts value. - */ - public Float monthlyBandwidthCosts() { - return this.monthlyBandwidthCosts; - } - - /** - * Set the monthlyBandwidthCosts property: Gets the monthly bandwidth costs. - * - * @param monthlyBandwidthCosts the monthlyBandwidthCosts value to set. - * @return the SqlAssessedNetworkAdapter object itself. - */ - public SqlAssessedNetworkAdapter withMonthlyBandwidthCosts(Float monthlyBandwidthCosts) { - this.monthlyBandwidthCosts = monthlyBandwidthCosts; - return this; - } - - /** - * Get the netGigabytesTransmittedPerMonth property: Gets the net gigabytes transmitted per month. - * - * @return the netGigabytesTransmittedPerMonth value. - */ - public Float netGigabytesTransmittedPerMonth() { - return this.netGigabytesTransmittedPerMonth; - } - - /** - * Set the netGigabytesTransmittedPerMonth property: Gets the net gigabytes transmitted per month. - * - * @param netGigabytesTransmittedPerMonth the netGigabytesTransmittedPerMonth value to set. - * @return the SqlAssessedNetworkAdapter object itself. - */ - public SqlAssessedNetworkAdapter withNetGigabytesTransmittedPerMonth(Float netGigabytesTransmittedPerMonth) { - this.netGigabytesTransmittedPerMonth = netGigabytesTransmittedPerMonth; - return this; - } - - /** - * Get the name property: Gets the name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets the name. - * - * @param name the name value to set. - * @return the SqlAssessedNetworkAdapter object itself. - */ - public SqlAssessedNetworkAdapter withName(String name) { - this.name = name; - return this; - } - - /** - * Get the displayName property: Gets the display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Gets the display name. - * - * @param displayName the displayName value to set. - * @return the SqlAssessedNetworkAdapter object itself. - */ - public SqlAssessedNetworkAdapter withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the macAddress property: Gets the mac address. - * - * @return the macAddress value. - */ - public String macAddress() { - return this.macAddress; - } - - /** - * Set the macAddress property: Gets the mac address. - * - * @param macAddress the macAddress value to set. - * @return the SqlAssessedNetworkAdapter object itself. - */ - public SqlAssessedNetworkAdapter withMacAddress(String macAddress) { - this.macAddress = macAddress; - return this; - } - - /** - * Get the ipAddresses property: Gets the ip addresses. - * - * @return the ipAddresses value. - */ - public List ipAddresses() { - return this.ipAddresses; - } - - /** - * Get the megabytesPerSecondReceived property: Gets the megabytes per second received. - * - * @return the megabytesPerSecondReceived value. - */ - public Float megabytesPerSecondReceived() { - return this.megabytesPerSecondReceived; - } - - /** - * Set the megabytesPerSecondReceived property: Gets the megabytes per second received. - * - * @param megabytesPerSecondReceived the megabytesPerSecondReceived value to set. - * @return the SqlAssessedNetworkAdapter object itself. - */ - public SqlAssessedNetworkAdapter withMegabytesPerSecondReceived(Float megabytesPerSecondReceived) { - this.megabytesPerSecondReceived = megabytesPerSecondReceived; - return this; - } - - /** - * Get the megabytesPerSecondTransmitted property: Gets the megabytes per second transmitted. - * - * @return the megabytesPerSecondTransmitted value. - */ - public Float megabytesPerSecondTransmitted() { - return this.megabytesPerSecondTransmitted; - } - - /** - * Set the megabytesPerSecondTransmitted property: Gets the megabytes per second transmitted. - * - * @param megabytesPerSecondTransmitted the megabytesPerSecondTransmitted value to set. - * @return the SqlAssessedNetworkAdapter object itself. - */ - public SqlAssessedNetworkAdapter withMegabytesPerSecondTransmitted(Float megabytesPerSecondTransmitted) { - this.megabytesPerSecondTransmitted = megabytesPerSecondTransmitted; - 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("suitability", this.suitability == null ? null : this.suitability.toString()); - jsonWriter.writeStringField("suitabilityDetail", - this.suitabilityDetail == null ? null : this.suitabilityDetail.toString()); - jsonWriter.writeStringField("suitabilityExplanation", - this.suitabilityExplanation == null ? null : this.suitabilityExplanation.toString()); - jsonWriter.writeNumberField("monthlyBandwidthCosts", this.monthlyBandwidthCosts); - jsonWriter.writeNumberField("netGigabytesTransmittedPerMonth", this.netGigabytesTransmittedPerMonth); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("macAddress", this.macAddress); - jsonWriter.writeNumberField("megabytesPerSecondReceived", this.megabytesPerSecondReceived); - jsonWriter.writeNumberField("megabytesPerSecondTransmitted", this.megabytesPerSecondTransmitted); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SqlAssessedNetworkAdapter from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlAssessedNetworkAdapter 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 SqlAssessedNetworkAdapter. - */ - public static SqlAssessedNetworkAdapter fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlAssessedNetworkAdapter deserializedSqlAssessedNetworkAdapter = new SqlAssessedNetworkAdapter(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("suitability".equals(fieldName)) { - deserializedSqlAssessedNetworkAdapter.suitability = CloudSuitability.fromString(reader.getString()); - } else if ("suitabilityDetail".equals(fieldName)) { - deserializedSqlAssessedNetworkAdapter.suitabilityDetail - = AzureNetworkAdapterSuitabilityDetail.fromString(reader.getString()); - } else if ("suitabilityExplanation".equals(fieldName)) { - deserializedSqlAssessedNetworkAdapter.suitabilityExplanation - = AzureNetworkAdapterSuitabilityExplanation.fromString(reader.getString()); - } else if ("monthlyBandwidthCosts".equals(fieldName)) { - deserializedSqlAssessedNetworkAdapter.monthlyBandwidthCosts - = reader.getNullable(JsonReader::getFloat); - } else if ("netGigabytesTransmittedPerMonth".equals(fieldName)) { - deserializedSqlAssessedNetworkAdapter.netGigabytesTransmittedPerMonth - = reader.getNullable(JsonReader::getFloat); - } else if ("name".equals(fieldName)) { - deserializedSqlAssessedNetworkAdapter.name = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedSqlAssessedNetworkAdapter.displayName = reader.getString(); - } else if ("macAddress".equals(fieldName)) { - deserializedSqlAssessedNetworkAdapter.macAddress = reader.getString(); - } else if ("ipAddresses".equals(fieldName)) { - List ipAddresses = reader.readArray(reader1 -> reader1.getString()); - deserializedSqlAssessedNetworkAdapter.ipAddresses = ipAddresses; - } else if ("megabytesPerSecondReceived".equals(fieldName)) { - deserializedSqlAssessedNetworkAdapter.megabytesPerSecondReceived - = reader.getNullable(JsonReader::getFloat); - } else if ("megabytesPerSecondTransmitted".equals(fieldName)) { - deserializedSqlAssessedNetworkAdapter.megabytesPerSecondTransmitted - = reader.getNullable(JsonReader::getFloat); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlAssessedNetworkAdapter; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentMigrationIssue.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentMigrationIssue.java index 223689a8287c..0cc898ee08ec 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentMigrationIssue.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentMigrationIssue.java @@ -18,14 +18,34 @@ @Immutable public final class SqlAssessmentMigrationIssue implements JsonSerializable { /* - * Gets the issue id. + * The issue id. */ - private String issueId; + private String issueCode; /* - * Gets the issue category. + * The issue category. */ - private SqlAssessmentMigrationIssueCategory issueCategory; + 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; /* * Gets the list of impacted objects. @@ -39,23 +59,59 @@ public SqlAssessmentMigrationIssue() { } /** - * Get the issueId property: Gets the issue id. + * Get the issueCode property: The issue id. * - * @return the issueId value. + * @return the issueCode value. */ - public String issueId() { - return this.issueId; + public String issueCode() { + return this.issueCode; } /** - * Get the issueCategory property: Gets the issue category. + * Get the issueCategory property: The issue category. * * @return the issueCategory value. */ - public SqlAssessmentMigrationIssueCategory issueCategory() { + 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; + } + /** * Get the impactedObjects property: Gets the list of impacted objects. * @@ -71,6 +127,9 @@ public List impactedObjects() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (moreInformation() != null) { + moreInformation().forEach(e -> e.validate()); + } if (impactedObjects() != null) { impactedObjects().forEach(e -> e.validate()); } @@ -100,11 +159,22 @@ public static SqlAssessmentMigrationIssue fromJson(JsonReader jsonReader) throws String fieldName = reader.getFieldName(); reader.nextToken(); - if ("issueId".equals(fieldName)) { - deserializedSqlAssessmentMigrationIssue.issueId = reader.getString(); + if ("issueCode".equals(fieldName)) { + deserializedSqlAssessmentMigrationIssue.issueCode = reader.getString(); } else if ("issueCategory".equals(fieldName)) { deserializedSqlAssessmentMigrationIssue.issueCategory - = SqlAssessmentMigrationIssueCategory.fromString(reader.getString()); + = MigrationIssuesCategory.fromString(reader.getString()); + } else if ("issueDescription".equals(fieldName)) { + deserializedSqlAssessmentMigrationIssue.issueDescription = reader.getString(); + } else if ("possibleCause".equals(fieldName)) { + deserializedSqlAssessmentMigrationIssue.possibleCause = reader.getString(); + } else if ("recommendedActions".equals(fieldName)) { + List recommendedActions = reader.readArray(reader1 -> reader1.getString()); + deserializedSqlAssessmentMigrationIssue.recommendedActions = recommendedActions; + } else if ("moreInformation".equals(fieldName)) { + List moreInformation + = reader.readArray(reader1 -> MoreInformation.fromJson(reader1)); + deserializedSqlAssessmentMigrationIssue.moreInformation = moreInformation; } else if ("impactedObjects".equals(fieldName)) { List impactedObjects = reader.readArray(reader1 -> ImpactedAssessmentObject.fromJson(reader1)); diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentMigrationIssueCategory.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentMigrationIssueCategory.java deleted file mode 100644 index 3bf4079b0039..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentMigrationIssueCategory.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for SqlAssessmentMigrationIssueCategory. - */ -public final class SqlAssessmentMigrationIssueCategory - extends ExpandableStringEnum { - /** - * Static value Issue for SqlAssessmentMigrationIssueCategory. - */ - public static final SqlAssessmentMigrationIssueCategory ISSUE = fromString("Issue"); - - /** - * Static value Warning for SqlAssessmentMigrationIssueCategory. - */ - public static final SqlAssessmentMigrationIssueCategory WARNING = fromString("Warning"); - - /** - * Static value Internal for SqlAssessmentMigrationIssueCategory. - */ - public static final SqlAssessmentMigrationIssueCategory INTERNAL = fromString("Internal"); - - /** - * Creates a new instance of SqlAssessmentMigrationIssueCategory value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SqlAssessmentMigrationIssueCategory() { - } - - /** - * Creates or finds a SqlAssessmentMigrationIssueCategory from its string representation. - * - * @param name a name to look for. - * @return the corresponding SqlAssessmentMigrationIssueCategory. - */ - public static SqlAssessmentMigrationIssueCategory fromString(String name) { - return fromString(name, SqlAssessmentMigrationIssueCategory.class); - } - - /** - * Gets known SqlAssessmentMigrationIssueCategory values. - * - * @return known SqlAssessmentMigrationIssueCategory values. - */ - public static Collection values() { - return values(SqlAssessmentMigrationIssueCategory.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentOptions.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentOptions.java deleted file mode 100644 index 5a18b1eab84c..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentOptions.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentOptionsInner; - -/** - * An immutable client-side representation of SqlAssessmentOptions. - */ -public interface SqlAssessmentOptions { - /** - * 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. - */ - SqlAssessmentOptionsProperties 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.migration.assessment.fluent.models.SqlAssessmentOptionsInner object. - * - * @return the inner object. - */ - SqlAssessmentOptionsInner innerModel(); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentOptionsListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentOptionsListResult.java deleted file mode 100644 index 6ef8f88b32e1..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentOptionsListResult.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -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.migration.assessment.fluent.models.SqlAssessmentOptionsInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a SqlAssessmentOptions list operation. - */ -@Fluent -public final class SqlAssessmentOptionsListResult implements JsonSerializable { - /* - * The SqlAssessmentOptions items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of SqlAssessmentOptionsListResult class. - */ - public SqlAssessmentOptionsListResult() { - } - - /** - * Get the value property: The SqlAssessmentOptions items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The SqlAssessmentOptions items on this page. - * - * @param value the value value to set. - * @return the SqlAssessmentOptionsListResult object itself. - */ - public SqlAssessmentOptionsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the SqlAssessmentOptionsListResult object itself. - */ - public SqlAssessmentOptionsListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * 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 SqlAssessmentOptionsListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SqlAssessmentOptionsListResult.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 SqlAssessmentOptionsListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlAssessmentOptionsListResult 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 SqlAssessmentOptionsListResult. - */ - public static SqlAssessmentOptionsListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlAssessmentOptionsListResult deserializedSqlAssessmentOptionsListResult - = new SqlAssessmentOptionsListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SqlAssessmentOptionsInner.fromJson(reader1)); - deserializedSqlAssessmentOptionsListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSqlAssessmentOptionsListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlAssessmentOptionsListResult; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentOptionsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentOptionsOperations.java deleted file mode 100644 index f4ef05007e92..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentOptionsOperations.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 SqlAssessmentOptionsOperations. - */ -public interface SqlAssessmentOptionsOperations { - /** - * List SqlAssessmentOptions 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 SqlAssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); - - /** - * List SqlAssessmentOptions 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 SqlAssessmentOptions list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); - - /** - * Get a SqlAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName Sql assessment options ARM name. Accepted values is 'default'. - * @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 SqlAssessmentOptions along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String projectName, - String assessmentOptionsName, Context context); - - /** - * Get a SqlAssessmentOptions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param assessmentOptionsName Sql assessment options ARM name. Accepted values is 'default'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 SqlAssessmentOptions. - */ - SqlAssessmentOptions get(String resourceGroupName, String projectName, String assessmentOptionsName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentOptionsOutboundEdgeGroup.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentOptionsOutboundEdgeGroup.java new file mode 100644 index 000000000000..e5412612e13e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentOptionsOutboundEdgeGroup.java @@ -0,0 +1,541 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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. + */ +@Fluent +public final class SqlAssessmentOptionsOutboundEdgeGroup + 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 SQL Compute tiers. + */ + private List computeTiers; + + /* + * Gets or sets the Azure SQL Hardware generations. + */ + private List hardwareGenerations; + + /* + * Gets or sets the Azure SQL target types. + */ + private List targetTypes; + + /* + * Gets or sets the Azure SQL service tiers. + */ + private List serviceTiers; + + /* + * 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 Azure Offer Code. + */ + private List azureOfferCode; + + /* + * Gets or sets the Azure Offer Code. + */ + private List azureOfferCodeForVm; + + /** + * Creates an instance of SqlAssessmentOptionsOutboundEdgeGroup class. + */ + public SqlAssessmentOptionsOutboundEdgeGroup() { + } + + /** + * Get the targetLocations property: Gets or sets the Azure Locations. + * + * @return the targetLocations value. + */ + public List targetLocations() { + return this.targetLocations; + } + + /** + * Set the targetLocations property: Gets or sets the Azure Locations. + * + * @param targetLocations the targetLocations value to set. + * @return the SqlAssessmentOptionsOutboundEdgeGroup object itself. + */ + public SqlAssessmentOptionsOutboundEdgeGroup withTargetLocations(List targetLocations) { + this.targetLocations = targetLocations; + return this; + } + + /** + * Get the currencies property: Gets or sets the Azure Currency. + * + * @return the currencies value. + */ + public List currencies() { + return this.currencies; + } + + /** + * Set the currencies property: Gets or sets the Azure Currency. + * + * @param currencies the currencies value to set. + * @return the SqlAssessmentOptionsOutboundEdgeGroup object itself. + */ + public SqlAssessmentOptionsOutboundEdgeGroup withCurrencies(List currencies) { + this.currencies = currencies; + return this; + } + + /** + * Get the savingsOptions property: Gets or sets the Assessment Savings Options. + * + * @return the savingsOptions value. + */ + public List savingsOptions() { + return this.savingsOptions; + } + + /** + * Set the savingsOptions property: Gets or sets the Assessment Savings Options. + * + * @param savingsOptions the savingsOptions value to set. + * @return the SqlAssessmentOptionsOutboundEdgeGroup object itself. + */ + public SqlAssessmentOptionsOutboundEdgeGroup withSavingsOptions(List savingsOptions) { + this.savingsOptions = savingsOptions; + return this; + } + + /** + * Get the licensingProgram property: Gets or sets the Licensing Program. + * + * @return the licensingProgram value. + */ + public List licensingProgram() { + return this.licensingProgram; + } + + /** + * Set the licensingProgram property: Gets or sets the Licensing Program. + * + * @param licensingProgram the licensingProgram value to set. + * @return the SqlAssessmentOptionsOutboundEdgeGroup object itself. + */ + public SqlAssessmentOptionsOutboundEdgeGroup withLicensingProgram(List licensingProgram) { + this.licensingProgram = licensingProgram; + return this; + } + + /** + * Get the computeTiers property: Gets or sets the Azure SQL Compute tiers. + * + * @return the computeTiers value. + */ + public List computeTiers() { + return this.computeTiers; + } + + /** + * Set the computeTiers property: Gets or sets the Azure SQL Compute tiers. + * + * @param computeTiers the computeTiers value to set. + * @return the SqlAssessmentOptionsOutboundEdgeGroup object itself. + */ + public SqlAssessmentOptionsOutboundEdgeGroup withComputeTiers(List computeTiers) { + this.computeTiers = computeTiers; + return this; + } + + /** + * Get the hardwareGenerations property: Gets or sets the Azure SQL Hardware generations. + * + * @return the hardwareGenerations value. + */ + public List hardwareGenerations() { + return this.hardwareGenerations; + } + + /** + * Set the hardwareGenerations property: Gets or sets the Azure SQL Hardware generations. + * + * @param hardwareGenerations the hardwareGenerations value to set. + * @return the SqlAssessmentOptionsOutboundEdgeGroup object itself. + */ + public SqlAssessmentOptionsOutboundEdgeGroup withHardwareGenerations(List hardwareGenerations) { + this.hardwareGenerations = hardwareGenerations; + return this; + } + + /** + * Get the targetTypes property: Gets or sets the Azure SQL target types. + * + * @return the targetTypes value. + */ + public List targetTypes() { + return this.targetTypes; + } + + /** + * Set the targetTypes property: Gets or sets the Azure SQL target types. + * + * @param targetTypes the targetTypes value to set. + * @return the SqlAssessmentOptionsOutboundEdgeGroup object itself. + */ + public SqlAssessmentOptionsOutboundEdgeGroup withTargetTypes(List targetTypes) { + this.targetTypes = targetTypes; + return this; + } + + /** + * Get the serviceTiers property: Gets or sets the Azure SQL service tiers. + * + * @return the serviceTiers value. + */ + public List serviceTiers() { + return this.serviceTiers; + } + + /** + * Set the serviceTiers property: Gets or sets the Azure SQL service tiers. + * + * @param serviceTiers the serviceTiers value to set. + * @return the SqlAssessmentOptionsOutboundEdgeGroup object itself. + */ + public SqlAssessmentOptionsOutboundEdgeGroup withServiceTiers(List serviceTiers) { + this.serviceTiers = serviceTiers; + 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 SqlAssessmentOptionsOutboundEdgeGroup object itself. + */ + public SqlAssessmentOptionsOutboundEdgeGroup withAzureVmFamilies(List azureVmFamilies) { + this.azureVmFamilies = azureVmFamilies; + return this; + } + + /** + * Get the azureVmFamilyCategories property: Gets or sets the Azure VM family categories. + * + * @return the azureVmFamilyCategories value. + */ + public List azureVmFamilyCategories() { + return this.azureVmFamilyCategories; + } + + /** + * Set the azureVmFamilyCategories property: Gets or sets the Azure VM family categories. + * + * @param azureVmFamilyCategories the azureVmFamilyCategories value to set. + * @return the SqlAssessmentOptionsOutboundEdgeGroup object itself. + */ + public SqlAssessmentOptionsOutboundEdgeGroup + withAzureVmFamilyCategories(List azureVmFamilyCategories) { + this.azureVmFamilyCategories = azureVmFamilyCategories; + return this; + } + + /** + * Get the premiumDiskSupport property: Gets or sets the premium disk support. + * + * @return the premiumDiskSupport value. + */ + public List premiumDiskSupport() { + return this.premiumDiskSupport; + } + + /** + * Set the premiumDiskSupport property: Gets or sets the premium disk support. + * + * @param premiumDiskSupport the premiumDiskSupport value to set. + * @return the SqlAssessmentOptionsOutboundEdgeGroup object itself. + */ + public SqlAssessmentOptionsOutboundEdgeGroup withPremiumDiskSupport(List premiumDiskSupport) { + this.premiumDiskSupport = premiumDiskSupport; + return this; + } + + /** + * Get the azureOfferCode property: Gets or sets the Azure Offer Code. + * + * @return the azureOfferCode value. + */ + public List azureOfferCode() { + return this.azureOfferCode; + } + + /** + * Set the azureOfferCode property: Gets or sets the Azure Offer Code. + * + * @param azureOfferCode the azureOfferCode value to set. + * @return the SqlAssessmentOptionsOutboundEdgeGroup object itself. + */ + public SqlAssessmentOptionsOutboundEdgeGroup withAzureOfferCode(List azureOfferCode) { + this.azureOfferCode = azureOfferCode; + return this; + } + + /** + * Get the azureOfferCodeForVm property: Gets or sets the Azure Offer Code. + * + * @return the azureOfferCodeForVm value. + */ + public List azureOfferCodeForVm() { + return this.azureOfferCodeForVm; + } + + /** + * Set the azureOfferCodeForVm property: Gets or sets the Azure Offer Code. + * + * @param azureOfferCodeForVm the azureOfferCodeForVm value to set. + * @return the SqlAssessmentOptionsOutboundEdgeGroup object itself. + */ + public SqlAssessmentOptionsOutboundEdgeGroup withAzureOfferCodeForVm(List azureOfferCodeForVm) { + this.azureOfferCodeForVm = azureOfferCodeForVm; + return this; + } + + /** + * 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 SqlAssessmentOptionsOutboundEdgeGroup")); + } + if (currencies() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property currencies in model SqlAssessmentOptionsOutboundEdgeGroup")); + } + if (savingsOptions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property savingsOptions in model SqlAssessmentOptionsOutboundEdgeGroup")); + } + if (licensingProgram() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property licensingProgram in model SqlAssessmentOptionsOutboundEdgeGroup")); + } + if (computeTiers() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property computeTiers in model SqlAssessmentOptionsOutboundEdgeGroup")); + } + if (hardwareGenerations() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property hardwareGenerations in model SqlAssessmentOptionsOutboundEdgeGroup")); + } + if (targetTypes() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetTypes in model SqlAssessmentOptionsOutboundEdgeGroup")); + } + if (serviceTiers() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property serviceTiers in model SqlAssessmentOptionsOutboundEdgeGroup")); + } + if (azureVmFamilies() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property azureVmFamilies in model SqlAssessmentOptionsOutboundEdgeGroup")); + } + if (azureVmFamilyCategories() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property azureVmFamilyCategories in model SqlAssessmentOptionsOutboundEdgeGroup")); + } + if (premiumDiskSupport() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property premiumDiskSupport in model SqlAssessmentOptionsOutboundEdgeGroup")); + } + if (azureOfferCode() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property azureOfferCode in model SqlAssessmentOptionsOutboundEdgeGroup")); + } + if (azureOfferCodeForVm() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property azureOfferCodeForVm in model SqlAssessmentOptionsOutboundEdgeGroup")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SqlAssessmentOptionsOutboundEdgeGroup.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("computeTiers", this.computeTiers, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("hardwareGenerations", this.hardwareGenerations, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("targetTypes", this.targetTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("serviceTiers", this.serviceTiers, + (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("azureOfferCode", this.azureOfferCode, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("azureOfferCodeForVm", this.azureOfferCodeForVm, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlAssessmentOptionsOutboundEdgeGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlAssessmentOptionsOutboundEdgeGroup 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 SqlAssessmentOptionsOutboundEdgeGroup. + */ + public static SqlAssessmentOptionsOutboundEdgeGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlAssessmentOptionsOutboundEdgeGroup deserializedSqlAssessmentOptionsOutboundEdgeGroup + = new SqlAssessmentOptionsOutboundEdgeGroup(); + 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())); + deserializedSqlAssessmentOptionsOutboundEdgeGroup.targetLocations = targetLocations; + } else if ("currencies".equals(fieldName)) { + List currencies + = reader.readArray(reader1 -> AzureCurrency.fromString(reader1.getString())); + deserializedSqlAssessmentOptionsOutboundEdgeGroup.currencies = currencies; + } else if ("savingsOptions".equals(fieldName)) { + List savingsOptions + = reader.readArray(reader1 -> SavingsOptions.fromString(reader1.getString())); + deserializedSqlAssessmentOptionsOutboundEdgeGroup.savingsOptions = savingsOptions; + } else if ("licensingProgram".equals(fieldName)) { + List licensingProgram + = reader.readArray(reader1 -> LicensingProgram.fromString(reader1.getString())); + deserializedSqlAssessmentOptionsOutboundEdgeGroup.licensingProgram = licensingProgram; + } else if ("computeTiers".equals(fieldName)) { + List computeTiers + = reader.readArray(reader1 -> ComputeTier.fromString(reader1.getString())); + deserializedSqlAssessmentOptionsOutboundEdgeGroup.computeTiers = computeTiers; + } else if ("hardwareGenerations".equals(fieldName)) { + List hardwareGenerations + = reader.readArray(reader1 -> HardwareGeneration.fromString(reader1.getString())); + deserializedSqlAssessmentOptionsOutboundEdgeGroup.hardwareGenerations = hardwareGenerations; + } else if ("targetTypes".equals(fieldName)) { + List targetTypes + = reader.readArray(reader1 -> TargetType.fromString(reader1.getString())); + deserializedSqlAssessmentOptionsOutboundEdgeGroup.targetTypes = targetTypes; + } else if ("serviceTiers".equals(fieldName)) { + List serviceTiers + = reader.readArray(reader1 -> AzureSqlServiceTier.fromString(reader1.getString())); + deserializedSqlAssessmentOptionsOutboundEdgeGroup.serviceTiers = serviceTiers; + } else if ("azureVmFamilies".equals(fieldName)) { + List azureVmFamilies + = reader.readArray(reader1 -> AzureVmFamily.fromString(reader1.getString())); + deserializedSqlAssessmentOptionsOutboundEdgeGroup.azureVmFamilies = azureVmFamilies; + } else if ("azureVmFamilyCategories".equals(fieldName)) { + List azureVmFamilyCategories + = reader.readArray(reader1 -> VmFamilyCategoryItem.fromString(reader1.getString())); + deserializedSqlAssessmentOptionsOutboundEdgeGroup.azureVmFamilyCategories = azureVmFamilyCategories; + } else if ("premiumDiskSupport".equals(fieldName)) { + List premiumDiskSupport + = reader.readArray(reader1 -> PremiumDiskSupport.fromString(reader1.getString())); + deserializedSqlAssessmentOptionsOutboundEdgeGroup.premiumDiskSupport = premiumDiskSupport; + } else if ("azureOfferCode".equals(fieldName)) { + List azureOfferCode + = reader.readArray(reader1 -> AzureOffer.fromString(reader1.getString())); + deserializedSqlAssessmentOptionsOutboundEdgeGroup.azureOfferCode = azureOfferCode; + } else if ("azureOfferCodeForVm".equals(fieldName)) { + List azureOfferCodeForVm + = reader.readArray(reader1 -> AzureOffer.fromString(reader1.getString())); + deserializedSqlAssessmentOptionsOutboundEdgeGroup.azureOfferCodeForVm = azureOfferCodeForVm; + } else { + reader.skipChildren(); + } + } + + return deserializedSqlAssessmentOptionsOutboundEdgeGroup; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentOptionsProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentOptionsProperties.java deleted file mode 100644 index ae29471bafc0..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentOptionsProperties.java +++ /dev/null @@ -1,492 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * SQL Assessment options properties Web model object. - */ -@Fluent -public final class SqlAssessmentOptionsProperties implements JsonSerializable { - /* - * Gets the list of VM families. - */ - private List vmFamilies; - - /* - * Gets the Reserved Instance VM Families list. - */ - private List reservedInstanceVmFamilies; - - /* - * Gets the Premium disk VM Families list. - */ - private List premiumDiskVmFamilies; - - /* - * Gets or sets the Premium disk VM Families list. - */ - private List savingsPlanVmFamilies; - - /* - * Gets or sets the list of Azure locations supporting Saving Plans for IAAS. - */ - private List savingsPlanSupportedLocations; - - /* - * Gets or sets the list of Azure locations supporting Saving Plans for PAAS. - */ - private List savingsPlanSupportedLocationsForPaas; - - /* - * Gets or sets the list of Azure locations supporting Reserved Instances for IAAS. - */ - private List reservedInstanceSupportedLocationsForIaas; - - /* - * Gets or sets the list of Azure Offers supporting Saving Plans. - */ - private List savingsPlanSupportedOffers; - - /* - * Gets or sets the list of SQL target SKU properties for dropdowns. - */ - private List sqlSkus; - - /* - * Gets or sets the Reserved Instance SQL target types. - */ - private List reservedInstanceSqlTargets; - - /* - * Gets or sets the list of Azure locations supporting Reserved Instances. - */ - private List reservedInstanceSupportedLocations; - - /* - * Gets or sets the list of currencies supported for Reserved Instances. - */ - private List reservedInstanceSupportedCurrencies; - - /* - * Gets or sets the list of offers supported for Reserved Instances. - */ - private List reservedInstanceSupportedOffers; - - /* - * Gets or sets the list of offers supported for SQL assessments. - */ - private List supportedOffers; - - /** - * Creates an instance of SqlAssessmentOptionsProperties class. - */ - public SqlAssessmentOptionsProperties() { - } - - /** - * Get the vmFamilies property: Gets the list of VM families. - * - * @return the vmFamilies value. - */ - public List vmFamilies() { - return this.vmFamilies; - } - - /** - * Get the reservedInstanceVmFamilies property: Gets the Reserved Instance VM Families list. - * - * @return the reservedInstanceVmFamilies value. - */ - public List reservedInstanceVmFamilies() { - return this.reservedInstanceVmFamilies; - } - - /** - * Get the premiumDiskVmFamilies property: Gets the Premium disk VM Families list. - * - * @return the premiumDiskVmFamilies value. - */ - public List premiumDiskVmFamilies() { - return this.premiumDiskVmFamilies; - } - - /** - * Get the savingsPlanVmFamilies property: Gets or sets the Premium disk VM Families list. - * - * @return the savingsPlanVmFamilies value. - */ - public List savingsPlanVmFamilies() { - return this.savingsPlanVmFamilies; - } - - /** - * Set the savingsPlanVmFamilies property: Gets or sets the Premium disk VM Families list. - * - * @param savingsPlanVmFamilies the savingsPlanVmFamilies value to set. - * @return the SqlAssessmentOptionsProperties object itself. - */ - public SqlAssessmentOptionsProperties withSavingsPlanVmFamilies(List savingsPlanVmFamilies) { - this.savingsPlanVmFamilies = savingsPlanVmFamilies; - return this; - } - - /** - * Get the savingsPlanSupportedLocations property: Gets or sets the list of Azure locations supporting Saving Plans - * for IAAS. - * - * @return the savingsPlanSupportedLocations value. - */ - public List savingsPlanSupportedLocations() { - return this.savingsPlanSupportedLocations; - } - - /** - * Set the savingsPlanSupportedLocations property: Gets or sets the list of Azure locations supporting Saving Plans - * for IAAS. - * - * @param savingsPlanSupportedLocations the savingsPlanSupportedLocations value to set. - * @return the SqlAssessmentOptionsProperties object itself. - */ - public SqlAssessmentOptionsProperties - withSavingsPlanSupportedLocations(List savingsPlanSupportedLocations) { - this.savingsPlanSupportedLocations = savingsPlanSupportedLocations; - return this; - } - - /** - * Get the savingsPlanSupportedLocationsForPaas property: Gets or sets the list of Azure locations supporting Saving - * Plans for PAAS. - * - * @return the savingsPlanSupportedLocationsForPaas value. - */ - public List savingsPlanSupportedLocationsForPaas() { - return this.savingsPlanSupportedLocationsForPaas; - } - - /** - * Set the savingsPlanSupportedLocationsForPaas property: Gets or sets the list of Azure locations supporting Saving - * Plans for PAAS. - * - * @param savingsPlanSupportedLocationsForPaas the savingsPlanSupportedLocationsForPaas value to set. - * @return the SqlAssessmentOptionsProperties object itself. - */ - public SqlAssessmentOptionsProperties - withSavingsPlanSupportedLocationsForPaas(List savingsPlanSupportedLocationsForPaas) { - this.savingsPlanSupportedLocationsForPaas = savingsPlanSupportedLocationsForPaas; - return this; - } - - /** - * Get the reservedInstanceSupportedLocationsForIaas property: Gets or sets the list of Azure locations supporting - * Reserved Instances for IAAS. - * - * @return the reservedInstanceSupportedLocationsForIaas value. - */ - public List reservedInstanceSupportedLocationsForIaas() { - return this.reservedInstanceSupportedLocationsForIaas; - } - - /** - * Set the reservedInstanceSupportedLocationsForIaas property: Gets or sets the list of Azure locations supporting - * Reserved Instances for IAAS. - * - * @param reservedInstanceSupportedLocationsForIaas the reservedInstanceSupportedLocationsForIaas value to set. - * @return the SqlAssessmentOptionsProperties object itself. - */ - public SqlAssessmentOptionsProperties - withReservedInstanceSupportedLocationsForIaas(List reservedInstanceSupportedLocationsForIaas) { - this.reservedInstanceSupportedLocationsForIaas = reservedInstanceSupportedLocationsForIaas; - return this; - } - - /** - * Get the savingsPlanSupportedOffers property: Gets or sets the list of Azure Offers supporting Saving Plans. - * - * @return the savingsPlanSupportedOffers value. - */ - public List savingsPlanSupportedOffers() { - return this.savingsPlanSupportedOffers; - } - - /** - * Set the savingsPlanSupportedOffers property: Gets or sets the list of Azure Offers supporting Saving Plans. - * - * @param savingsPlanSupportedOffers the savingsPlanSupportedOffers value to set. - * @return the SqlAssessmentOptionsProperties object itself. - */ - public SqlAssessmentOptionsProperties - withSavingsPlanSupportedOffers(List savingsPlanSupportedOffers) { - this.savingsPlanSupportedOffers = savingsPlanSupportedOffers; - return this; - } - - /** - * Get the sqlSkus property: Gets or sets the list of SQL target SKU properties for dropdowns. - * - * @return the sqlSkus value. - */ - public List sqlSkus() { - return this.sqlSkus; - } - - /** - * Set the sqlSkus property: Gets or sets the list of SQL target SKU properties for dropdowns. - * - * @param sqlSkus the sqlSkus value to set. - * @return the SqlAssessmentOptionsProperties object itself. - */ - public SqlAssessmentOptionsProperties withSqlSkus(List sqlSkus) { - this.sqlSkus = sqlSkus; - return this; - } - - /** - * Get the reservedInstanceSqlTargets property: Gets or sets the Reserved Instance SQL target types. - * - * @return the reservedInstanceSqlTargets value. - */ - public List reservedInstanceSqlTargets() { - return this.reservedInstanceSqlTargets; - } - - /** - * Set the reservedInstanceSqlTargets property: Gets or sets the Reserved Instance SQL target types. - * - * @param reservedInstanceSqlTargets the reservedInstanceSqlTargets value to set. - * @return the SqlAssessmentOptionsProperties object itself. - */ - public SqlAssessmentOptionsProperties withReservedInstanceSqlTargets(List reservedInstanceSqlTargets) { - this.reservedInstanceSqlTargets = reservedInstanceSqlTargets; - return this; - } - - /** - * Get the reservedInstanceSupportedLocations property: Gets or sets the list of Azure locations supporting Reserved - * Instances. - * - * @return the reservedInstanceSupportedLocations value. - */ - public List reservedInstanceSupportedLocations() { - return this.reservedInstanceSupportedLocations; - } - - /** - * Set the reservedInstanceSupportedLocations property: Gets or sets the list of Azure locations supporting Reserved - * Instances. - * - * @param reservedInstanceSupportedLocations the reservedInstanceSupportedLocations value to set. - * @return the SqlAssessmentOptionsProperties object itself. - */ - public SqlAssessmentOptionsProperties - withReservedInstanceSupportedLocations(List reservedInstanceSupportedLocations) { - this.reservedInstanceSupportedLocations = reservedInstanceSupportedLocations; - return this; - } - - /** - * Get the reservedInstanceSupportedCurrencies property: Gets or sets the list of currencies supported for Reserved - * Instances. - * - * @return the reservedInstanceSupportedCurrencies value. - */ - public List reservedInstanceSupportedCurrencies() { - return this.reservedInstanceSupportedCurrencies; - } - - /** - * Set the reservedInstanceSupportedCurrencies property: Gets or sets the list of currencies supported for Reserved - * Instances. - * - * @param reservedInstanceSupportedCurrencies the reservedInstanceSupportedCurrencies value to set. - * @return the SqlAssessmentOptionsProperties object itself. - */ - public SqlAssessmentOptionsProperties - withReservedInstanceSupportedCurrencies(List reservedInstanceSupportedCurrencies) { - this.reservedInstanceSupportedCurrencies = reservedInstanceSupportedCurrencies; - return this; - } - - /** - * Get the reservedInstanceSupportedOffers property: Gets or sets the list of offers supported for Reserved - * Instances. - * - * @return the reservedInstanceSupportedOffers value. - */ - public List reservedInstanceSupportedOffers() { - return this.reservedInstanceSupportedOffers; - } - - /** - * Set the reservedInstanceSupportedOffers property: Gets or sets the list of offers supported for Reserved - * Instances. - * - * @param reservedInstanceSupportedOffers the reservedInstanceSupportedOffers value to set. - * @return the SqlAssessmentOptionsProperties object itself. - */ - public SqlAssessmentOptionsProperties - withReservedInstanceSupportedOffers(List reservedInstanceSupportedOffers) { - this.reservedInstanceSupportedOffers = reservedInstanceSupportedOffers; - return this; - } - - /** - * Get the supportedOffers property: Gets or sets the list of offers supported for SQL assessments. - * - * @return the supportedOffers value. - */ - public List supportedOffers() { - return this.supportedOffers; - } - - /** - * Set the supportedOffers property: Gets or sets the list of offers supported for SQL assessments. - * - * @param supportedOffers the supportedOffers value to set. - * @return the SqlAssessmentOptionsProperties object itself. - */ - public SqlAssessmentOptionsProperties withSupportedOffers(List supportedOffers) { - this.supportedOffers = supportedOffers; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vmFamilies() != null) { - vmFamilies().forEach(e -> e.validate()); - } - if (sqlSkus() != null) { - sqlSkus().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("savingsPlanVmFamilies", this.savingsPlanVmFamilies, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("savingsPlanSupportedLocations", this.savingsPlanSupportedLocations, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("savingsPlanSupportedLocationsForPaas", this.savingsPlanSupportedLocationsForPaas, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("reservedInstanceSupportedLocationsForIaas", - this.reservedInstanceSupportedLocationsForIaas, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("savingsPlanSupportedOffers", this.savingsPlanSupportedOffers, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("sqlSkus", this.sqlSkus, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("reservedInstanceSqlTargets", this.reservedInstanceSqlTargets, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("reservedInstanceSupportedLocations", this.reservedInstanceSupportedLocations, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("reservedInstanceSupportedCurrencies", this.reservedInstanceSupportedCurrencies, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("reservedInstanceSupportedOffers", this.reservedInstanceSupportedOffers, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("supportedOffers", this.supportedOffers, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SqlAssessmentOptionsProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlAssessmentOptionsProperties 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 SqlAssessmentOptionsProperties. - */ - public static SqlAssessmentOptionsProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlAssessmentOptionsProperties deserializedSqlAssessmentOptionsProperties - = new SqlAssessmentOptionsProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("vmFamilies".equals(fieldName)) { - List vmFamilies = reader.readArray(reader1 -> VmFamilyOptions.fromJson(reader1)); - deserializedSqlAssessmentOptionsProperties.vmFamilies = vmFamilies; - } else if ("reservedInstanceVmFamilies".equals(fieldName)) { - List reservedInstanceVmFamilies - = reader.readArray(reader1 -> AzureVmFamily.fromString(reader1.getString())); - deserializedSqlAssessmentOptionsProperties.reservedInstanceVmFamilies = reservedInstanceVmFamilies; - } else if ("premiumDiskVmFamilies".equals(fieldName)) { - List premiumDiskVmFamilies - = reader.readArray(reader1 -> AzureVmFamily.fromString(reader1.getString())); - deserializedSqlAssessmentOptionsProperties.premiumDiskVmFamilies = premiumDiskVmFamilies; - } else if ("savingsPlanVmFamilies".equals(fieldName)) { - List savingsPlanVmFamilies - = reader.readArray(reader1 -> AzureVmFamily.fromString(reader1.getString())); - deserializedSqlAssessmentOptionsProperties.savingsPlanVmFamilies = savingsPlanVmFamilies; - } else if ("savingsPlanSupportedLocations".equals(fieldName)) { - List savingsPlanSupportedLocations - = reader.readArray(reader1 -> AzureLocation.fromString(reader1.getString())); - deserializedSqlAssessmentOptionsProperties.savingsPlanSupportedLocations - = savingsPlanSupportedLocations; - } else if ("savingsPlanSupportedLocationsForPaas".equals(fieldName)) { - List savingsPlanSupportedLocationsForPaas - = reader.readArray(reader1 -> AzureLocation.fromString(reader1.getString())); - deserializedSqlAssessmentOptionsProperties.savingsPlanSupportedLocationsForPaas - = savingsPlanSupportedLocationsForPaas; - } else if ("reservedInstanceSupportedLocationsForIaas".equals(fieldName)) { - List reservedInstanceSupportedLocationsForIaas - = reader.readArray(reader1 -> AzureLocation.fromString(reader1.getString())); - deserializedSqlAssessmentOptionsProperties.reservedInstanceSupportedLocationsForIaas - = reservedInstanceSupportedLocationsForIaas; - } else if ("savingsPlanSupportedOffers".equals(fieldName)) { - List savingsPlanSupportedOffers - = reader.readArray(reader1 -> AzureOfferCode.fromString(reader1.getString())); - deserializedSqlAssessmentOptionsProperties.savingsPlanSupportedOffers = savingsPlanSupportedOffers; - } else if ("sqlSkus".equals(fieldName)) { - List sqlSkus - = reader.readArray(reader1 -> SqlPaaSTargetOptions.fromJson(reader1)); - deserializedSqlAssessmentOptionsProperties.sqlSkus = sqlSkus; - } else if ("reservedInstanceSqlTargets".equals(fieldName)) { - List reservedInstanceSqlTargets - = reader.readArray(reader1 -> TargetType.fromString(reader1.getString())); - deserializedSqlAssessmentOptionsProperties.reservedInstanceSqlTargets = reservedInstanceSqlTargets; - } else if ("reservedInstanceSupportedLocations".equals(fieldName)) { - List reservedInstanceSupportedLocations - = reader.readArray(reader1 -> AzureLocation.fromString(reader1.getString())); - deserializedSqlAssessmentOptionsProperties.reservedInstanceSupportedLocations - = reservedInstanceSupportedLocations; - } else if ("reservedInstanceSupportedCurrencies".equals(fieldName)) { - List reservedInstanceSupportedCurrencies - = reader.readArray(reader1 -> AzureCurrency.fromString(reader1.getString())); - deserializedSqlAssessmentOptionsProperties.reservedInstanceSupportedCurrencies - = reservedInstanceSupportedCurrencies; - } else if ("reservedInstanceSupportedOffers".equals(fieldName)) { - List reservedInstanceSupportedOffers - = reader.readArray(reader1 -> AzureOfferCode.fromString(reader1.getString())); - deserializedSqlAssessmentOptionsProperties.reservedInstanceSupportedOffers - = reservedInstanceSupportedOffers; - } else if ("supportedOffers".equals(fieldName)) { - List supportedOffers - = reader.readArray(reader1 -> AzureOfferCode.fromString(reader1.getString())); - deserializedSqlAssessmentOptionsProperties.supportedOffers = supportedOffers; - } else { - reader.skipChildren(); - } - } - - return deserializedSqlAssessmentOptionsProperties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentSettings.java new file mode 100644 index 000000000000..21a8815a0223 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentSettings.java @@ -0,0 +1,734 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * SQL assessment settings class. + */ +@Fluent +public final class SqlAssessmentSettings 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 Float scalingFactor; + + /* + * Custom discount percentage. + */ + private Float 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; + + /* + * Gets or sets user configurable setting to display the azure hybrid use benefit. + */ + private OsLicense osLicense; + + /* + * Gets or sets the duration for which the entity (SQL, VMs) are up in the + * on-premises environment. + */ + private EntityUptime entityUptime; + + /* + * Gets or sets SQL the preferred azure targets. + */ + private List preferredTargets; + + /* + * Gets or sets user configurable SQL managed instance settings. + */ + private SqlMiSettingsV3 azureSqlManagedInstanceSettings; + + /* + * Gets or sets user configurable SQL database settings. + */ + private SqlDbSettingsV3 azureSqlDatabaseSettings; + + /* + * Gets or sets user configurable SQL VM settings. + */ + private SqlVmSettings azureSqlVmSettings; + + /* + * Gets or sets user preference indicating intent of multi-subnet configuration. + */ + private MultiSubnetIntent multiSubnetIntent; + + /* + * Gets or sets user preference indicating intent of async commit mode. + */ + private AsyncCommitModeIntent asyncCommitModeIntent; + + /* + * Gets or sets a value indicating whether internet access is available. + */ + private Boolean isInternetAccessAvailable; + + /* + * Gets or sets the Azure Location or Azure region where to which the machines + * will be migrated. + */ + private AzureLocation disasterRecoveryLocation; + + /* + * Gets or sets a value indicating whether HADR assessments needs to be created. + */ + private Boolean enableHadrAssessment; + + /* + * Gets or sets a value indicating azure security offering type. + */ + private AzureSecurityOfferingType azureSecurityOfferingType; + + /* + * SQL server license. + */ + private SqlServerLicense sqlServerLicense; + + /** + * Creates an instance of SqlAssessmentSettings class. + */ + public SqlAssessmentSettings() { + } + + /** + * 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 SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings 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 SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings 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 Float 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 SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withScalingFactor(Float scalingFactor) { + this.scalingFactor = scalingFactor; + return this; + } + + /** + * Get the discountPercentage property: Custom discount percentage. + * + * @return the discountPercentage value. + */ + public Float discountPercentage() { + return this.discountPercentage; + } + + /** + * Set the discountPercentage property: Custom discount percentage. + * + * @param discountPercentage the discountPercentage value to set. + * @return the SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withDiscountPercentage(Float 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 SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings 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 SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings 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 SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings 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 SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings 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 SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withEnvironmentType(EnvironmentType environmentType) { + this.environmentType = environmentType; + return this; + } + + /** + * Get the osLicense property: Gets or sets user configurable setting to display the azure hybrid use benefit. + * + * @return the osLicense value. + */ + public OsLicense osLicense() { + return this.osLicense; + } + + /** + * Set the osLicense property: Gets or sets user configurable setting to display the azure hybrid use benefit. + * + * @param osLicense the osLicense value to set. + * @return the SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withOsLicense(OsLicense osLicense) { + this.osLicense = osLicense; + return this; + } + + /** + * Get the entityUptime property: Gets or sets the duration for which the entity (SQL, VMs) are up in the + * on-premises environment. + * + * @return the entityUptime value. + */ + public EntityUptime entityUptime() { + return this.entityUptime; + } + + /** + * Set the entityUptime property: Gets or sets the duration for which the entity (SQL, VMs) are up in the + * on-premises environment. + * + * @param entityUptime the entityUptime value to set. + * @return the SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withEntityUptime(EntityUptime entityUptime) { + this.entityUptime = entityUptime; + return this; + } + + /** + * Get the preferredTargets property: Gets or sets SQL the preferred azure targets. + * + * @return the preferredTargets value. + */ + public List preferredTargets() { + return this.preferredTargets; + } + + /** + * Set the preferredTargets property: Gets or sets SQL the preferred azure targets. + * + * @param preferredTargets the preferredTargets value to set. + * @return the SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withPreferredTargets(List preferredTargets) { + this.preferredTargets = preferredTargets; + return this; + } + + /** + * Get the azureSqlManagedInstanceSettings property: Gets or sets user configurable SQL managed instance settings. + * + * @return the azureSqlManagedInstanceSettings value. + */ + public SqlMiSettingsV3 azureSqlManagedInstanceSettings() { + return this.azureSqlManagedInstanceSettings; + } + + /** + * Set the azureSqlManagedInstanceSettings property: Gets or sets user configurable SQL managed instance settings. + * + * @param azureSqlManagedInstanceSettings the azureSqlManagedInstanceSettings value to set. + * @return the SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withAzureSqlManagedInstanceSettings(SqlMiSettingsV3 azureSqlManagedInstanceSettings) { + this.azureSqlManagedInstanceSettings = azureSqlManagedInstanceSettings; + return this; + } + + /** + * Get the azureSqlDatabaseSettings property: Gets or sets user configurable SQL database settings. + * + * @return the azureSqlDatabaseSettings value. + */ + public SqlDbSettingsV3 azureSqlDatabaseSettings() { + return this.azureSqlDatabaseSettings; + } + + /** + * Set the azureSqlDatabaseSettings property: Gets or sets user configurable SQL database settings. + * + * @param azureSqlDatabaseSettings the azureSqlDatabaseSettings value to set. + * @return the SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withAzureSqlDatabaseSettings(SqlDbSettingsV3 azureSqlDatabaseSettings) { + this.azureSqlDatabaseSettings = azureSqlDatabaseSettings; + return this; + } + + /** + * Get the azureSqlVmSettings property: Gets or sets user configurable SQL VM settings. + * + * @return the azureSqlVmSettings value. + */ + public SqlVmSettings azureSqlVmSettings() { + return this.azureSqlVmSettings; + } + + /** + * Set the azureSqlVmSettings property: Gets or sets user configurable SQL VM settings. + * + * @param azureSqlVmSettings the azureSqlVmSettings value to set. + * @return the SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withAzureSqlVmSettings(SqlVmSettings azureSqlVmSettings) { + this.azureSqlVmSettings = azureSqlVmSettings; + return this; + } + + /** + * Get the multiSubnetIntent property: Gets or sets user preference indicating intent of multi-subnet configuration. + * + * @return the multiSubnetIntent value. + */ + public MultiSubnetIntent multiSubnetIntent() { + return this.multiSubnetIntent; + } + + /** + * Set the multiSubnetIntent property: Gets or sets user preference indicating intent of multi-subnet configuration. + * + * @param multiSubnetIntent the multiSubnetIntent value to set. + * @return the SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withMultiSubnetIntent(MultiSubnetIntent multiSubnetIntent) { + this.multiSubnetIntent = multiSubnetIntent; + return this; + } + + /** + * Get the asyncCommitModeIntent property: Gets or sets user preference indicating intent of async commit mode. + * + * @return the asyncCommitModeIntent value. + */ + public AsyncCommitModeIntent asyncCommitModeIntent() { + return this.asyncCommitModeIntent; + } + + /** + * Set the asyncCommitModeIntent property: Gets or sets user preference indicating intent of async commit mode. + * + * @param asyncCommitModeIntent the asyncCommitModeIntent value to set. + * @return the SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withAsyncCommitModeIntent(AsyncCommitModeIntent asyncCommitModeIntent) { + this.asyncCommitModeIntent = asyncCommitModeIntent; + return this; + } + + /** + * Get the isInternetAccessAvailable property: Gets or sets a value indicating whether internet access is available. + * + * @return the isInternetAccessAvailable value. + */ + public Boolean isInternetAccessAvailable() { + return this.isInternetAccessAvailable; + } + + /** + * Set the isInternetAccessAvailable property: Gets or sets a value indicating whether internet access is available. + * + * @param isInternetAccessAvailable the isInternetAccessAvailable value to set. + * @return the SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withIsInternetAccessAvailable(Boolean isInternetAccessAvailable) { + this.isInternetAccessAvailable = isInternetAccessAvailable; + return this; + } + + /** + * Get the disasterRecoveryLocation property: Gets or sets the Azure Location or Azure region where to which the + * machines + * will be migrated. + * + * @return the disasterRecoveryLocation value. + */ + public AzureLocation disasterRecoveryLocation() { + return this.disasterRecoveryLocation; + } + + /** + * Set the disasterRecoveryLocation property: Gets or sets the Azure Location or Azure region where to which the + * machines + * will be migrated. + * + * @param disasterRecoveryLocation the disasterRecoveryLocation value to set. + * @return the SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withDisasterRecoveryLocation(AzureLocation disasterRecoveryLocation) { + this.disasterRecoveryLocation = disasterRecoveryLocation; + return this; + } + + /** + * Get the enableHadrAssessment property: Gets or sets a value indicating whether HADR assessments needs to be + * created. + * + * @return the enableHadrAssessment value. + */ + public Boolean enableHadrAssessment() { + return this.enableHadrAssessment; + } + + /** + * Set the enableHadrAssessment property: Gets or sets a value indicating whether HADR assessments needs to be + * created. + * + * @param enableHadrAssessment the enableHadrAssessment value to set. + * @return the SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withEnableHadrAssessment(Boolean enableHadrAssessment) { + this.enableHadrAssessment = enableHadrAssessment; + return this; + } + + /** + * Get the azureSecurityOfferingType property: Gets or sets a value indicating azure security offering type. + * + * @return the azureSecurityOfferingType value. + */ + public AzureSecurityOfferingType azureSecurityOfferingType() { + return this.azureSecurityOfferingType; + } + + /** + * Set the azureSecurityOfferingType property: Gets or sets a value indicating azure security offering type. + * + * @param azureSecurityOfferingType the azureSecurityOfferingType value to set. + * @return the SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withAzureSecurityOfferingType(AzureSecurityOfferingType azureSecurityOfferingType) { + this.azureSecurityOfferingType = azureSecurityOfferingType; + return this; + } + + /** + * Get the sqlServerLicense property: SQL server license. + * + * @return the sqlServerLicense value. + */ + public SqlServerLicense sqlServerLicense() { + return this.sqlServerLicense; + } + + /** + * Set the sqlServerLicense property: SQL server license. + * + * @param sqlServerLicense the sqlServerLicense value to set. + * @return the SqlAssessmentSettings object itself. + */ + public SqlAssessmentSettings withSqlServerLicense(SqlServerLicense sqlServerLicense) { + this.sqlServerLicense = sqlServerLicense; + 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 (entityUptime() != null) { + entityUptime().validate(); + } + if (azureSqlManagedInstanceSettings() != null) { + azureSqlManagedInstanceSettings().validate(); + } + if (azureSqlDatabaseSettings() != null) { + azureSqlDatabaseSettings().validate(); + } + if (azureSqlVmSettings() != null) { + azureSqlVmSettings().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("osLicense", this.osLicense == null ? null : this.osLicense.toString()); + jsonWriter.writeJsonField("entityUptime", this.entityUptime); + jsonWriter.writeArrayField("preferredTargets", this.preferredTargets, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("azureSqlManagedInstanceSettings", this.azureSqlManagedInstanceSettings); + jsonWriter.writeJsonField("azureSqlDatabaseSettings", this.azureSqlDatabaseSettings); + jsonWriter.writeJsonField("azureSqlVmSettings", this.azureSqlVmSettings); + jsonWriter.writeStringField("multiSubnetIntent", + this.multiSubnetIntent == null ? null : this.multiSubnetIntent.toString()); + jsonWriter.writeStringField("asyncCommitModeIntent", + this.asyncCommitModeIntent == null ? null : this.asyncCommitModeIntent.toString()); + jsonWriter.writeBooleanField("isInternetAccessAvailable", this.isInternetAccessAvailable); + jsonWriter.writeStringField("disasterRecoveryLocation", + this.disasterRecoveryLocation == null ? null : this.disasterRecoveryLocation.toString()); + jsonWriter.writeBooleanField("enableHadrAssessment", this.enableHadrAssessment); + jsonWriter.writeStringField("azureSecurityOfferingType", + this.azureSecurityOfferingType == null ? null : this.azureSecurityOfferingType.toString()); + jsonWriter.writeStringField("sqlServerLicense", + this.sqlServerLicense == null ? null : this.sqlServerLicense.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlAssessmentSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlAssessmentSettings 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 SqlAssessmentSettings. + */ + public static SqlAssessmentSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlAssessmentSettings deserializedSqlAssessmentSettings = new SqlAssessmentSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureLocation".equals(fieldName)) { + deserializedSqlAssessmentSettings.azureLocation = reader.getString(); + } else if ("currency".equals(fieldName)) { + deserializedSqlAssessmentSettings.currency = AzureCurrency.fromString(reader.getString()); + } else if ("scalingFactor".equals(fieldName)) { + deserializedSqlAssessmentSettings.scalingFactor = reader.getNullable(JsonReader::getFloat); + } else if ("discountPercentage".equals(fieldName)) { + deserializedSqlAssessmentSettings.discountPercentage = reader.getNullable(JsonReader::getFloat); + } else if ("sizingCriterion".equals(fieldName)) { + deserializedSqlAssessmentSettings.sizingCriterion + = AssessmentSizingCriterion.fromString(reader.getString()); + } else if ("performanceData".equals(fieldName)) { + deserializedSqlAssessmentSettings.performanceData = PerformanceData.fromJson(reader); + } else if ("savingsSettings".equals(fieldName)) { + deserializedSqlAssessmentSettings.savingsSettings = SavingsSettings.fromJson(reader); + } else if ("billingSettings".equals(fieldName)) { + deserializedSqlAssessmentSettings.billingSettings = BillingSettings.fromJson(reader); + } else if ("environmentType".equals(fieldName)) { + deserializedSqlAssessmentSettings.environmentType = EnvironmentType.fromString(reader.getString()); + } else if ("osLicense".equals(fieldName)) { + deserializedSqlAssessmentSettings.osLicense = OsLicense.fromString(reader.getString()); + } else if ("entityUptime".equals(fieldName)) { + deserializedSqlAssessmentSettings.entityUptime = EntityUptime.fromJson(reader); + } else if ("preferredTargets".equals(fieldName)) { + List preferredTargets + = reader.readArray(reader1 -> AzureTarget.fromString(reader1.getString())); + deserializedSqlAssessmentSettings.preferredTargets = preferredTargets; + } else if ("azureSqlManagedInstanceSettings".equals(fieldName)) { + deserializedSqlAssessmentSettings.azureSqlManagedInstanceSettings + = SqlMiSettingsV3.fromJson(reader); + } else if ("azureSqlDatabaseSettings".equals(fieldName)) { + deserializedSqlAssessmentSettings.azureSqlDatabaseSettings = SqlDbSettingsV3.fromJson(reader); + } else if ("azureSqlVmSettings".equals(fieldName)) { + deserializedSqlAssessmentSettings.azureSqlVmSettings = SqlVmSettings.fromJson(reader); + } else if ("multiSubnetIntent".equals(fieldName)) { + deserializedSqlAssessmentSettings.multiSubnetIntent + = MultiSubnetIntent.fromString(reader.getString()); + } else if ("asyncCommitModeIntent".equals(fieldName)) { + deserializedSqlAssessmentSettings.asyncCommitModeIntent + = AsyncCommitModeIntent.fromString(reader.getString()); + } else if ("isInternetAccessAvailable".equals(fieldName)) { + deserializedSqlAssessmentSettings.isInternetAccessAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("disasterRecoveryLocation".equals(fieldName)) { + deserializedSqlAssessmentSettings.disasterRecoveryLocation + = AzureLocation.fromString(reader.getString()); + } else if ("enableHadrAssessment".equals(fieldName)) { + deserializedSqlAssessmentSettings.enableHadrAssessment = reader.getNullable(JsonReader::getBoolean); + } else if ("azureSecurityOfferingType".equals(fieldName)) { + deserializedSqlAssessmentSettings.azureSecurityOfferingType + = AzureSecurityOfferingType.fromString(reader.getString()); + } else if ("sqlServerLicense".equals(fieldName)) { + deserializedSqlAssessmentSettings.sqlServerLicense + = SqlServerLicense.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlAssessmentSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2.java deleted file mode 100644 index bf21ac020ef7..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2.java +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV2Inner; - -/** - * An immutable client-side representation of SqlAssessmentV2. - */ -public interface SqlAssessmentV2 { - /** - * 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. - */ - SqlAssessmentV2Properties 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.migration.assessment.fluent.models.SqlAssessmentV2Inner object. - * - * @return the inner object. - */ - SqlAssessmentV2Inner innerModel(); - - /** - * The entirety of the SqlAssessmentV2 definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The SqlAssessmentV2 definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the SqlAssessmentV2 definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the SqlAssessmentV2 definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, projectName, groupName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @return the next definition stage. - */ - WithCreate withExistingGroup(String resourceGroupName, String projectName, String groupName); - } - - /** - * The stage of the SqlAssessmentV2 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. - */ - SqlAssessmentV2 create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - SqlAssessmentV2 create(Context context); - } - - /** - * The stage of the SqlAssessmentV2 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(SqlAssessmentV2Properties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - SqlAssessmentV2 refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - SqlAssessmentV2 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 the URL for downloading the assessment in a report format. - */ - DownloadUrl downloadUrl(Object 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 the URL for downloading the assessment in a report format. - */ - DownloadUrl downloadUrl(Object body, Context context); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2IaasSuitabilityData.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2IaasSuitabilityData.java deleted file mode 100644 index a98bd91184f9..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2IaasSuitabilityData.java +++ /dev/null @@ -1,342 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Class representing Azure SQL IAAS suitability details. - */ -@Fluent -public final class SqlAssessmentV2IaasSuitabilityData implements JsonSerializable { - /* - * Gets the azure SQL IAAS SKU. - */ - private AzureSqlIaasSkuDto azureSqlSku; - - /* - * Gets the replica azure SQL IAAS SKU. - */ - private List replicaAzureSqlSku; - - /* - * Gets the shared resources. - */ - private SharedResourcesDto sharedResources; - - /* - * Gets the monthly compute cost. - */ - private Float monthlyComputeCost; - - /* - * Gets the monthly storage cost. - */ - private Float monthlyStorageCost; - - /* - * Gets the collection of cost components. - */ - private List costComponents; - - /* - * Gets the suitability for Microsoft cloud defender. - */ - private CloudSuitability securitySuitability; - - /* - * Gets a value indicating whether replicas should be provisioned. - */ - private Boolean shouldProvisionReplicas; - - /* - * Gets the replication mode. - */ - private SkuReplicationMode skuReplicationMode; - - /* - * Gets the list of migration guidelines applicable to this target. - */ - private List migrationGuidelines; - - /* - * Gets the list of SQL recommendation Reasoning. - */ - private List recommendationReasonings; - - /* - * Gets the migration target platform. - */ - private TargetType migrationTargetPlatform; - - /* - * Gets the azure suitability. - */ - private CloudSuitability suitability; - - /* - * Gets the list of migrations issues. - */ - private List migrationIssues; - - /** - * Creates an instance of SqlAssessmentV2IaasSuitabilityData class. - */ - public SqlAssessmentV2IaasSuitabilityData() { - } - - /** - * Get the azureSqlSku property: Gets the azure SQL IAAS SKU. - * - * @return the azureSqlSku value. - */ - public AzureSqlIaasSkuDto azureSqlSku() { - return this.azureSqlSku; - } - - /** - * Get the replicaAzureSqlSku property: Gets the replica azure SQL IAAS SKU. - * - * @return the replicaAzureSqlSku value. - */ - public List replicaAzureSqlSku() { - return this.replicaAzureSqlSku; - } - - /** - * Get the sharedResources property: Gets the shared resources. - * - * @return the sharedResources value. - */ - public SharedResourcesDto sharedResources() { - return this.sharedResources; - } - - /** - * Get the monthlyComputeCost property: Gets the monthly compute cost. - * - * @return the monthlyComputeCost value. - */ - public Float monthlyComputeCost() { - return this.monthlyComputeCost; - } - - /** - * Get the monthlyStorageCost property: Gets the monthly storage cost. - * - * @return the monthlyStorageCost value. - */ - public Float monthlyStorageCost() { - return this.monthlyStorageCost; - } - - /** - * Get the costComponents property: Gets the collection of cost components. - * - * @return the costComponents value. - */ - public List costComponents() { - return this.costComponents; - } - - /** - * Set the costComponents property: Gets the collection of cost components. - * - * @param costComponents the costComponents value to set. - * @return the SqlAssessmentV2IaasSuitabilityData object itself. - */ - public SqlAssessmentV2IaasSuitabilityData withCostComponents(List costComponents) { - this.costComponents = costComponents; - return this; - } - - /** - * Get the securitySuitability property: Gets the suitability for Microsoft cloud defender. - * - * @return the securitySuitability value. - */ - public CloudSuitability securitySuitability() { - return this.securitySuitability; - } - - /** - * Get the shouldProvisionReplicas property: Gets a value indicating whether replicas should be provisioned. - * - * @return the shouldProvisionReplicas value. - */ - public Boolean shouldProvisionReplicas() { - return this.shouldProvisionReplicas; - } - - /** - * Get the skuReplicationMode property: Gets the replication mode. - * - * @return the skuReplicationMode value. - */ - public SkuReplicationMode skuReplicationMode() { - return this.skuReplicationMode; - } - - /** - * Get the migrationGuidelines property: Gets the list of migration guidelines applicable to this target. - * - * @return the migrationGuidelines value. - */ - public List migrationGuidelines() { - return this.migrationGuidelines; - } - - /** - * Get the recommendationReasonings property: Gets the list of SQL recommendation Reasoning. - * - * @return the recommendationReasonings value. - */ - public List recommendationReasonings() { - return this.recommendationReasonings; - } - - /** - * Get the migrationTargetPlatform property: Gets the migration target platform. - * - * @return the migrationTargetPlatform value. - */ - public TargetType migrationTargetPlatform() { - return this.migrationTargetPlatform; - } - - /** - * Get the suitability property: Gets the azure suitability. - * - * @return the suitability value. - */ - public CloudSuitability suitability() { - return this.suitability; - } - - /** - * Get the migrationIssues property: Gets the list of migrations issues. - * - * @return the migrationIssues value. - */ - public List migrationIssues() { - return this.migrationIssues; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (azureSqlSku() != null) { - azureSqlSku().validate(); - } - if (replicaAzureSqlSku() != null) { - replicaAzureSqlSku().forEach(e -> e.validate()); - } - if (sharedResources() != null) { - sharedResources().validate(); - } - if (costComponents() != null) { - costComponents().forEach(e -> e.validate()); - } - if (migrationGuidelines() != null) { - migrationGuidelines().forEach(e -> e.validate()); - } - if (recommendationReasonings() != null) { - recommendationReasonings().forEach(e -> e.validate()); - } - if (migrationIssues() != null) { - migrationIssues().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("costComponents", this.costComponents, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SqlAssessmentV2IaasSuitabilityData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlAssessmentV2IaasSuitabilityData 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 SqlAssessmentV2IaasSuitabilityData. - */ - public static SqlAssessmentV2IaasSuitabilityData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlAssessmentV2IaasSuitabilityData deserializedSqlAssessmentV2IaasSuitabilityData - = new SqlAssessmentV2IaasSuitabilityData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("azureSqlSku".equals(fieldName)) { - deserializedSqlAssessmentV2IaasSuitabilityData.azureSqlSku = AzureSqlIaasSkuDto.fromJson(reader); - } else if ("replicaAzureSqlSku".equals(fieldName)) { - List replicaAzureSqlSku - = reader.readArray(reader1 -> AzureSqlIaasSkuDto.fromJson(reader1)); - deserializedSqlAssessmentV2IaasSuitabilityData.replicaAzureSqlSku = replicaAzureSqlSku; - } else if ("sharedResources".equals(fieldName)) { - deserializedSqlAssessmentV2IaasSuitabilityData.sharedResources - = SharedResourcesDto.fromJson(reader); - } else if ("monthlyComputeCost".equals(fieldName)) { - deserializedSqlAssessmentV2IaasSuitabilityData.monthlyComputeCost - = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyStorageCost".equals(fieldName)) { - deserializedSqlAssessmentV2IaasSuitabilityData.monthlyStorageCost - = reader.getNullable(JsonReader::getFloat); - } else if ("costComponents".equals(fieldName)) { - List costComponents = reader.readArray(reader1 -> CostComponent.fromJson(reader1)); - deserializedSqlAssessmentV2IaasSuitabilityData.costComponents = costComponents; - } else if ("securitySuitability".equals(fieldName)) { - deserializedSqlAssessmentV2IaasSuitabilityData.securitySuitability - = CloudSuitability.fromString(reader.getString()); - } else if ("shouldProvisionReplicas".equals(fieldName)) { - deserializedSqlAssessmentV2IaasSuitabilityData.shouldProvisionReplicas - = reader.getNullable(JsonReader::getBoolean); - } else if ("skuReplicationMode".equals(fieldName)) { - deserializedSqlAssessmentV2IaasSuitabilityData.skuReplicationMode - = SkuReplicationMode.fromString(reader.getString()); - } else if ("migrationGuidelines".equals(fieldName)) { - List migrationGuidelines - = reader.readArray(reader1 -> SqlMigrationGuideline.fromJson(reader1)); - deserializedSqlAssessmentV2IaasSuitabilityData.migrationGuidelines = migrationGuidelines; - } else if ("recommendationReasonings".equals(fieldName)) { - List recommendationReasonings - = reader.readArray(reader1 -> SqlRecommendationReasoning.fromJson(reader1)); - deserializedSqlAssessmentV2IaasSuitabilityData.recommendationReasonings = recommendationReasonings; - } else if ("migrationTargetPlatform".equals(fieldName)) { - deserializedSqlAssessmentV2IaasSuitabilityData.migrationTargetPlatform - = TargetType.fromString(reader.getString()); - } else if ("suitability".equals(fieldName)) { - deserializedSqlAssessmentV2IaasSuitabilityData.suitability - = CloudSuitability.fromString(reader.getString()); - } else if ("migrationIssues".equals(fieldName)) { - List migrationIssues - = reader.readArray(reader1 -> SqlAssessmentMigrationIssue.fromJson(reader1)); - deserializedSqlAssessmentV2IaasSuitabilityData.migrationIssues = migrationIssues; - } else { - reader.skipChildren(); - } - } - - return deserializedSqlAssessmentV2IaasSuitabilityData; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2ListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2ListResult.java deleted file mode 100644 index 13ed56d5ae1c..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2ListResult.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -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.migration.assessment.fluent.models.SqlAssessmentV2Inner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a SqlAssessmentV2 list operation. - */ -@Fluent -public final class SqlAssessmentV2ListResult implements JsonSerializable { - /* - * The SqlAssessmentV2 items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of SqlAssessmentV2ListResult class. - */ - public SqlAssessmentV2ListResult() { - } - - /** - * Get the value property: The SqlAssessmentV2 items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The SqlAssessmentV2 items on this page. - * - * @param value the value value to set. - * @return the SqlAssessmentV2ListResult object itself. - */ - public SqlAssessmentV2ListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the SqlAssessmentV2ListResult object itself. - */ - public SqlAssessmentV2ListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * 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 SqlAssessmentV2ListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SqlAssessmentV2ListResult.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 SqlAssessmentV2ListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlAssessmentV2ListResult 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 SqlAssessmentV2ListResult. - */ - public static SqlAssessmentV2ListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlAssessmentV2ListResult deserializedSqlAssessmentV2ListResult = new SqlAssessmentV2ListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SqlAssessmentV2Inner.fromJson(reader1)); - deserializedSqlAssessmentV2ListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSqlAssessmentV2ListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlAssessmentV2ListResult; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2Operations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2Operations.java deleted file mode 100644 index 1ee0d9e46378..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2Operations.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 SqlAssessmentV2Operations. - */ -public interface SqlAssessmentV2Operations { - /** - * List SqlAssessmentV2 resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 SqlAssessmentV2 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName); - - /** - * List SqlAssessmentV2 resources by Group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group 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 SqlAssessmentV2 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByGroup(String resourceGroupName, String projectName, String groupName, - Context context); - - /** - * Get a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2 along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, Context context); - - /** - * Get a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2. - */ - SqlAssessmentV2 get(String resourceGroupName, String projectName, String groupName, String assessmentName); - - /** - * Delete a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 groupName, - String assessmentName, Context context); - - /** - * Delete a SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 groupName, 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 URL for downloading the assessment in a report format. - */ - DownloadUrl downloadUrl(String resourceGroupName, String projectName, String groupName, String assessmentName, - Object 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 groupName Group ARM name. - * @param assessmentName SQL Assessment 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 URL for downloading the assessment in a report format. - */ - DownloadUrl downloadUrl(String resourceGroupName, String projectName, String groupName, String assessmentName, - Object body, Context context); - - /** - * Get a SqlAssessmentV2. - * - * @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 SqlAssessmentV2 along with {@link Response}. - */ - SqlAssessmentV2 getById(String id); - - /** - * Get a SqlAssessmentV2. - * - * @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 SqlAssessmentV2 along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a SqlAssessmentV2. - * - * @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 SqlAssessmentV2. - * - * @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 SqlAssessmentV2 resource. - * - * @param name resource name. - * @return the first stage of the new SqlAssessmentV2 definition. - */ - SqlAssessmentV2.DefinitionStages.Blank define(String name); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2PaasSuitabilityData.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2PaasSuitabilityData.java deleted file mode 100644 index 25867747057a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2PaasSuitabilityData.java +++ /dev/null @@ -1,342 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Class representing Azure SQL PAAS suitability details. - */ -@Fluent -public final class SqlAssessmentV2PaasSuitabilityData implements JsonSerializable { - /* - * Gets the azure SQL PAAS SKU. - */ - private AzureSqlPaasSkuDto azureSqlSku; - - /* - * Gets the replica azure SQL PAAS SKU. - */ - private List replicaAzureSqlSku; - - /* - * Gets the shared resources. - */ - private SharedResourcesDto sharedResources; - - /* - * Gets the monthly compute cost. - */ - private Float monthlyComputeCost; - - /* - * Gets the monthly storage cost. - */ - private Float monthlyStorageCost; - - /* - * Gets the collection of cost components. - */ - private List costComponents; - - /* - * Gets the suitability for Microsoft cloud defender. - */ - private CloudSuitability securitySuitability; - - /* - * Gets a value indicating whether replicas should be provisioned. - */ - private Boolean shouldProvisionReplicas; - - /* - * Gets the replication mode. - */ - private SkuReplicationMode skuReplicationMode; - - /* - * Gets the list of migration guidelines applicable to this target. - */ - private List migrationGuidelines; - - /* - * Gets the list of SQL recommendation Reasoning. - */ - private List recommendationReasonings; - - /* - * Gets the migration target platform. - */ - private TargetType migrationTargetPlatform; - - /* - * Gets the azure suitability. - */ - private CloudSuitability suitability; - - /* - * Gets the list of migrations issues. - */ - private List migrationIssues; - - /** - * Creates an instance of SqlAssessmentV2PaasSuitabilityData class. - */ - public SqlAssessmentV2PaasSuitabilityData() { - } - - /** - * Get the azureSqlSku property: Gets the azure SQL PAAS SKU. - * - * @return the azureSqlSku value. - */ - public AzureSqlPaasSkuDto azureSqlSku() { - return this.azureSqlSku; - } - - /** - * Get the replicaAzureSqlSku property: Gets the replica azure SQL PAAS SKU. - * - * @return the replicaAzureSqlSku value. - */ - public List replicaAzureSqlSku() { - return this.replicaAzureSqlSku; - } - - /** - * Get the sharedResources property: Gets the shared resources. - * - * @return the sharedResources value. - */ - public SharedResourcesDto sharedResources() { - return this.sharedResources; - } - - /** - * Get the monthlyComputeCost property: Gets the monthly compute cost. - * - * @return the monthlyComputeCost value. - */ - public Float monthlyComputeCost() { - return this.monthlyComputeCost; - } - - /** - * Get the monthlyStorageCost property: Gets the monthly storage cost. - * - * @return the monthlyStorageCost value. - */ - public Float monthlyStorageCost() { - return this.monthlyStorageCost; - } - - /** - * Get the costComponents property: Gets the collection of cost components. - * - * @return the costComponents value. - */ - public List costComponents() { - return this.costComponents; - } - - /** - * Set the costComponents property: Gets the collection of cost components. - * - * @param costComponents the costComponents value to set. - * @return the SqlAssessmentV2PaasSuitabilityData object itself. - */ - public SqlAssessmentV2PaasSuitabilityData withCostComponents(List costComponents) { - this.costComponents = costComponents; - return this; - } - - /** - * Get the securitySuitability property: Gets the suitability for Microsoft cloud defender. - * - * @return the securitySuitability value. - */ - public CloudSuitability securitySuitability() { - return this.securitySuitability; - } - - /** - * Get the shouldProvisionReplicas property: Gets a value indicating whether replicas should be provisioned. - * - * @return the shouldProvisionReplicas value. - */ - public Boolean shouldProvisionReplicas() { - return this.shouldProvisionReplicas; - } - - /** - * Get the skuReplicationMode property: Gets the replication mode. - * - * @return the skuReplicationMode value. - */ - public SkuReplicationMode skuReplicationMode() { - return this.skuReplicationMode; - } - - /** - * Get the migrationGuidelines property: Gets the list of migration guidelines applicable to this target. - * - * @return the migrationGuidelines value. - */ - public List migrationGuidelines() { - return this.migrationGuidelines; - } - - /** - * Get the recommendationReasonings property: Gets the list of SQL recommendation Reasoning. - * - * @return the recommendationReasonings value. - */ - public List recommendationReasonings() { - return this.recommendationReasonings; - } - - /** - * Get the migrationTargetPlatform property: Gets the migration target platform. - * - * @return the migrationTargetPlatform value. - */ - public TargetType migrationTargetPlatform() { - return this.migrationTargetPlatform; - } - - /** - * Get the suitability property: Gets the azure suitability. - * - * @return the suitability value. - */ - public CloudSuitability suitability() { - return this.suitability; - } - - /** - * Get the migrationIssues property: Gets the list of migrations issues. - * - * @return the migrationIssues value. - */ - public List migrationIssues() { - return this.migrationIssues; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (azureSqlSku() != null) { - azureSqlSku().validate(); - } - if (replicaAzureSqlSku() != null) { - replicaAzureSqlSku().forEach(e -> e.validate()); - } - if (sharedResources() != null) { - sharedResources().validate(); - } - if (costComponents() != null) { - costComponents().forEach(e -> e.validate()); - } - if (migrationGuidelines() != null) { - migrationGuidelines().forEach(e -> e.validate()); - } - if (recommendationReasonings() != null) { - recommendationReasonings().forEach(e -> e.validate()); - } - if (migrationIssues() != null) { - migrationIssues().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("costComponents", this.costComponents, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SqlAssessmentV2PaasSuitabilityData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlAssessmentV2PaasSuitabilityData 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 SqlAssessmentV2PaasSuitabilityData. - */ - public static SqlAssessmentV2PaasSuitabilityData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlAssessmentV2PaasSuitabilityData deserializedSqlAssessmentV2PaasSuitabilityData - = new SqlAssessmentV2PaasSuitabilityData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("azureSqlSku".equals(fieldName)) { - deserializedSqlAssessmentV2PaasSuitabilityData.azureSqlSku = AzureSqlPaasSkuDto.fromJson(reader); - } else if ("replicaAzureSqlSku".equals(fieldName)) { - List replicaAzureSqlSku - = reader.readArray(reader1 -> AzureSqlPaasSkuDto.fromJson(reader1)); - deserializedSqlAssessmentV2PaasSuitabilityData.replicaAzureSqlSku = replicaAzureSqlSku; - } else if ("sharedResources".equals(fieldName)) { - deserializedSqlAssessmentV2PaasSuitabilityData.sharedResources - = SharedResourcesDto.fromJson(reader); - } else if ("monthlyComputeCost".equals(fieldName)) { - deserializedSqlAssessmentV2PaasSuitabilityData.monthlyComputeCost - = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyStorageCost".equals(fieldName)) { - deserializedSqlAssessmentV2PaasSuitabilityData.monthlyStorageCost - = reader.getNullable(JsonReader::getFloat); - } else if ("costComponents".equals(fieldName)) { - List costComponents = reader.readArray(reader1 -> CostComponent.fromJson(reader1)); - deserializedSqlAssessmentV2PaasSuitabilityData.costComponents = costComponents; - } else if ("securitySuitability".equals(fieldName)) { - deserializedSqlAssessmentV2PaasSuitabilityData.securitySuitability - = CloudSuitability.fromString(reader.getString()); - } else if ("shouldProvisionReplicas".equals(fieldName)) { - deserializedSqlAssessmentV2PaasSuitabilityData.shouldProvisionReplicas - = reader.getNullable(JsonReader::getBoolean); - } else if ("skuReplicationMode".equals(fieldName)) { - deserializedSqlAssessmentV2PaasSuitabilityData.skuReplicationMode - = SkuReplicationMode.fromString(reader.getString()); - } else if ("migrationGuidelines".equals(fieldName)) { - List migrationGuidelines - = reader.readArray(reader1 -> SqlMigrationGuideline.fromJson(reader1)); - deserializedSqlAssessmentV2PaasSuitabilityData.migrationGuidelines = migrationGuidelines; - } else if ("recommendationReasonings".equals(fieldName)) { - List recommendationReasonings - = reader.readArray(reader1 -> SqlRecommendationReasoning.fromJson(reader1)); - deserializedSqlAssessmentV2PaasSuitabilityData.recommendationReasonings = recommendationReasonings; - } else if ("migrationTargetPlatform".equals(fieldName)) { - deserializedSqlAssessmentV2PaasSuitabilityData.migrationTargetPlatform - = TargetType.fromString(reader.getString()); - } else if ("suitability".equals(fieldName)) { - deserializedSqlAssessmentV2PaasSuitabilityData.suitability - = CloudSuitability.fromString(reader.getString()); - } else if ("migrationIssues".equals(fieldName)) { - List migrationIssues - = reader.readArray(reader1 -> SqlAssessmentMigrationIssue.fromJson(reader1)); - deserializedSqlAssessmentV2PaasSuitabilityData.migrationIssues = migrationIssues; - } else { - reader.skipChildren(); - } - } - - return deserializedSqlAssessmentV2PaasSuitabilityData; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2Properties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2Properties.java deleted file mode 100644 index ed691a18bb28..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2Properties.java +++ /dev/null @@ -1,1118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * SQL assessment properties class. - */ -@Fluent -public final class SqlAssessmentV2Properties extends AzureResourceProperties { - /* - * Gets or sets user configurable setting to display the azure hybrid use benefit. - */ - private OsLicense osLicense; - - /* - * Gets or sets user configurable setting to display the environment type. - */ - private EnvironmentType environmentType; - - /* - * Gets or sets the duration for which the entity (SQL, VMs) are up in the - * on-premises environment. - */ - private EntityUptime entityUptime; - - /* - * Gets or sets SQL optimization logic. - */ - private OptimizationLogic optimizationLogic; - - /* - * Gets or sets azure reserved instance for VM. - */ - private AzureReservedInstance reservedInstanceForVm; - - /* - * Gets or sets Azure Offer Code for VM. - */ - private AzureOfferCode azureOfferCodeForVm; - - /* - * Gets or sets the Enterprise agreement subscription id. - */ - private String eaSubscriptionId; - - /* - * Gets or sets user configurable SQL managed instance settings. - */ - private SqlMiSettings azureSqlManagedInstanceSettings; - - /* - * Gets or sets user configurable SQL database settings. - */ - private SqlDbSettings azureSqlDatabaseSettings; - - /* - * Gets or sets user configurable SQL VM settings. - */ - private SqlVmSettings azureSqlVmSettings; - - /* - * Gets or sets user preference indicating intent of multi-subnet configuration. - */ - private MultiSubnetIntent multiSubnetIntent; - - /* - * Gets or sets user preference indicating intent of async commit mode. - */ - private AsyncCommitModeIntent asyncCommitModeIntent; - - /* - * Gets or sets a value indicating whether internet access is available. - */ - private Boolean isInternetAccessAvailable; - - /* - * Gets or sets the Azure Location or Azure region where to which the machines - * will be migrated. - */ - private AzureLocation disasterRecoveryLocation; - - /* - * Gets or sets a value indicating whether HADR assessments needs to be created. - */ - private Boolean enableHadrAssessment; - - /* - * Gets or sets a value indicating azure security offering type. - */ - private AzureSecurityOfferingType azureSecurityOfferingType; - - /* - * Reserved instance. - */ - private AzureReservedInstance reservedInstance; - - /* - * SQL server license. - */ - private SqlServerLicense sqlServerLicense; - - /* - * Gets the group type for the assessment. - */ - private GroupType groupType; - - /* - * Assessment type of the assessment. - */ - private AssessmentType assessmentType; - - /* - * Azure Location or Azure region where to which the machines will be migrated. - */ - private String azureLocation; - - /* - * Azure Offer Code. - */ - private AzureOfferCode azureOfferCode; - - /* - * Currency in which prices should be reported. - */ - private AzureCurrency currency; - - /* - * Percentage of buffer that user wants on performance metrics when recommending - * Azure sizes. - */ - private Float scalingFactor; - - /* - * 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; - - /* - * User configurable setting to display the Stage of Assessment. - */ - private AssessmentStage stage; - - /* - * Custom discount percentage. - */ - private Float discountPercentage; - - /* - * Assessment sizing criterion. - */ - private AssessmentSizingCriterion sizingCriterion; - - /* - * Confidence Rating in Percentage. - */ - private Float 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; - - /* - * Schema version. - */ - private String schemaVersion; - - /** - * Creates an instance of SqlAssessmentV2Properties class. - */ - public SqlAssessmentV2Properties() { - } - - /** - * Get the osLicense property: Gets or sets user configurable setting to display the azure hybrid use benefit. - * - * @return the osLicense value. - */ - public OsLicense osLicense() { - return this.osLicense; - } - - /** - * Set the osLicense property: Gets or sets user configurable setting to display the azure hybrid use benefit. - * - * @param osLicense the osLicense value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withOsLicense(OsLicense osLicense) { - this.osLicense = osLicense; - 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 SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withEnvironmentType(EnvironmentType environmentType) { - this.environmentType = environmentType; - return this; - } - - /** - * Get the entityUptime property: Gets or sets the duration for which the entity (SQL, VMs) are up in the - * on-premises environment. - * - * @return the entityUptime value. - */ - public EntityUptime entityUptime() { - return this.entityUptime; - } - - /** - * Set the entityUptime property: Gets or sets the duration for which the entity (SQL, VMs) are up in the - * on-premises environment. - * - * @param entityUptime the entityUptime value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withEntityUptime(EntityUptime entityUptime) { - this.entityUptime = entityUptime; - return this; - } - - /** - * Get the optimizationLogic property: Gets or sets SQL optimization logic. - * - * @return the optimizationLogic value. - */ - public OptimizationLogic optimizationLogic() { - return this.optimizationLogic; - } - - /** - * Set the optimizationLogic property: Gets or sets SQL optimization logic. - * - * @param optimizationLogic the optimizationLogic value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withOptimizationLogic(OptimizationLogic optimizationLogic) { - this.optimizationLogic = optimizationLogic; - return this; - } - - /** - * Get the reservedInstanceForVm property: Gets or sets azure reserved instance for VM. - * - * @return the reservedInstanceForVm value. - */ - public AzureReservedInstance reservedInstanceForVm() { - return this.reservedInstanceForVm; - } - - /** - * Set the reservedInstanceForVm property: Gets or sets azure reserved instance for VM. - * - * @param reservedInstanceForVm the reservedInstanceForVm value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withReservedInstanceForVm(AzureReservedInstance reservedInstanceForVm) { - this.reservedInstanceForVm = reservedInstanceForVm; - return this; - } - - /** - * Get the azureOfferCodeForVm property: Gets or sets Azure Offer Code for VM. - * - * @return the azureOfferCodeForVm value. - */ - public AzureOfferCode azureOfferCodeForVm() { - return this.azureOfferCodeForVm; - } - - /** - * Set the azureOfferCodeForVm property: Gets or sets Azure Offer Code for VM. - * - * @param azureOfferCodeForVm the azureOfferCodeForVm value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withAzureOfferCodeForVm(AzureOfferCode azureOfferCodeForVm) { - this.azureOfferCodeForVm = azureOfferCodeForVm; - return this; - } - - /** - * Get the eaSubscriptionId property: Gets or sets the Enterprise agreement subscription id. - * - * @return the eaSubscriptionId value. - */ - public String eaSubscriptionId() { - return this.eaSubscriptionId; - } - - /** - * Set the eaSubscriptionId property: Gets or sets the Enterprise agreement subscription id. - * - * @param eaSubscriptionId the eaSubscriptionId value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withEaSubscriptionId(String eaSubscriptionId) { - this.eaSubscriptionId = eaSubscriptionId; - return this; - } - - /** - * Get the azureSqlManagedInstanceSettings property: Gets or sets user configurable SQL managed instance settings. - * - * @return the azureSqlManagedInstanceSettings value. - */ - public SqlMiSettings azureSqlManagedInstanceSettings() { - return this.azureSqlManagedInstanceSettings; - } - - /** - * Set the azureSqlManagedInstanceSettings property: Gets or sets user configurable SQL managed instance settings. - * - * @param azureSqlManagedInstanceSettings the azureSqlManagedInstanceSettings value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties - withAzureSqlManagedInstanceSettings(SqlMiSettings azureSqlManagedInstanceSettings) { - this.azureSqlManagedInstanceSettings = azureSqlManagedInstanceSettings; - return this; - } - - /** - * Get the azureSqlDatabaseSettings property: Gets or sets user configurable SQL database settings. - * - * @return the azureSqlDatabaseSettings value. - */ - public SqlDbSettings azureSqlDatabaseSettings() { - return this.azureSqlDatabaseSettings; - } - - /** - * Set the azureSqlDatabaseSettings property: Gets or sets user configurable SQL database settings. - * - * @param azureSqlDatabaseSettings the azureSqlDatabaseSettings value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withAzureSqlDatabaseSettings(SqlDbSettings azureSqlDatabaseSettings) { - this.azureSqlDatabaseSettings = azureSqlDatabaseSettings; - return this; - } - - /** - * Get the azureSqlVmSettings property: Gets or sets user configurable SQL VM settings. - * - * @return the azureSqlVmSettings value. - */ - public SqlVmSettings azureSqlVmSettings() { - return this.azureSqlVmSettings; - } - - /** - * Set the azureSqlVmSettings property: Gets or sets user configurable SQL VM settings. - * - * @param azureSqlVmSettings the azureSqlVmSettings value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withAzureSqlVmSettings(SqlVmSettings azureSqlVmSettings) { - this.azureSqlVmSettings = azureSqlVmSettings; - return this; - } - - /** - * Get the multiSubnetIntent property: Gets or sets user preference indicating intent of multi-subnet configuration. - * - * @return the multiSubnetIntent value. - */ - public MultiSubnetIntent multiSubnetIntent() { - return this.multiSubnetIntent; - } - - /** - * Set the multiSubnetIntent property: Gets or sets user preference indicating intent of multi-subnet configuration. - * - * @param multiSubnetIntent the multiSubnetIntent value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withMultiSubnetIntent(MultiSubnetIntent multiSubnetIntent) { - this.multiSubnetIntent = multiSubnetIntent; - return this; - } - - /** - * Get the asyncCommitModeIntent property: Gets or sets user preference indicating intent of async commit mode. - * - * @return the asyncCommitModeIntent value. - */ - public AsyncCommitModeIntent asyncCommitModeIntent() { - return this.asyncCommitModeIntent; - } - - /** - * Set the asyncCommitModeIntent property: Gets or sets user preference indicating intent of async commit mode. - * - * @param asyncCommitModeIntent the asyncCommitModeIntent value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withAsyncCommitModeIntent(AsyncCommitModeIntent asyncCommitModeIntent) { - this.asyncCommitModeIntent = asyncCommitModeIntent; - return this; - } - - /** - * Get the isInternetAccessAvailable property: Gets or sets a value indicating whether internet access is available. - * - * @return the isInternetAccessAvailable value. - */ - public Boolean isInternetAccessAvailable() { - return this.isInternetAccessAvailable; - } - - /** - * Set the isInternetAccessAvailable property: Gets or sets a value indicating whether internet access is available. - * - * @param isInternetAccessAvailable the isInternetAccessAvailable value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withIsInternetAccessAvailable(Boolean isInternetAccessAvailable) { - this.isInternetAccessAvailable = isInternetAccessAvailable; - return this; - } - - /** - * Get the disasterRecoveryLocation property: Gets or sets the Azure Location or Azure region where to which the - * machines - * will be migrated. - * - * @return the disasterRecoveryLocation value. - */ - public AzureLocation disasterRecoveryLocation() { - return this.disasterRecoveryLocation; - } - - /** - * Set the disasterRecoveryLocation property: Gets or sets the Azure Location or Azure region where to which the - * machines - * will be migrated. - * - * @param disasterRecoveryLocation the disasterRecoveryLocation value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withDisasterRecoveryLocation(AzureLocation disasterRecoveryLocation) { - this.disasterRecoveryLocation = disasterRecoveryLocation; - return this; - } - - /** - * Get the enableHadrAssessment property: Gets or sets a value indicating whether HADR assessments needs to be - * created. - * - * @return the enableHadrAssessment value. - */ - public Boolean enableHadrAssessment() { - return this.enableHadrAssessment; - } - - /** - * Set the enableHadrAssessment property: Gets or sets a value indicating whether HADR assessments needs to be - * created. - * - * @param enableHadrAssessment the enableHadrAssessment value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withEnableHadrAssessment(Boolean enableHadrAssessment) { - this.enableHadrAssessment = enableHadrAssessment; - return this; - } - - /** - * Get the azureSecurityOfferingType property: Gets or sets a value indicating azure security offering type. - * - * @return the azureSecurityOfferingType value. - */ - public AzureSecurityOfferingType azureSecurityOfferingType() { - return this.azureSecurityOfferingType; - } - - /** - * Set the azureSecurityOfferingType property: Gets or sets a value indicating azure security offering type. - * - * @param azureSecurityOfferingType the azureSecurityOfferingType value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties - withAzureSecurityOfferingType(AzureSecurityOfferingType azureSecurityOfferingType) { - this.azureSecurityOfferingType = azureSecurityOfferingType; - return this; - } - - /** - * Get the reservedInstance property: Reserved instance. - * - * @return the reservedInstance value. - */ - public AzureReservedInstance reservedInstance() { - return this.reservedInstance; - } - - /** - * Set the reservedInstance property: Reserved instance. - * - * @param reservedInstance the reservedInstance value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withReservedInstance(AzureReservedInstance reservedInstance) { - this.reservedInstance = reservedInstance; - return this; - } - - /** - * Get the sqlServerLicense property: SQL server license. - * - * @return the sqlServerLicense value. - */ - public SqlServerLicense sqlServerLicense() { - return this.sqlServerLicense; - } - - /** - * Set the sqlServerLicense property: SQL server license. - * - * @param sqlServerLicense the sqlServerLicense value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withSqlServerLicense(SqlServerLicense sqlServerLicense) { - this.sqlServerLicense = sqlServerLicense; - return this; - } - - /** - * Get the groupType property: Gets the group type for the assessment. - * - * @return the groupType value. - */ - public GroupType groupType() { - return this.groupType; - } - - /** - * Set the groupType property: Gets the group type for the assessment. - * - * @param groupType the groupType value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withGroupType(GroupType groupType) { - this.groupType = groupType; - return this; - } - - /** - * Get the assessmentType property: Assessment type of the assessment. - * - * @return the assessmentType value. - */ - public AssessmentType assessmentType() { - return this.assessmentType; - } - - /** - * Set the assessmentType property: Assessment type of the assessment. - * - * @param assessmentType the assessmentType value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withAssessmentType(AssessmentType assessmentType) { - this.assessmentType = assessmentType; - return this; - } - - /** - * 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 SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withAzureLocation(String azureLocation) { - this.azureLocation = azureLocation; - return this; - } - - /** - * Get the azureOfferCode property: Azure Offer Code. - * - * @return the azureOfferCode value. - */ - public AzureOfferCode azureOfferCode() { - return this.azureOfferCode; - } - - /** - * Set the azureOfferCode property: Azure Offer Code. - * - * @param azureOfferCode the azureOfferCode value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withAzureOfferCode(AzureOfferCode azureOfferCode) { - this.azureOfferCode = azureOfferCode; - 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 SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties 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 Float 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 SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withScalingFactor(Float scalingFactor) { - this.scalingFactor = scalingFactor; - return this; - } - - /** - * 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 SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties 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 SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties 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 SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties 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 SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withPerfDataEndTime(OffsetDateTime perfDataEndTime) { - this.perfDataEndTime = perfDataEndTime; - return this; - } - - /** - * Get the stage property: User configurable setting to display the Stage of Assessment. - * - * @return the stage value. - */ - public AssessmentStage stage() { - return this.stage; - } - - /** - * Get the discountPercentage property: Custom discount percentage. - * - * @return the discountPercentage value. - */ - public Float discountPercentage() { - return this.discountPercentage; - } - - /** - * Set the discountPercentage property: Custom discount percentage. - * - * @param discountPercentage the discountPercentage value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withDiscountPercentage(Float 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 SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withSizingCriterion(AssessmentSizingCriterion sizingCriterion) { - this.sizingCriterion = sizingCriterion; - return this; - } - - /** - * Get the confidenceRatingInPercentage property: Confidence Rating in Percentage. - * - * @return the confidenceRatingInPercentage value. - */ - public Float confidenceRatingInPercentage() { - return this.confidenceRatingInPercentage; - } - - /** - * Set the confidenceRatingInPercentage property: Confidence Rating in Percentage. - * - * @param confidenceRatingInPercentage the confidenceRatingInPercentage value to set. - * @return the SqlAssessmentV2Properties object itself. - */ - public SqlAssessmentV2Properties withConfidenceRatingInPercentage(Float confidenceRatingInPercentage) { - this.confidenceRatingInPercentage = confidenceRatingInPercentage; - return this; - } - - /** - * 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; - } - - /** - * Get the schemaVersion property: Schema version. - * - * @return the schemaVersion value. - */ - public String schemaVersion() { - return this.schemaVersion; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlAssessmentV2Properties withProvisioningState(ProvisioningState provisioningState) { - super.withProvisioningState(provisioningState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (entityUptime() != null) { - entityUptime().validate(); - } - if (azureSqlManagedInstanceSettings() != null) { - azureSqlManagedInstanceSettings().validate(); - } - if (azureSqlDatabaseSettings() != null) { - azureSqlDatabaseSettings().validate(); - } - if (azureSqlVmSettings() != null) { - azureSqlVmSettings().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provisioningState", - provisioningState() == null ? null : provisioningState().toString()); - jsonWriter.writeStringField("osLicense", this.osLicense == null ? null : this.osLicense.toString()); - jsonWriter.writeStringField("environmentType", - this.environmentType == null ? null : this.environmentType.toString()); - jsonWriter.writeJsonField("entityUptime", this.entityUptime); - jsonWriter.writeStringField("optimizationLogic", - this.optimizationLogic == null ? null : this.optimizationLogic.toString()); - jsonWriter.writeStringField("reservedInstanceForVm", - this.reservedInstanceForVm == null ? null : this.reservedInstanceForVm.toString()); - jsonWriter.writeStringField("azureOfferCodeForVm", - this.azureOfferCodeForVm == null ? null : this.azureOfferCodeForVm.toString()); - jsonWriter.writeStringField("eaSubscriptionId", this.eaSubscriptionId); - jsonWriter.writeJsonField("azureSqlManagedInstanceSettings", this.azureSqlManagedInstanceSettings); - jsonWriter.writeJsonField("azureSqlDatabaseSettings", this.azureSqlDatabaseSettings); - jsonWriter.writeJsonField("azureSqlVmSettings", this.azureSqlVmSettings); - jsonWriter.writeStringField("multiSubnetIntent", - this.multiSubnetIntent == null ? null : this.multiSubnetIntent.toString()); - jsonWriter.writeStringField("asyncCommitModeIntent", - this.asyncCommitModeIntent == null ? null : this.asyncCommitModeIntent.toString()); - jsonWriter.writeBooleanField("isInternetAccessAvailable", this.isInternetAccessAvailable); - jsonWriter.writeStringField("disasterRecoveryLocation", - this.disasterRecoveryLocation == null ? null : this.disasterRecoveryLocation.toString()); - jsonWriter.writeBooleanField("enableHadrAssessment", this.enableHadrAssessment); - jsonWriter.writeStringField("azureSecurityOfferingType", - this.azureSecurityOfferingType == null ? null : this.azureSecurityOfferingType.toString()); - jsonWriter.writeStringField("reservedInstance", - this.reservedInstance == null ? null : this.reservedInstance.toString()); - jsonWriter.writeStringField("sqlServerLicense", - this.sqlServerLicense == null ? null : this.sqlServerLicense.toString()); - jsonWriter.writeStringField("groupType", this.groupType == null ? null : this.groupType.toString()); - jsonWriter.writeStringField("assessmentType", - this.assessmentType == null ? null : this.assessmentType.toString()); - jsonWriter.writeStringField("azureLocation", this.azureLocation); - jsonWriter.writeStringField("azureOfferCode", - this.azureOfferCode == null ? null : this.azureOfferCode.toString()); - jsonWriter.writeStringField("currency", this.currency == null ? null : this.currency.toString()); - jsonWriter.writeNumberField("scalingFactor", this.scalingFactor); - 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)); - jsonWriter.writeNumberField("discountPercentage", this.discountPercentage); - jsonWriter.writeStringField("sizingCriterion", - this.sizingCriterion == null ? null : this.sizingCriterion.toString()); - jsonWriter.writeNumberField("confidenceRatingInPercentage", this.confidenceRatingInPercentage); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SqlAssessmentV2Properties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlAssessmentV2Properties 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 SqlAssessmentV2Properties. - */ - public static SqlAssessmentV2Properties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlAssessmentV2Properties deserializedSqlAssessmentV2Properties = new SqlAssessmentV2Properties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedSqlAssessmentV2Properties - .withProvisioningState(ProvisioningState.fromString(reader.getString())); - } else if ("osLicense".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.osLicense = OsLicense.fromString(reader.getString()); - } else if ("environmentType".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.environmentType - = EnvironmentType.fromString(reader.getString()); - } else if ("entityUptime".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.entityUptime = EntityUptime.fromJson(reader); - } else if ("optimizationLogic".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.optimizationLogic - = OptimizationLogic.fromString(reader.getString()); - } else if ("reservedInstanceForVm".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.reservedInstanceForVm - = AzureReservedInstance.fromString(reader.getString()); - } else if ("azureOfferCodeForVm".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.azureOfferCodeForVm - = AzureOfferCode.fromString(reader.getString()); - } else if ("eaSubscriptionId".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.eaSubscriptionId = reader.getString(); - } else if ("azureSqlManagedInstanceSettings".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.azureSqlManagedInstanceSettings - = SqlMiSettings.fromJson(reader); - } else if ("azureSqlDatabaseSettings".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.azureSqlDatabaseSettings = SqlDbSettings.fromJson(reader); - } else if ("azureSqlVmSettings".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.azureSqlVmSettings = SqlVmSettings.fromJson(reader); - } else if ("multiSubnetIntent".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.multiSubnetIntent - = MultiSubnetIntent.fromString(reader.getString()); - } else if ("asyncCommitModeIntent".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.asyncCommitModeIntent - = AsyncCommitModeIntent.fromString(reader.getString()); - } else if ("isInternetAccessAvailable".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.isInternetAccessAvailable - = reader.getNullable(JsonReader::getBoolean); - } else if ("disasterRecoveryLocation".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.disasterRecoveryLocation - = AzureLocation.fromString(reader.getString()); - } else if ("enableHadrAssessment".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.enableHadrAssessment - = reader.getNullable(JsonReader::getBoolean); - } else if ("azureSecurityOfferingType".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.azureSecurityOfferingType - = AzureSecurityOfferingType.fromString(reader.getString()); - } else if ("reservedInstance".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.reservedInstance - = AzureReservedInstance.fromString(reader.getString()); - } else if ("sqlServerLicense".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.sqlServerLicense - = SqlServerLicense.fromString(reader.getString()); - } else if ("groupType".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.groupType = GroupType.fromString(reader.getString()); - } else if ("assessmentType".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.assessmentType - = AssessmentType.fromString(reader.getString()); - } else if ("azureLocation".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.azureLocation = reader.getString(); - } else if ("azureOfferCode".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.azureOfferCode - = AzureOfferCode.fromString(reader.getString()); - } else if ("currency".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.currency = AzureCurrency.fromString(reader.getString()); - } else if ("scalingFactor".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.scalingFactor = reader.getNullable(JsonReader::getFloat); - } else if ("percentile".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.percentile = Percentile.fromString(reader.getString()); - } else if ("timeRange".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.timeRange = TimeRange.fromString(reader.getString()); - } else if ("perfDataStartTime".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.perfDataStartTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("perfDataEndTime".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.perfDataEndTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("stage".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.stage = AssessmentStage.fromString(reader.getString()); - } else if ("discountPercentage".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.discountPercentage = reader.getNullable(JsonReader::getFloat); - } else if ("sizingCriterion".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.sizingCriterion - = AssessmentSizingCriterion.fromString(reader.getString()); - } else if ("confidenceRatingInPercentage".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.confidenceRatingInPercentage - = reader.getNullable(JsonReader::getFloat); - } else if ("pricesTimestamp".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.pricesTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("createdTimestamp".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.createdTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("updatedTimestamp".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.updatedTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("status".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.status = AssessmentStatus.fromString(reader.getString()); - } else if ("schemaVersion".equals(fieldName)) { - deserializedSqlAssessmentV2Properties.schemaVersion = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlAssessmentV2Properties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2Summary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2Summary.java deleted file mode 100644 index 428f9cb21320..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2Summary.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV2SummaryInner; - -/** - * An immutable client-side representation of SqlAssessmentV2Summary. - */ -public interface SqlAssessmentV2Summary { - /** - * 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. - */ - SqlAssessmentV2SummaryProperties 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.migration.assessment.fluent.models.SqlAssessmentV2SummaryInner object. - * - * @return the inner object. - */ - SqlAssessmentV2SummaryInner innerModel(); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2SummaryData.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2SummaryData.java deleted file mode 100644 index d41170b4aa65..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2SummaryData.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.Map; - -/** - * SQL Assessment V2 summary data. - */ -@Immutable -public final class SqlAssessmentV2SummaryData implements JsonSerializable { - /* - * Sql assessment summary data - */ - private Map suitabilitySummary; - - /* - * Monthly compute cost - */ - private Float monthlyComputeCost; - - /* - * Monthly storage cost - */ - private Float monthlyStorageCost; - - /* - * Monthly license cost - */ - private Float monthlyLicenseCost; - - /* - * Confidence Rating - */ - private Float confidenceScore; - - /* - * Monthly security cost - */ - private Float monthlySecurityCost; - - /** - * Creates an instance of SqlAssessmentV2SummaryData class. - */ - public SqlAssessmentV2SummaryData() { - } - - /** - * Get the suitabilitySummary property: Sql assessment summary data. - * - * @return the suitabilitySummary value. - */ - public Map suitabilitySummary() { - return this.suitabilitySummary; - } - - /** - * Get the monthlyComputeCost property: Monthly compute cost. - * - * @return the monthlyComputeCost value. - */ - public Float monthlyComputeCost() { - return this.monthlyComputeCost; - } - - /** - * Get the monthlyStorageCost property: Monthly storage cost. - * - * @return the monthlyStorageCost value. - */ - public Float monthlyStorageCost() { - return this.monthlyStorageCost; - } - - /** - * Get the monthlyLicenseCost property: Monthly license cost. - * - * @return the monthlyLicenseCost value. - */ - public Float monthlyLicenseCost() { - return this.monthlyLicenseCost; - } - - /** - * Get the confidenceScore property: Confidence Rating. - * - * @return the confidenceScore value. - */ - public Float confidenceScore() { - return this.confidenceScore; - } - - /** - * Get the monthlySecurityCost property: Monthly security cost. - * - * @return the monthlySecurityCost value. - */ - public Float monthlySecurityCost() { - return this.monthlySecurityCost; - } - - /** - * 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 SqlAssessmentV2SummaryData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlAssessmentV2SummaryData 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 SqlAssessmentV2SummaryData. - */ - public static SqlAssessmentV2SummaryData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlAssessmentV2SummaryData deserializedSqlAssessmentV2SummaryData = new SqlAssessmentV2SummaryData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("suitabilitySummary".equals(fieldName)) { - Map suitabilitySummary = reader.readMap(reader1 -> reader1.getInt()); - deserializedSqlAssessmentV2SummaryData.suitabilitySummary = suitabilitySummary; - } else if ("monthlyComputeCost".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryData.monthlyComputeCost - = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyStorageCost".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryData.monthlyStorageCost - = reader.getNullable(JsonReader::getFloat); - } else if ("monthlyLicenseCost".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryData.monthlyLicenseCost - = reader.getNullable(JsonReader::getFloat); - } else if ("confidenceScore".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryData.confidenceScore = reader.getNullable(JsonReader::getFloat); - } else if ("monthlySecurityCost".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryData.monthlySecurityCost - = reader.getNullable(JsonReader::getFloat); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlAssessmentV2SummaryData; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2SummaryListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2SummaryListResult.java deleted file mode 100644 index 9cce76728e23..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2SummaryListResult.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.annotation.Fluent; -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.migration.assessment.fluent.models.SqlAssessmentV2SummaryInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a SqlAssessmentV2Summary list operation. - */ -@Fluent -public final class SqlAssessmentV2SummaryListResult implements JsonSerializable { - /* - * The SqlAssessmentV2Summary items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of SqlAssessmentV2SummaryListResult class. - */ - public SqlAssessmentV2SummaryListResult() { - } - - /** - * Get the value property: The SqlAssessmentV2Summary items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The SqlAssessmentV2Summary items on this page. - * - * @param value the value value to set. - * @return the SqlAssessmentV2SummaryListResult object itself. - */ - public SqlAssessmentV2SummaryListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the SqlAssessmentV2SummaryListResult object itself. - */ - public SqlAssessmentV2SummaryListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * 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 SqlAssessmentV2SummaryListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SqlAssessmentV2SummaryListResult.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 SqlAssessmentV2SummaryListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlAssessmentV2SummaryListResult 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 SqlAssessmentV2SummaryListResult. - */ - public static SqlAssessmentV2SummaryListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlAssessmentV2SummaryListResult deserializedSqlAssessmentV2SummaryListResult - = new SqlAssessmentV2SummaryListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SqlAssessmentV2SummaryInner.fromJson(reader1)); - deserializedSqlAssessmentV2SummaryListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlAssessmentV2SummaryListResult; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2SummaryOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2SummaryOperations.java deleted file mode 100644 index 62a8b832ae7a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2SummaryOperations.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 SqlAssessmentV2SummaryOperations. - */ -public interface SqlAssessmentV2SummaryOperations { - /** - * List SqlAssessmentV2Summary resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2Summary list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName); - - /** - * List SqlAssessmentV2Summary resources by SqlAssessmentV2. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment 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 SqlAssessmentV2Summary list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySqlAssessmentV2(String resourceGroupName, String projectName, - String groupName, String assessmentName, Context context); - - /** - * Get a SqlAssessmentV2Summary. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV2Summary along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String projectName, String groupName, - String assessmentName, String summaryName, Context context); - - /** - * Get a SqlAssessmentV2Summary. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param projectName Assessment Project Name. - * @param groupName Group ARM name. - * @param assessmentName SQL Assessment arm name. - * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV2Summary. - */ - SqlAssessmentV2Summary get(String resourceGroupName, String projectName, String groupName, String assessmentName, - String summaryName); -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2SummaryProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2SummaryProperties.java deleted file mode 100644 index d2a57d86e4ac..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV2SummaryProperties.java +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.Map; - -/** - * SQL Assessment V2 summary properties. - */ -@Immutable -public final class SqlAssessmentV2SummaryProperties implements JsonSerializable { - /* - * Gets or sets the Assessment summary. - */ - private Map assessmentSummary; - - /* - * Gets the distribution of sqlInstances by support status. - */ - private Map distributionBySupportStatus; - - /* - * Gets the distribution distribution of sqlInstances by service pack insight. - */ - private Map distributionByServicePackInsight; - - /* - * Gets the distribution of sqlInstances by sql version. - */ - private Map distributionBySqlVersion; - - /* - * Gets the distribution of sqlInstances by sql edition. - */ - private Map distributionBySqlEdition; - - /* - * Gets the instance distribution by sizing criterion. - */ - private Map instanceDistributionBySizingCriterion; - - /* - * Gets the database distribution by sizing criterion. - */ - private Map databaseDistributionBySizingCriterion; - - /* - * Number of machines part of the assessment. - */ - private Integer numberOfMachines; - - /* - * Number of sql instances part of the assessment. - */ - private Integer numberOfSqlInstances; - - /* - * Number of successfully discovered sql instances part of the assessment. - */ - private Integer numberOfSuccessfullyDiscoveredSqlInstances; - - /* - * Number of sql databases part of the assessment. - */ - private Integer numberOfSqlDatabases; - - /* - * Number of sql failover cluster instances part of the assessment. - */ - private Integer numberOfFciInstances; - - /* - * Number of sql availability groups part of the assessment. - */ - private Integer numberOfSqlAvailabilityGroups; - - /** - * Creates an instance of SqlAssessmentV2SummaryProperties class. - */ - public SqlAssessmentV2SummaryProperties() { - } - - /** - * Get the assessmentSummary property: Gets or sets the Assessment summary. - * - * @return the assessmentSummary value. - */ - public Map assessmentSummary() { - return this.assessmentSummary; - } - - /** - * Get the distributionBySupportStatus property: Gets the distribution of sqlInstances by support status. - * - * @return the distributionBySupportStatus value. - */ - public Map distributionBySupportStatus() { - return this.distributionBySupportStatus; - } - - /** - * Get the distributionByServicePackInsight property: Gets the distribution distribution of sqlInstances by service - * pack insight. - * - * @return the distributionByServicePackInsight value. - */ - public Map distributionByServicePackInsight() { - return this.distributionByServicePackInsight; - } - - /** - * Get the distributionBySqlVersion property: Gets the distribution of sqlInstances by sql version. - * - * @return the distributionBySqlVersion value. - */ - public Map distributionBySqlVersion() { - return this.distributionBySqlVersion; - } - - /** - * Get the distributionBySqlEdition property: Gets the distribution of sqlInstances by sql edition. - * - * @return the distributionBySqlEdition value. - */ - public Map distributionBySqlEdition() { - return this.distributionBySqlEdition; - } - - /** - * Get the instanceDistributionBySizingCriterion property: Gets the instance distribution by sizing criterion. - * - * @return the instanceDistributionBySizingCriterion value. - */ - public Map instanceDistributionBySizingCriterion() { - return this.instanceDistributionBySizingCriterion; - } - - /** - * Get the databaseDistributionBySizingCriterion property: Gets the database distribution by sizing criterion. - * - * @return the databaseDistributionBySizingCriterion value. - */ - public Map databaseDistributionBySizingCriterion() { - return this.databaseDistributionBySizingCriterion; - } - - /** - * Get the numberOfMachines property: Number of machines part of the assessment. - * - * @return the numberOfMachines value. - */ - public Integer numberOfMachines() { - return this.numberOfMachines; - } - - /** - * Get the numberOfSqlInstances property: Number of sql instances part of the assessment. - * - * @return the numberOfSqlInstances value. - */ - public Integer numberOfSqlInstances() { - return this.numberOfSqlInstances; - } - - /** - * Get the numberOfSuccessfullyDiscoveredSqlInstances property: Number of successfully discovered sql instances part - * of the assessment. - * - * @return the numberOfSuccessfullyDiscoveredSqlInstances value. - */ - public Integer numberOfSuccessfullyDiscoveredSqlInstances() { - return this.numberOfSuccessfullyDiscoveredSqlInstances; - } - - /** - * Get the numberOfSqlDatabases property: Number of sql databases part of the assessment. - * - * @return the numberOfSqlDatabases value. - */ - public Integer numberOfSqlDatabases() { - return this.numberOfSqlDatabases; - } - - /** - * Get the numberOfFciInstances property: Number of sql failover cluster instances part of the assessment. - * - * @return the numberOfFciInstances value. - */ - public Integer numberOfFciInstances() { - return this.numberOfFciInstances; - } - - /** - * Get the numberOfSqlAvailabilityGroups property: Number of sql availability groups part of the assessment. - * - * @return the numberOfSqlAvailabilityGroups value. - */ - public Integer numberOfSqlAvailabilityGroups() { - return this.numberOfSqlAvailabilityGroups; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (assessmentSummary() != null) { - assessmentSummary().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SqlAssessmentV2SummaryProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlAssessmentV2SummaryProperties 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 SqlAssessmentV2SummaryProperties. - */ - public static SqlAssessmentV2SummaryProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlAssessmentV2SummaryProperties deserializedSqlAssessmentV2SummaryProperties - = new SqlAssessmentV2SummaryProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("assessmentSummary".equals(fieldName)) { - Map assessmentSummary - = reader.readMap(reader1 -> SqlAssessmentV2SummaryData.fromJson(reader1)); - deserializedSqlAssessmentV2SummaryProperties.assessmentSummary = assessmentSummary; - } else if ("distributionBySupportStatus".equals(fieldName)) { - Map distributionBySupportStatus = reader.readMap(reader1 -> reader1.getInt()); - deserializedSqlAssessmentV2SummaryProperties.distributionBySupportStatus - = distributionBySupportStatus; - } else if ("distributionByServicePackInsight".equals(fieldName)) { - Map distributionByServicePackInsight = reader.readMap(reader1 -> reader1.getInt()); - deserializedSqlAssessmentV2SummaryProperties.distributionByServicePackInsight - = distributionByServicePackInsight; - } else if ("distributionBySqlVersion".equals(fieldName)) { - Map distributionBySqlVersion = reader.readMap(reader1 -> reader1.getInt()); - deserializedSqlAssessmentV2SummaryProperties.distributionBySqlVersion = distributionBySqlVersion; - } else if ("distributionBySqlEdition".equals(fieldName)) { - Map distributionBySqlEdition = reader.readMap(reader1 -> reader1.getInt()); - deserializedSqlAssessmentV2SummaryProperties.distributionBySqlEdition = distributionBySqlEdition; - } else if ("instanceDistributionBySizingCriterion".equals(fieldName)) { - Map instanceDistributionBySizingCriterion - = reader.readMap(reader1 -> reader1.getInt()); - deserializedSqlAssessmentV2SummaryProperties.instanceDistributionBySizingCriterion - = instanceDistributionBySizingCriterion; - } else if ("databaseDistributionBySizingCriterion".equals(fieldName)) { - Map databaseDistributionBySizingCriterion - = reader.readMap(reader1 -> reader1.getInt()); - deserializedSqlAssessmentV2SummaryProperties.databaseDistributionBySizingCriterion - = databaseDistributionBySizingCriterion; - } else if ("numberOfMachines".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryProperties.numberOfMachines - = reader.getNullable(JsonReader::getInt); - } else if ("numberOfSqlInstances".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryProperties.numberOfSqlInstances - = reader.getNullable(JsonReader::getInt); - } else if ("numberOfSuccessfullyDiscoveredSqlInstances".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryProperties.numberOfSuccessfullyDiscoveredSqlInstances - = reader.getNullable(JsonReader::getInt); - } else if ("numberOfSqlDatabases".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryProperties.numberOfSqlDatabases - = reader.getNullable(JsonReader::getInt); - } else if ("numberOfFciInstances".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryProperties.numberOfFciInstances - = reader.getNullable(JsonReader::getInt); - } else if ("numberOfSqlAvailabilityGroups".equals(fieldName)) { - deserializedSqlAssessmentV2SummaryProperties.numberOfSqlAvailabilityGroups - = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlAssessmentV2SummaryProperties; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3.java new file mode 100644 index 000000000000..1a04d867fe2b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV3Inner; + +/** + * An immutable client-side representation of SqlAssessmentV3. + */ +public interface SqlAssessmentV3 { + /** + * 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. + */ + SqlAssessmentV3Properties 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.migration.assessment.fluent.models.SqlAssessmentV3Inner object. + * + * @return the inner object. + */ + SqlAssessmentV3Inner innerModel(); + + /** + * The entirety of the SqlAssessmentV3 definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The SqlAssessmentV3 definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SqlAssessmentV3 definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the SqlAssessmentV3 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 SqlAssessmentV3 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. + */ + SqlAssessmentV3 create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SqlAssessmentV3 create(Context context); + } + + /** + * The stage of the SqlAssessmentV3 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(SqlAssessmentV3Properties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SqlAssessmentV3 refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SqlAssessmentV3 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 the URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(Object 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 the URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(Object body, Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3ListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3ListResult.java new file mode 100644 index 000000000000..96ec4e8c85c7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3ListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.SqlAssessmentV3Inner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SqlAssessmentV3 list operation. + */ +@Fluent +public final class SqlAssessmentV3ListResult implements JsonSerializable { + /* + * The SqlAssessmentV3 items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SqlAssessmentV3ListResult class. + */ + public SqlAssessmentV3ListResult() { + } + + /** + * Get the value property: The SqlAssessmentV3 items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SqlAssessmentV3 items on this page. + * + * @param value the value value to set. + * @return the SqlAssessmentV3ListResult object itself. + */ + public SqlAssessmentV3ListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SqlAssessmentV3ListResult object itself. + */ + public SqlAssessmentV3ListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 SqlAssessmentV3ListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SqlAssessmentV3ListResult.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 SqlAssessmentV3ListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlAssessmentV3ListResult 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 SqlAssessmentV3ListResult. + */ + public static SqlAssessmentV3ListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlAssessmentV3ListResult deserializedSqlAssessmentV3ListResult = new SqlAssessmentV3ListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SqlAssessmentV3Inner.fromJson(reader1)); + deserializedSqlAssessmentV3ListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSqlAssessmentV3ListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlAssessmentV3ListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3Operations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3Operations.java new file mode 100644 index 000000000000..04e33181e3f2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3Operations.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SqlAssessmentV3Operations. + */ +public interface SqlAssessmentV3Operations { + /** + * List SqlAssessmentV3 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 SqlAssessmentV3 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List SqlAssessmentV3 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 SqlAssessmentV3 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + Context context); + + /** + * Get a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3. + */ + SqlAssessmentV3 get(String resourceGroupName, String projectName, String assessmentName); + + /** + * Delete a SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SQL Assessment 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 URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object 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 SQL Assessment 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 URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object body, + Context context); + + /** + * Get a SqlAssessmentV3. + * + * @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 SqlAssessmentV3 along with {@link Response}. + */ + SqlAssessmentV3 getById(String id); + + /** + * Get a SqlAssessmentV3. + * + * @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 SqlAssessmentV3 along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a SqlAssessmentV3. + * + * @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 SqlAssessmentV3. + * + * @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 SqlAssessmentV3 resource. + * + * @param name resource name. + * @return the first stage of the new SqlAssessmentV3 definition. + */ + SqlAssessmentV3.DefinitionStages.Blank define(String name); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3Properties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3Properties.java new file mode 100644 index 000000000000..ad5f65ac2e31 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3Properties.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * SQL assessment properties class. + */ +@Fluent +public final class SqlAssessmentV3Properties 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 SqlAssessmentSettings settings; + + /* + * Gets or sets the details of the assessment. + */ + private AssessmentDetails details; + + /* + * Gets or sets the machine assessment ARM ID for VM fallback. + */ + private String fallbackMachineAssessmentArmId; + + /** + * Creates an instance of SqlAssessmentV3Properties class. + */ + public SqlAssessmentV3Properties() { + } + + /** + * 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 SqlAssessmentV3Properties object itself. + */ + public SqlAssessmentV3Properties 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 SqlAssessmentSettings 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 SqlAssessmentV3Properties object itself. + */ + public SqlAssessmentV3Properties withSettings(SqlAssessmentSettings 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 SqlAssessmentV3Properties object itself. + */ + public SqlAssessmentV3Properties withDetails(AssessmentDetails details) { + this.details = details; + return this; + } + + /** + * Get the fallbackMachineAssessmentArmId property: Gets or sets the machine assessment ARM ID for VM fallback. + * + * @return the fallbackMachineAssessmentArmId value. + */ + public String fallbackMachineAssessmentArmId() { + return this.fallbackMachineAssessmentArmId; + } + + /** + * Set the fallbackMachineAssessmentArmId property: Gets or sets the machine assessment ARM ID for VM fallback. + * + * @param fallbackMachineAssessmentArmId the fallbackMachineAssessmentArmId value to set. + * @return the SqlAssessmentV3Properties object itself. + */ + public SqlAssessmentV3Properties withFallbackMachineAssessmentArmId(String fallbackMachineAssessmentArmId) { + this.fallbackMachineAssessmentArmId = fallbackMachineAssessmentArmId; + 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); + jsonWriter.writeStringField("fallbackMachineAssessmentArmId", this.fallbackMachineAssessmentArmId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlAssessmentV3Properties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlAssessmentV3Properties 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 SqlAssessmentV3Properties. + */ + public static SqlAssessmentV3Properties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlAssessmentV3Properties deserializedSqlAssessmentV3Properties = new SqlAssessmentV3Properties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSqlAssessmentV3Properties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("scope".equals(fieldName)) { + deserializedSqlAssessmentV3Properties.scope = Scope.fromJson(reader); + } else if ("settings".equals(fieldName)) { + deserializedSqlAssessmentV3Properties.settings = SqlAssessmentSettings.fromJson(reader); + } else if ("details".equals(fieldName)) { + deserializedSqlAssessmentV3Properties.details = AssessmentDetails.fromJson(reader); + } else if ("fallbackMachineAssessmentArmId".equals(fieldName)) { + deserializedSqlAssessmentV3Properties.fallbackMachineAssessmentArmId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlAssessmentV3Properties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3Summary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3Summary.java new file mode 100644 index 000000000000..b97d3b16bdb7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3Summary.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV3SummaryInner; + +/** + * An immutable client-side representation of SqlAssessmentV3Summary. + */ +public interface SqlAssessmentV3Summary { + /** + * 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.migration.assessment.fluent.models.SqlAssessmentV3SummaryInner object. + * + * @return the inner object. + */ + SqlAssessmentV3SummaryInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3SummaryListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3SummaryListResult.java new file mode 100644 index 000000000000..18dbc037bbb7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3SummaryListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.SqlAssessmentV3SummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SqlAssessmentV3Summary list operation. + */ +@Fluent +public final class SqlAssessmentV3SummaryListResult implements JsonSerializable { + /* + * The SqlAssessmentV3Summary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SqlAssessmentV3SummaryListResult class. + */ + public SqlAssessmentV3SummaryListResult() { + } + + /** + * Get the value property: The SqlAssessmentV3Summary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SqlAssessmentV3Summary items on this page. + * + * @param value the value value to set. + * @return the SqlAssessmentV3SummaryListResult object itself. + */ + public SqlAssessmentV3SummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SqlAssessmentV3SummaryListResult object itself. + */ + public SqlAssessmentV3SummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 SqlAssessmentV3SummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SqlAssessmentV3SummaryListResult.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 SqlAssessmentV3SummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlAssessmentV3SummaryListResult 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 SqlAssessmentV3SummaryListResult. + */ + public static SqlAssessmentV3SummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlAssessmentV3SummaryListResult deserializedSqlAssessmentV3SummaryListResult + = new SqlAssessmentV3SummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SqlAssessmentV3SummaryInner.fromJson(reader1)); + deserializedSqlAssessmentV3SummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSqlAssessmentV3SummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlAssessmentV3SummaryListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3SummaryOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3SummaryOperations.java new file mode 100644 index 000000000000..d290f7ca5c3e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlAssessmentV3SummaryOperations.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SqlAssessmentV3SummaryOperations. + */ +public interface SqlAssessmentV3SummaryOperations { + /** + * List SqlAssessmentV3Summary resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3Summary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List SqlAssessmentV3Summary resources by SqlAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment 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 SqlAssessmentV3Summary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a SqlAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV3Summary along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String summaryName, Context context); + + /** + * Get a SqlAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName SQL Assessment arm name. + * @param summaryName Gets the Name of the SQL 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 SqlAssessmentV3Summary. + */ + SqlAssessmentV3Summary get(String resourceGroupName, String projectName, String assessmentName, String summaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlCollectorOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlCollectorOperations.java index 475cb46ff246..a3abe34f8353 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlCollectorOperations.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlCollectorOperations.java @@ -22,7 +22,7 @@ public interface SqlCollectorOperations { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a SqlCollector list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List SqlCollector resources by AssessmentProject. @@ -35,7 +35,7 @@ public interface SqlCollectorOperations { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a SqlCollector list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, Context context); + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** * Get a SqlCollector. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlDbExtendedDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlDbExtendedDetails.java new file mode 100644 index 000000000000..a5fce833e5b1 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlDbExtendedDetails.java @@ -0,0 +1,387 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * The sql db source information. + */ +@Fluent +public final class SqlDbExtendedDetails implements JsonSerializable { + /* + * The linked availability group overview. + */ + private SqlAvailabilityGroupDataOverview linkedAvailabilityGroupOverview; + + /* + * The product support status. + */ + private ProductSupportStatus productSupportStatus; + + /* + * the aggregated cache size of this database. + */ + private Float bufferCacheSizeInMB; + + /* + * The product support status. + */ + private Boolean isDatabaseHighlyAvailable; + + /* + * The product support status. + */ + private Float databaseSizeInMB; + + /* + * Database compatibility level. + */ + private CompatibilityLevel compatibilityLevel; + + /* + * The percentage of the total number of cores being utilized by the SQL database. + */ + private Float percentageCoresUtilization; + + /* + * The read throughput of the SQL database. + */ + private Float megabytesPerSecondOfRead; + + /* + * The write throughput of the SQL database. + */ + private Float megabytesPerSecondOfWrite; + + /* + * The read operations per second of the SQL database. + */ + private Float numberOfReadOperationsPerSecond; + + /* + * The write operations per second of the SQL database. + */ + private Float numberOfWriteOperationsPerSecond; + + /* + * Gets or sets the SQL version. + */ + private String sqlVersion; + + /* + * Gets or sets the SQL edition. + */ + private String sqlEdition; + + /* + * Gets or sets a value indicating whether the parent SQL instance is clustered or not. + */ + private Boolean isClustered; + + /* + * Gets or sets a value indicating whether the high availability is enabled or not. + */ + private Boolean isHighAvailabilityEnabled; + + /** + * Creates an instance of SqlDbExtendedDetails class. + */ + public SqlDbExtendedDetails() { + } + + /** + * Get the linkedAvailabilityGroupOverview property: The linked availability group overview. + * + * @return the linkedAvailabilityGroupOverview value. + */ + public SqlAvailabilityGroupDataOverview linkedAvailabilityGroupOverview() { + return this.linkedAvailabilityGroupOverview; + } + + /** + * Get the productSupportStatus property: The product support status. + * + * @return the productSupportStatus value. + */ + public ProductSupportStatus productSupportStatus() { + return this.productSupportStatus; + } + + /** + * Get the bufferCacheSizeInMB property: the aggregated cache size of this database. + * + * @return the bufferCacheSizeInMB value. + */ + public Float bufferCacheSizeInMB() { + return this.bufferCacheSizeInMB; + } + + /** + * Get the isDatabaseHighlyAvailable property: The product support status. + * + * @return the isDatabaseHighlyAvailable value. + */ + public Boolean isDatabaseHighlyAvailable() { + return this.isDatabaseHighlyAvailable; + } + + /** + * Get the databaseSizeInMB property: The product support status. + * + * @return the databaseSizeInMB value. + */ + public Float databaseSizeInMB() { + return this.databaseSizeInMB; + } + + /** + * Get the compatibilityLevel property: Database compatibility level. + * + * @return the compatibilityLevel value. + */ + public CompatibilityLevel compatibilityLevel() { + return this.compatibilityLevel; + } + + /** + * Get the percentageCoresUtilization property: The percentage of the total number of cores being utilized by the + * SQL database. + * + * @return the percentageCoresUtilization value. + */ + public Float percentageCoresUtilization() { + return this.percentageCoresUtilization; + } + + /** + * Get the megabytesPerSecondOfRead property: The read throughput of the SQL database. + * + * @return the megabytesPerSecondOfRead value. + */ + public Float megabytesPerSecondOfRead() { + return this.megabytesPerSecondOfRead; + } + + /** + * Get the megabytesPerSecondOfWrite property: The write throughput of the SQL database. + * + * @return the megabytesPerSecondOfWrite value. + */ + public Float megabytesPerSecondOfWrite() { + return this.megabytesPerSecondOfWrite; + } + + /** + * Get the numberOfReadOperationsPerSecond property: The read operations per second of the SQL database. + * + * @return the numberOfReadOperationsPerSecond value. + */ + public Float numberOfReadOperationsPerSecond() { + return this.numberOfReadOperationsPerSecond; + } + + /** + * Get the numberOfWriteOperationsPerSecond property: The write operations per second of the SQL database. + * + * @return the numberOfWriteOperationsPerSecond value. + */ + public Float numberOfWriteOperationsPerSecond() { + return this.numberOfWriteOperationsPerSecond; + } + + /** + * Get the sqlVersion property: Gets or sets the SQL version. + * + * @return the sqlVersion value. + */ + public String sqlVersion() { + return this.sqlVersion; + } + + /** + * Set the sqlVersion property: Gets or sets the SQL version. + * + * @param sqlVersion the sqlVersion value to set. + * @return the SqlDbExtendedDetails object itself. + */ + public SqlDbExtendedDetails withSqlVersion(String sqlVersion) { + this.sqlVersion = sqlVersion; + return this; + } + + /** + * Get the sqlEdition property: Gets or sets the SQL edition. + * + * @return the sqlEdition value. + */ + public String sqlEdition() { + return this.sqlEdition; + } + + /** + * Set the sqlEdition property: Gets or sets the SQL edition. + * + * @param sqlEdition the sqlEdition value to set. + * @return the SqlDbExtendedDetails object itself. + */ + public SqlDbExtendedDetails withSqlEdition(String sqlEdition) { + this.sqlEdition = sqlEdition; + return this; + } + + /** + * Get the isClustered property: Gets or sets a value indicating whether the parent SQL instance is clustered or + * not. + * + * @return the isClustered value. + */ + public Boolean isClustered() { + return this.isClustered; + } + + /** + * Set the isClustered property: Gets or sets a value indicating whether the parent SQL instance is clustered or + * not. + * + * @param isClustered the isClustered value to set. + * @return the SqlDbExtendedDetails object itself. + */ + public SqlDbExtendedDetails withIsClustered(Boolean isClustered) { + this.isClustered = isClustered; + return this; + } + + /** + * Get the isHighAvailabilityEnabled property: Gets or sets a value indicating whether the high availability is + * enabled or not. + * + * @return the isHighAvailabilityEnabled value. + */ + public Boolean isHighAvailabilityEnabled() { + return this.isHighAvailabilityEnabled; + } + + /** + * Set the isHighAvailabilityEnabled property: Gets or sets a value indicating whether the high availability is + * enabled or not. + * + * @param isHighAvailabilityEnabled the isHighAvailabilityEnabled value to set. + * @return the SqlDbExtendedDetails object itself. + */ + public SqlDbExtendedDetails withIsHighAvailabilityEnabled(Boolean isHighAvailabilityEnabled) { + this.isHighAvailabilityEnabled = isHighAvailabilityEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (linkedAvailabilityGroupOverview() != null) { + linkedAvailabilityGroupOverview().validate(); + } + if (productSupportStatus() != null) { + productSupportStatus().validate(); + } + if (sqlVersion() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property sqlVersion in model SqlDbExtendedDetails")); + } + if (sqlEdition() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property sqlEdition in model SqlDbExtendedDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SqlDbExtendedDetails.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sqlVersion", this.sqlVersion); + jsonWriter.writeStringField("sqlEdition", this.sqlEdition); + jsonWriter.writeBooleanField("isClustered", this.isClustered); + jsonWriter.writeBooleanField("isHighAvailabilityEnabled", this.isHighAvailabilityEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlDbExtendedDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlDbExtendedDetails 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 SqlDbExtendedDetails. + */ + public static SqlDbExtendedDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlDbExtendedDetails deserializedSqlDbExtendedDetails = new SqlDbExtendedDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sqlVersion".equals(fieldName)) { + deserializedSqlDbExtendedDetails.sqlVersion = reader.getString(); + } else if ("sqlEdition".equals(fieldName)) { + deserializedSqlDbExtendedDetails.sqlEdition = reader.getString(); + } else if ("linkedAvailabilityGroupOverview".equals(fieldName)) { + deserializedSqlDbExtendedDetails.linkedAvailabilityGroupOverview + = SqlAvailabilityGroupDataOverview.fromJson(reader); + } else if ("productSupportStatus".equals(fieldName)) { + deserializedSqlDbExtendedDetails.productSupportStatus = ProductSupportStatus.fromJson(reader); + } else if ("bufferCacheSizeInMB".equals(fieldName)) { + deserializedSqlDbExtendedDetails.bufferCacheSizeInMB = reader.getNullable(JsonReader::getFloat); + } else if ("isDatabaseHighlyAvailable".equals(fieldName)) { + deserializedSqlDbExtendedDetails.isDatabaseHighlyAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("databaseSizeInMB".equals(fieldName)) { + deserializedSqlDbExtendedDetails.databaseSizeInMB = reader.getNullable(JsonReader::getFloat); + } else if ("compatibilityLevel".equals(fieldName)) { + deserializedSqlDbExtendedDetails.compatibilityLevel + = CompatibilityLevel.fromString(reader.getString()); + } else if ("percentageCoresUtilization".equals(fieldName)) { + deserializedSqlDbExtendedDetails.percentageCoresUtilization + = reader.getNullable(JsonReader::getFloat); + } else if ("megabytesPerSecondOfRead".equals(fieldName)) { + deserializedSqlDbExtendedDetails.megabytesPerSecondOfRead + = reader.getNullable(JsonReader::getFloat); + } else if ("megabytesPerSecondOfWrite".equals(fieldName)) { + deserializedSqlDbExtendedDetails.megabytesPerSecondOfWrite + = reader.getNullable(JsonReader::getFloat); + } else if ("numberOfReadOperationsPerSecond".equals(fieldName)) { + deserializedSqlDbExtendedDetails.numberOfReadOperationsPerSecond + = reader.getNullable(JsonReader::getFloat); + } else if ("numberOfWriteOperationsPerSecond".equals(fieldName)) { + deserializedSqlDbExtendedDetails.numberOfWriteOperationsPerSecond + = reader.getNullable(JsonReader::getFloat); + } else if ("isClustered".equals(fieldName)) { + deserializedSqlDbExtendedDetails.isClustered = reader.getNullable(JsonReader::getBoolean); + } else if ("isHighAvailabilityEnabled".equals(fieldName)) { + deserializedSqlDbExtendedDetails.isHighAvailabilityEnabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlDbExtendedDetails; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlDbSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlDbSettings.java deleted file mode 100644 index 880cfb045ba4..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlDbSettings.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * SQL database assessment settings. - */ -@Fluent -public final class SqlDbSettings implements JsonSerializable { - /* - * Gets or sets the azure SQL service tier. - */ - private AzureSqlServiceTier azureSqlServiceTier; - - /* - * Gets or sets the azure PAAS SQL instance type. - */ - private AzureSqlDataBaseType azureSqlDataBaseType; - - /* - * Gets or sets the azure SQL compute tier. - */ - private ComputeTier azureSqlComputeTier; - - /* - * Gets or sets the azure SQL purchase model. - */ - private AzureSqlPurchaseModel azureSqlPurchaseModel; - - /** - * Creates an instance of SqlDbSettings class. - */ - public SqlDbSettings() { - } - - /** - * Get the azureSqlServiceTier property: Gets or sets the azure SQL service tier. - * - * @return the azureSqlServiceTier value. - */ - public AzureSqlServiceTier azureSqlServiceTier() { - return this.azureSqlServiceTier; - } - - /** - * Set the azureSqlServiceTier property: Gets or sets the azure SQL service tier. - * - * @param azureSqlServiceTier the azureSqlServiceTier value to set. - * @return the SqlDbSettings object itself. - */ - public SqlDbSettings withAzureSqlServiceTier(AzureSqlServiceTier azureSqlServiceTier) { - this.azureSqlServiceTier = azureSqlServiceTier; - return this; - } - - /** - * Get the azureSqlDataBaseType property: Gets or sets the azure PAAS SQL instance type. - * - * @return the azureSqlDataBaseType value. - */ - public AzureSqlDataBaseType azureSqlDataBaseType() { - return this.azureSqlDataBaseType; - } - - /** - * Set the azureSqlDataBaseType property: Gets or sets the azure PAAS SQL instance type. - * - * @param azureSqlDataBaseType the azureSqlDataBaseType value to set. - * @return the SqlDbSettings object itself. - */ - public SqlDbSettings withAzureSqlDataBaseType(AzureSqlDataBaseType azureSqlDataBaseType) { - this.azureSqlDataBaseType = azureSqlDataBaseType; - return this; - } - - /** - * Get the azureSqlComputeTier property: Gets or sets the azure SQL compute tier. - * - * @return the azureSqlComputeTier value. - */ - public ComputeTier azureSqlComputeTier() { - return this.azureSqlComputeTier; - } - - /** - * Set the azureSqlComputeTier property: Gets or sets the azure SQL compute tier. - * - * @param azureSqlComputeTier the azureSqlComputeTier value to set. - * @return the SqlDbSettings object itself. - */ - public SqlDbSettings withAzureSqlComputeTier(ComputeTier azureSqlComputeTier) { - this.azureSqlComputeTier = azureSqlComputeTier; - return this; - } - - /** - * Get the azureSqlPurchaseModel property: Gets or sets the azure SQL purchase model. - * - * @return the azureSqlPurchaseModel value. - */ - public AzureSqlPurchaseModel azureSqlPurchaseModel() { - return this.azureSqlPurchaseModel; - } - - /** - * Set the azureSqlPurchaseModel property: Gets or sets the azure SQL purchase model. - * - * @param azureSqlPurchaseModel the azureSqlPurchaseModel value to set. - * @return the SqlDbSettings object itself. - */ - public SqlDbSettings withAzureSqlPurchaseModel(AzureSqlPurchaseModel azureSqlPurchaseModel) { - this.azureSqlPurchaseModel = azureSqlPurchaseModel; - 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("azureSqlServiceTier", - this.azureSqlServiceTier == null ? null : this.azureSqlServiceTier.toString()); - jsonWriter.writeStringField("azureSqlDataBaseType", - this.azureSqlDataBaseType == null ? null : this.azureSqlDataBaseType.toString()); - jsonWriter.writeStringField("azureSqlComputeTier", - this.azureSqlComputeTier == null ? null : this.azureSqlComputeTier.toString()); - jsonWriter.writeStringField("azureSqlPurchaseModel", - this.azureSqlPurchaseModel == null ? null : this.azureSqlPurchaseModel.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SqlDbSettings from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlDbSettings 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 SqlDbSettings. - */ - public static SqlDbSettings fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlDbSettings deserializedSqlDbSettings = new SqlDbSettings(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("azureSqlServiceTier".equals(fieldName)) { - deserializedSqlDbSettings.azureSqlServiceTier = AzureSqlServiceTier.fromString(reader.getString()); - } else if ("azureSqlDataBaseType".equals(fieldName)) { - deserializedSqlDbSettings.azureSqlDataBaseType - = AzureSqlDataBaseType.fromString(reader.getString()); - } else if ("azureSqlComputeTier".equals(fieldName)) { - deserializedSqlDbSettings.azureSqlComputeTier = ComputeTier.fromString(reader.getString()); - } else if ("azureSqlPurchaseModel".equals(fieldName)) { - deserializedSqlDbSettings.azureSqlPurchaseModel - = AzureSqlPurchaseModel.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlDbSettings; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlDbSettingsV3.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlDbSettingsV3.java new file mode 100644 index 000000000000..b36eeb6ef8c4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlDbSettingsV3.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * SQL database assessment settings V3. + */ +@Fluent +public final class SqlDbSettingsV3 implements JsonSerializable { + /* + * Gets or sets the azure SQL service tier. + */ + private AzureSqlServiceTierV3 azureSqlServiceTier; + + /* + * Gets or sets the azure PAAS SQL instance type. + */ + private AzureSqlDataBaseType azureSqlDataBaseType; + + /* + * Gets or sets the azure SQL compute tier. + */ + private ComputeTier azureSqlComputeTier; + + /* + * Gets or sets the azure SQL purchase model. + */ + private AzureSqlPurchaseModel azureSqlPurchaseModel; + + /** + * Creates an instance of SqlDbSettingsV3 class. + */ + public SqlDbSettingsV3() { + } + + /** + * Get the azureSqlServiceTier property: Gets or sets the azure SQL service tier. + * + * @return the azureSqlServiceTier value. + */ + public AzureSqlServiceTierV3 azureSqlServiceTier() { + return this.azureSqlServiceTier; + } + + /** + * Set the azureSqlServiceTier property: Gets or sets the azure SQL service tier. + * + * @param azureSqlServiceTier the azureSqlServiceTier value to set. + * @return the SqlDbSettingsV3 object itself. + */ + public SqlDbSettingsV3 withAzureSqlServiceTier(AzureSqlServiceTierV3 azureSqlServiceTier) { + this.azureSqlServiceTier = azureSqlServiceTier; + return this; + } + + /** + * Get the azureSqlDataBaseType property: Gets or sets the azure PAAS SQL instance type. + * + * @return the azureSqlDataBaseType value. + */ + public AzureSqlDataBaseType azureSqlDataBaseType() { + return this.azureSqlDataBaseType; + } + + /** + * Set the azureSqlDataBaseType property: Gets or sets the azure PAAS SQL instance type. + * + * @param azureSqlDataBaseType the azureSqlDataBaseType value to set. + * @return the SqlDbSettingsV3 object itself. + */ + public SqlDbSettingsV3 withAzureSqlDataBaseType(AzureSqlDataBaseType azureSqlDataBaseType) { + this.azureSqlDataBaseType = azureSqlDataBaseType; + return this; + } + + /** + * Get the azureSqlComputeTier property: Gets or sets the azure SQL compute tier. + * + * @return the azureSqlComputeTier value. + */ + public ComputeTier azureSqlComputeTier() { + return this.azureSqlComputeTier; + } + + /** + * Set the azureSqlComputeTier property: Gets or sets the azure SQL compute tier. + * + * @param azureSqlComputeTier the azureSqlComputeTier value to set. + * @return the SqlDbSettingsV3 object itself. + */ + public SqlDbSettingsV3 withAzureSqlComputeTier(ComputeTier azureSqlComputeTier) { + this.azureSqlComputeTier = azureSqlComputeTier; + return this; + } + + /** + * Get the azureSqlPurchaseModel property: Gets or sets the azure SQL purchase model. + * + * @return the azureSqlPurchaseModel value. + */ + public AzureSqlPurchaseModel azureSqlPurchaseModel() { + return this.azureSqlPurchaseModel; + } + + /** + * Set the azureSqlPurchaseModel property: Gets or sets the azure SQL purchase model. + * + * @param azureSqlPurchaseModel the azureSqlPurchaseModel value to set. + * @return the SqlDbSettingsV3 object itself. + */ + public SqlDbSettingsV3 withAzureSqlPurchaseModel(AzureSqlPurchaseModel azureSqlPurchaseModel) { + this.azureSqlPurchaseModel = azureSqlPurchaseModel; + 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("azureSqlServiceTier", + this.azureSqlServiceTier == null ? null : this.azureSqlServiceTier.toString()); + jsonWriter.writeStringField("azureSqlDataBaseType", + this.azureSqlDataBaseType == null ? null : this.azureSqlDataBaseType.toString()); + jsonWriter.writeStringField("azureSqlComputeTier", + this.azureSqlComputeTier == null ? null : this.azureSqlComputeTier.toString()); + jsonWriter.writeStringField("azureSqlPurchaseModel", + this.azureSqlPurchaseModel == null ? null : this.azureSqlPurchaseModel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlDbSettingsV3 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlDbSettingsV3 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 SqlDbSettingsV3. + */ + public static SqlDbSettingsV3 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlDbSettingsV3 deserializedSqlDbSettingsV3 = new SqlDbSettingsV3(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureSqlServiceTier".equals(fieldName)) { + deserializedSqlDbSettingsV3.azureSqlServiceTier + = AzureSqlServiceTierV3.fromString(reader.getString()); + } else if ("azureSqlDataBaseType".equals(fieldName)) { + deserializedSqlDbSettingsV3.azureSqlDataBaseType + = AzureSqlDataBaseType.fromString(reader.getString()); + } else if ("azureSqlComputeTier".equals(fieldName)) { + deserializedSqlDbSettingsV3.azureSqlComputeTier = ComputeTier.fromString(reader.getString()); + } else if ("azureSqlPurchaseModel".equals(fieldName)) { + deserializedSqlDbSettingsV3.azureSqlPurchaseModel + = AzureSqlPurchaseModel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlDbSettingsV3; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlEntityRecommendations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlEntityRecommendations.java new file mode 100644 index 000000000000..071f18605eb1 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlEntityRecommendations.java @@ -0,0 +1,380 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Recommendations for assessed sql entities. + */ +@Fluent +public final class SqlEntityRecommendations implements JsonSerializable { + /* + * The configuration data. + */ + private Configuration configuration; + + /* + * The recommended details. + */ + private RecommendedFor recommendedFor; + + /* + * The migration Platform. + */ + private MigrationPlatform migrationPlatform; + + /* + * The confidence score. + */ + private Float 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; + + /* + * Gets a value indicating whether replicas should be provisioned. + */ + private Boolean shouldProvisionReplicas; + + /* + * Gets the replication mode. + */ + private SkuReplicationMode skuReplicationMode; + + /* + * Gets the list of migration guidelines applicable to this target. + */ + private List migrationGuidelines; + + /* + * The product support status. + */ + private List recommendationReasonings; + + /* + * Gets the migration target platform. + */ + private TargetType migrationTargetPlatform; + + /* + * Gets or sets the machine assessment ARM ID for VM fallback. + */ + private String fallbackMachineAssessmentArmId; + + /** + * Creates an instance of SqlEntityRecommendations class. + */ + public SqlEntityRecommendations() { + } + + /** + * 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 Float 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 shouldProvisionReplicas property: Gets a value indicating whether replicas should be provisioned. + * + * @return the shouldProvisionReplicas value. + */ + public Boolean shouldProvisionReplicas() { + return this.shouldProvisionReplicas; + } + + /** + * Get the skuReplicationMode property: Gets the replication mode. + * + * @return the skuReplicationMode value. + */ + public SkuReplicationMode skuReplicationMode() { + return this.skuReplicationMode; + } + + /** + * Get the migrationGuidelines property: Gets the list of migration guidelines applicable to this target. + * + * @return the migrationGuidelines value. + */ + public List migrationGuidelines() { + return this.migrationGuidelines; + } + + /** + * Get the recommendationReasonings property: The product support status. + * + * @return the recommendationReasonings value. + */ + public List recommendationReasonings() { + return this.recommendationReasonings; + } + + /** + * Get the migrationTargetPlatform property: Gets the migration target platform. + * + * @return the migrationTargetPlatform value. + */ + public TargetType migrationTargetPlatform() { + return this.migrationTargetPlatform; + } + + /** + * Get the fallbackMachineAssessmentArmId property: Gets or sets the machine assessment ARM ID for VM fallback. + * + * @return the fallbackMachineAssessmentArmId value. + */ + public String fallbackMachineAssessmentArmId() { + return this.fallbackMachineAssessmentArmId; + } + + /** + * Set the fallbackMachineAssessmentArmId property: Gets or sets the machine assessment ARM ID for VM fallback. + * + * @param fallbackMachineAssessmentArmId the fallbackMachineAssessmentArmId value to set. + * @return the SqlEntityRecommendations object itself. + */ + public SqlEntityRecommendations withFallbackMachineAssessmentArmId(String fallbackMachineAssessmentArmId) { + this.fallbackMachineAssessmentArmId = fallbackMachineAssessmentArmId; + return this; + } + + /** + * 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 (migrationGuidelines() != null) { + migrationGuidelines().forEach(e -> e.validate()); + } + if (recommendationReasonings() != null) { + recommendationReasonings().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fallbackMachineAssessmentArmId", this.fallbackMachineAssessmentArmId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlEntityRecommendations from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlEntityRecommendations 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 SqlEntityRecommendations. + */ + public static SqlEntityRecommendations fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlEntityRecommendations deserializedSqlEntityRecommendations = new SqlEntityRecommendations(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configuration".equals(fieldName)) { + deserializedSqlEntityRecommendations.configuration = Configuration.fromJson(reader); + } else if ("recommendedFor".equals(fieldName)) { + deserializedSqlEntityRecommendations.recommendedFor = RecommendedFor.fromJson(reader); + } else if ("migrationPlatform".equals(fieldName)) { + deserializedSqlEntityRecommendations.migrationPlatform + = MigrationPlatform.fromString(reader.getString()); + } else if ("confidenceScore".equals(fieldName)) { + deserializedSqlEntityRecommendations.confidenceScore = reader.getNullable(JsonReader::getFloat); + } else if ("migrationSuitability".equals(fieldName)) { + deserializedSqlEntityRecommendations.migrationSuitability = MigrationSuitability.fromJson(reader); + } else if ("securitySuitability".equals(fieldName)) { + deserializedSqlEntityRecommendations.securitySuitability = SecuritySuitability.fromJson(reader); + } else if ("totalCost".equals(fieldName)) { + List totalCost + = reader.readArray(reader1 -> CostDetailsCommon.fromJson(reader1)); + deserializedSqlEntityRecommendations.totalCost = totalCost; + } else if ("totalSavings".equals(fieldName)) { + List totalSavings + = reader.readArray(reader1 -> SavingsDetailsCommon.fromJson(reader1)); + deserializedSqlEntityRecommendations.totalSavings = totalSavings; + } else if ("migrationIssues".equals(fieldName)) { + List migrationIssues + = reader.readArray(reader1 -> SqlAssessmentMigrationIssue.fromJson(reader1)); + deserializedSqlEntityRecommendations.migrationIssues = migrationIssues; + } else if ("skus".equals(fieldName)) { + List skus + = reader.readArray(reader1 -> SqlEntityRecommendationsSkusItem.fromJson(reader1)); + deserializedSqlEntityRecommendations.skus = skus; + } else if ("shouldProvisionReplicas".equals(fieldName)) { + deserializedSqlEntityRecommendations.shouldProvisionReplicas + = reader.getNullable(JsonReader::getBoolean); + } else if ("skuReplicationMode".equals(fieldName)) { + deserializedSqlEntityRecommendations.skuReplicationMode + = SkuReplicationMode.fromString(reader.getString()); + } else if ("migrationGuidelines".equals(fieldName)) { + List migrationGuidelines + = reader.readArray(reader1 -> SqlMigrationGuideline.fromJson(reader1)); + deserializedSqlEntityRecommendations.migrationGuidelines = migrationGuidelines; + } else if ("recommendationReasonings".equals(fieldName)) { + List recommendationReasonings + = reader.readArray(reader1 -> SqlRecommendationReasoning.fromJson(reader1)); + deserializedSqlEntityRecommendations.recommendationReasonings = recommendationReasonings; + } else if ("migrationTargetPlatform".equals(fieldName)) { + deserializedSqlEntityRecommendations.migrationTargetPlatform + = TargetType.fromString(reader.getString()); + } else if ("fallbackMachineAssessmentArmId".equals(fieldName)) { + deserializedSqlEntityRecommendations.fallbackMachineAssessmentArmId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlEntityRecommendations; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlEntityRecommendationsSkusItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlEntityRecommendationsSkusItem.java new file mode 100644 index 000000000000..503e8465a6d6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlEntityRecommendationsSkusItem.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SqlEntityRecommendationsSkusItem 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 SqlEntityRecommendationsSkusItem class. + */ + public SqlEntityRecommendationsSkusItem() { + } + + /** + * 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 SqlEntityRecommendationsSkusItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlEntityRecommendationsSkusItem 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 SqlEntityRecommendationsSkusItem. + */ + public static SqlEntityRecommendationsSkusItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlEntityRecommendationsSkusItem deserializedSqlEntityRecommendationsSkusItem + = new SqlEntityRecommendationsSkusItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedSqlEntityRecommendationsSkusItem.kind = SkuKind.fromString(reader.getString()); + } else if ("resourceUri".equals(fieldName)) { + deserializedSqlEntityRecommendationsSkusItem.resourceUri = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedSqlEntityRecommendationsSkusItem.displayName = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedSqlEntityRecommendationsSkusItem.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSqlEntityRecommendationsSkusItem.type = SkuType.fromString(reader.getString()); + } else if ("sources".equals(fieldName)) { + List sources = reader + .readArray(reader1 -> SqlEntityRecommendationsSkusPropertiesItemsItem.fromJson(reader1)); + deserializedSqlEntityRecommendationsSkusItem.sources = sources; + } else if ("details".equals(fieldName)) { + deserializedSqlEntityRecommendationsSkusItem.details = SkuDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlEntityRecommendationsSkusItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlEntityRecommendationsSkusPropertiesItemsItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlEntityRecommendationsSkusPropertiesItemsItem.java new file mode 100644 index 000000000000..2d8809c62e2e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlEntityRecommendationsSkusPropertiesItemsItem.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SqlEntityRecommendationsSkusPropertiesItemsItem + implements JsonSerializable { + /* + * The sku name. + */ + private String name; + + /* + * The sku type. + */ + private MigrationSuitability migrationSuitability; + + /** + * Creates an instance of SqlEntityRecommendationsSkusPropertiesItemsItem class. + */ + public SqlEntityRecommendationsSkusPropertiesItemsItem() { + } + + /** + * 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 SqlEntityRecommendationsSkusPropertiesItemsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlEntityRecommendationsSkusPropertiesItemsItem 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 SqlEntityRecommendationsSkusPropertiesItemsItem. + */ + public static SqlEntityRecommendationsSkusPropertiesItemsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlEntityRecommendationsSkusPropertiesItemsItem deserializedSqlEntityRecommendationsSkusPropertiesItemsItem + = new SqlEntityRecommendationsSkusPropertiesItemsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSqlEntityRecommendationsSkusPropertiesItemsItem.name = reader.getString(); + } else if ("migrationSuitability".equals(fieldName)) { + deserializedSqlEntityRecommendationsSkusPropertiesItemsItem.migrationSuitability + = MigrationSuitability.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlEntityRecommendationsSkusPropertiesItemsItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlFciMetadataState.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlFciMetadataState.java index df85ce59a963..c665d485f693 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlFciMetadataState.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlFciMetadataState.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for SqlFciMetadataState. + * Sql FCI Metadata State. */ public final class SqlFciMetadataState extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlFciState.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlFciState.java deleted file mode 100644 index 15b0bb59825a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlFciState.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for SqlFciState. - */ -public final class SqlFciState extends ExpandableStringEnum { - /** - * Static value Unknown for SqlFciState. - */ - public static final SqlFciState UNKNOWN = fromString("Unknown"); - - /** - * Static value Active for SqlFciState. - */ - public static final SqlFciState ACTIVE = fromString("Active"); - - /** - * Static value Passive for SqlFciState. - */ - public static final SqlFciState PASSIVE = fromString("Passive"); - - /** - * Static value NotApplicable for SqlFciState. - */ - public static final SqlFciState NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Creates a new instance of SqlFciState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SqlFciState() { - } - - /** - * Creates or finds a SqlFciState from its string representation. - * - * @param name a name to look for. - * @return the corresponding SqlFciState. - */ - public static SqlFciState fromString(String name) { - return fromString(name, SqlFciState.class); - } - - /** - * Gets known SqlFciState values. - * - * @return known SqlFciState values. - */ - public static Collection values() { - return values(SqlFciState.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlGraphAssessmentOptions.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlGraphAssessmentOptions.java new file mode 100644 index 000000000000..eacc7e647921 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlGraphAssessmentOptions.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.SqlGraphAssessmentOptionsInner; + +/** + * An immutable client-side representation of SqlGraphAssessmentOptions. + */ +public interface SqlGraphAssessmentOptions { + /** + * 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. + */ + SqlGraphAssessmentOptionsProperties 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.migration.assessment.fluent.models.SqlGraphAssessmentOptionsInner + * object. + * + * @return the inner object. + */ + SqlGraphAssessmentOptionsInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlGraphAssessmentOptionsListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlGraphAssessmentOptionsListResult.java new file mode 100644 index 000000000000..073ccc477e59 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlGraphAssessmentOptionsListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.SqlGraphAssessmentOptionsInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SqlGraphAssessmentOptions list operation. + */ +@Fluent +public final class SqlGraphAssessmentOptionsListResult + implements JsonSerializable { + /* + * The SqlGraphAssessmentOptions items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SqlGraphAssessmentOptionsListResult class. + */ + public SqlGraphAssessmentOptionsListResult() { + } + + /** + * Get the value property: The SqlGraphAssessmentOptions items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SqlGraphAssessmentOptions items on this page. + * + * @param value the value value to set. + * @return the SqlGraphAssessmentOptionsListResult object itself. + */ + public SqlGraphAssessmentOptionsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SqlGraphAssessmentOptionsListResult object itself. + */ + public SqlGraphAssessmentOptionsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 SqlGraphAssessmentOptionsListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SqlGraphAssessmentOptionsListResult.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 SqlGraphAssessmentOptionsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlGraphAssessmentOptionsListResult 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 SqlGraphAssessmentOptionsListResult. + */ + public static SqlGraphAssessmentOptionsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlGraphAssessmentOptionsListResult deserializedSqlGraphAssessmentOptionsListResult + = new SqlGraphAssessmentOptionsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SqlGraphAssessmentOptionsInner.fromJson(reader1)); + deserializedSqlGraphAssessmentOptionsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSqlGraphAssessmentOptionsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlGraphAssessmentOptionsListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlGraphAssessmentOptionsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlGraphAssessmentOptionsOperations.java new file mode 100644 index 000000000000..4c7394815472 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlGraphAssessmentOptionsOperations.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SqlGraphAssessmentOptionsOperations. + */ +public interface SqlGraphAssessmentOptionsOperations { + /** + * List SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List SqlGraphAssessmentOptions 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 SqlGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + Context context); + + /** + * Get a SqlGraphAssessmentOptions. + * + * @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 SqlGraphAssessmentOptions along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, Context context); + + /** + * Get a SqlGraphAssessmentOptions. + * + * @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 SqlGraphAssessmentOptions. + */ + SqlGraphAssessmentOptions get(String resourceGroupName, String projectName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlGraphAssessmentOptionsProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlGraphAssessmentOptionsProperties.java new file mode 100644 index 000000000000..52f0a6738b8b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlGraphAssessmentOptionsProperties.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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. + */ +@Fluent +public final class SqlGraphAssessmentOptionsProperties + implements JsonSerializable { + /* + * Gets or sets the edges. + */ + private Map edges; + + /** + * Creates an instance of SqlGraphAssessmentOptionsProperties class. + */ + public SqlGraphAssessmentOptionsProperties() { + } + + /** + * Get the edges property: Gets or sets the edges. + * + * @return the edges value. + */ + public Map edges() { + return this.edges; + } + + /** + * Set the edges property: Gets or sets the edges. + * + * @param edges the edges value to set. + * @return the SqlGraphAssessmentOptionsProperties object itself. + */ + public SqlGraphAssessmentOptionsProperties withEdges(Map edges) { + this.edges = edges; + return this; + } + + /** + * 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 SqlGraphAssessmentOptionsProperties")); + } else { + edges().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SqlGraphAssessmentOptionsProperties.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 SqlGraphAssessmentOptionsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlGraphAssessmentOptionsProperties 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 SqlGraphAssessmentOptionsProperties. + */ + public static SqlGraphAssessmentOptionsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlGraphAssessmentOptionsProperties deserializedSqlGraphAssessmentOptionsProperties + = new SqlGraphAssessmentOptionsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("edges".equals(fieldName)) { + Map edges + = reader.readMap(reader1 -> SqlAssessmentOptionsOutboundEdgeGroup.fromJson(reader1)); + deserializedSqlGraphAssessmentOptionsProperties.edges = edges; + } else { + reader.skipChildren(); + } + } + + return deserializedSqlGraphAssessmentOptionsProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlInstanceExtendedDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlInstanceExtendedDetails.java new file mode 100644 index 000000000000..f2db305d46fe --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlInstanceExtendedDetails.java @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 sql instance extended details. + */ +@Immutable +public final class SqlInstanceExtendedDetails implements JsonSerializable { + /* + * Gets or sets the memory used by SQL instance in megabytes. + */ + private Float memoryInUseInMB; + + /* + * Gets or sets a value indicating whether SQL instance has been deep discovered. + */ + private Boolean hasScanOccurred; + + /* + * Gets the storage details. + */ + private List storageTypeBasedDetails; + + /* + * Gets the product support status related details. + */ + private ProductSupportStatus productSupportStatus; + + /* + * Gets the FCI metadata if this instance represents an FCI instance. + */ + private SqlFciMetadata fciMetadata; + + /* + * Gets the overview counts of availability replicas in the assessed instance, by + * commit mode and read type. + */ + private SqlAvailabilityReplicaSummary availabilityReplicaSummary; + + /* + * Gets a value indicating whether the SQL instance is clustered or not. + */ + private Boolean isClustered; + + /* + * Gets a value indicating whether the high availability is enabled or not. + */ + private Boolean isHighAvailabilityEnabled; + + /* + * Gets the list of recommended target reasoning. + */ + private List recommendedTargetReasonings; + + /* + * SQL instance edition. + */ + private String sqlEdition; + + /* + * SQL instance version. + */ + private String sqlVersion; + + /* + * Number of CPU cores assigned to the SQL instance. + */ + private Integer numberOfCoresAllocated; + + /* + * The percentage of the total number of cores being utilized by the SQL instance. + */ + private Float percentageCoresUtilization; + + /* + * The logical disk details. + */ + private List logicalDisks; + + /* + * The databases summary. + */ + private AssessedSqlInstanceDatabaseSummary databaseSummary; + + /** + * Creates an instance of SqlInstanceExtendedDetails class. + */ + public SqlInstanceExtendedDetails() { + } + + /** + * Get the memoryInUseInMB property: Gets or sets the memory used by SQL instance in megabytes. + * + * @return the memoryInUseInMB value. + */ + public Float memoryInUseInMB() { + return this.memoryInUseInMB; + } + + /** + * Get the hasScanOccurred property: Gets or sets a value indicating whether SQL instance has been deep discovered. + * + * @return the hasScanOccurred value. + */ + public Boolean hasScanOccurred() { + return this.hasScanOccurred; + } + + /** + * Get the storageTypeBasedDetails property: Gets the storage details. + * + * @return the storageTypeBasedDetails value. + */ + public List storageTypeBasedDetails() { + return this.storageTypeBasedDetails; + } + + /** + * Get the productSupportStatus property: Gets the product support status related details. + * + * @return the productSupportStatus value. + */ + public ProductSupportStatus productSupportStatus() { + return this.productSupportStatus; + } + + /** + * Get the fciMetadata property: Gets the FCI metadata if this instance represents an FCI instance. + * + * @return the fciMetadata value. + */ + public SqlFciMetadata fciMetadata() { + return this.fciMetadata; + } + + /** + * Get the availabilityReplicaSummary property: Gets the overview counts of availability replicas in the assessed + * instance, by + * commit mode and read type. + * + * @return the availabilityReplicaSummary value. + */ + public SqlAvailabilityReplicaSummary availabilityReplicaSummary() { + return this.availabilityReplicaSummary; + } + + /** + * Get the isClustered property: Gets a value indicating whether the SQL instance is clustered or not. + * + * @return the isClustered value. + */ + public Boolean isClustered() { + return this.isClustered; + } + + /** + * Get the isHighAvailabilityEnabled property: Gets a value indicating whether the high availability is enabled or + * not. + * + * @return the isHighAvailabilityEnabled value. + */ + public Boolean isHighAvailabilityEnabled() { + return this.isHighAvailabilityEnabled; + } + + /** + * Get the recommendedTargetReasonings property: Gets the list of recommended target reasoning. + * + * @return the recommendedTargetReasonings value. + */ + public List recommendedTargetReasonings() { + return this.recommendedTargetReasonings; + } + + /** + * Get the sqlEdition property: SQL instance edition. + * + * @return the sqlEdition value. + */ + public String sqlEdition() { + return this.sqlEdition; + } + + /** + * Get the sqlVersion property: SQL instance version. + * + * @return the sqlVersion value. + */ + public String sqlVersion() { + return this.sqlVersion; + } + + /** + * Get the numberOfCoresAllocated property: Number of CPU cores assigned to the SQL instance. + * + * @return the numberOfCoresAllocated value. + */ + public Integer numberOfCoresAllocated() { + return this.numberOfCoresAllocated; + } + + /** + * Get the percentageCoresUtilization property: The percentage of the total number of cores being utilized by the + * SQL instance. + * + * @return the percentageCoresUtilization value. + */ + public Float percentageCoresUtilization() { + return this.percentageCoresUtilization; + } + + /** + * Get the logicalDisks property: The logical disk details. + * + * @return the logicalDisks value. + */ + public List logicalDisks() { + return this.logicalDisks; + } + + /** + * Get the databaseSummary property: The databases summary. + * + * @return the databaseSummary value. + */ + public AssessedSqlInstanceDatabaseSummary databaseSummary() { + return this.databaseSummary; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageTypeBasedDetails() != null) { + storageTypeBasedDetails().forEach(e -> e.validate()); + } + if (productSupportStatus() != null) { + productSupportStatus().validate(); + } + if (fciMetadata() != null) { + fciMetadata().validate(); + } + if (availabilityReplicaSummary() != null) { + availabilityReplicaSummary().validate(); + } + if (recommendedTargetReasonings() != null) { + recommendedTargetReasonings().forEach(e -> e.validate()); + } + if (logicalDisks() != null) { + logicalDisks().forEach(e -> e.validate()); + } + if (databaseSummary() != null) { + databaseSummary().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlInstanceExtendedDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlInstanceExtendedDetails 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 SqlInstanceExtendedDetails. + */ + public static SqlInstanceExtendedDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlInstanceExtendedDetails deserializedSqlInstanceExtendedDetails = new SqlInstanceExtendedDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("memoryInUseInMB".equals(fieldName)) { + deserializedSqlInstanceExtendedDetails.memoryInUseInMB = reader.getNullable(JsonReader::getFloat); + } else if ("hasScanOccurred".equals(fieldName)) { + deserializedSqlInstanceExtendedDetails.hasScanOccurred = reader.getNullable(JsonReader::getBoolean); + } else if ("storageTypeBasedDetails".equals(fieldName)) { + List storageTypeBasedDetails + = reader.readArray(reader1 -> AssessedSqlInstanceStorageDetails.fromJson(reader1)); + deserializedSqlInstanceExtendedDetails.storageTypeBasedDetails = storageTypeBasedDetails; + } else if ("productSupportStatus".equals(fieldName)) { + deserializedSqlInstanceExtendedDetails.productSupportStatus = ProductSupportStatus.fromJson(reader); + } else if ("fciMetadata".equals(fieldName)) { + deserializedSqlInstanceExtendedDetails.fciMetadata = SqlFciMetadata.fromJson(reader); + } else if ("availabilityReplicaSummary".equals(fieldName)) { + deserializedSqlInstanceExtendedDetails.availabilityReplicaSummary + = SqlAvailabilityReplicaSummary.fromJson(reader); + } else if ("isClustered".equals(fieldName)) { + deserializedSqlInstanceExtendedDetails.isClustered = reader.getNullable(JsonReader::getBoolean); + } else if ("isHighAvailabilityEnabled".equals(fieldName)) { + deserializedSqlInstanceExtendedDetails.isHighAvailabilityEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("recommendedTargetReasonings".equals(fieldName)) { + List recommendedTargetReasonings + = reader.readArray(reader1 -> SqlRecommendationReasoning.fromJson(reader1)); + deserializedSqlInstanceExtendedDetails.recommendedTargetReasonings = recommendedTargetReasonings; + } else if ("sqlEdition".equals(fieldName)) { + deserializedSqlInstanceExtendedDetails.sqlEdition = reader.getString(); + } else if ("sqlVersion".equals(fieldName)) { + deserializedSqlInstanceExtendedDetails.sqlVersion = reader.getString(); + } else if ("numberOfCoresAllocated".equals(fieldName)) { + deserializedSqlInstanceExtendedDetails.numberOfCoresAllocated + = reader.getNullable(JsonReader::getInt); + } else if ("percentageCoresUtilization".equals(fieldName)) { + deserializedSqlInstanceExtendedDetails.percentageCoresUtilization + = reader.getNullable(JsonReader::getFloat); + } else if ("logicalDisks".equals(fieldName)) { + List logicalDisks + = reader.readArray(reader1 -> AssessedSqlInstanceDiskDetails.fromJson(reader1)); + deserializedSqlInstanceExtendedDetails.logicalDisks = logicalDisks; + } else if ("databaseSummary".equals(fieldName)) { + deserializedSqlInstanceExtendedDetails.databaseSummary + = AssessedSqlInstanceDatabaseSummary.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlInstanceExtendedDetails; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMachineExtendedDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMachineExtendedDetails.java new file mode 100644 index 000000000000..33503a179e00 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMachineExtendedDetails.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 sql machine extended details. + */ +@Immutable +public final class SqlMachineExtendedDetails implements JsonSerializable { + /* + * Display Name of the Machine. + */ + private String displayName; + + /* + * Gets or sets the BIOS GUID for the machine. + */ + private String biosGuid; + + /* + * Gets or sets the FQDN for the machine. + */ + private String fqdn; + + /* + * Gets the product support status related details. + */ + private ProductSupportStatus productSupportStatus; + + /* + * Gets the list of data disks that were assessed as part of this assessment. + */ + private List disks; + + /* + * Gets the list of network adapters that were assessed as part of this assessment. + */ + private List networkAdapters; + + /* + * 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 Float 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 Float percentageCoresUtilization; + + /* + * Percentile of Percentage of Memory Utilized noted during time period T. + * + * Here N and T are settings on Assessment. + */ + private Float percentageMemoryUtilization; + + /** + * Creates an instance of SqlMachineExtendedDetails class. + */ + public SqlMachineExtendedDetails() { + } + + /** + * Get the displayName property: Display Name of the Machine. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the biosGuid property: Gets or sets the BIOS GUID for the machine. + * + * @return the biosGuid value. + */ + public String biosGuid() { + return this.biosGuid; + } + + /** + * Get the fqdn property: Gets or sets the FQDN for the machine. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * 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: Gets the list of data disks that were assessed as part of this assessment. + * + * @return the disks value. + */ + public List disks() { + return this.disks; + } + + /** + * Get the networkAdapters property: Gets the list of network adapters that were assessed as part of this + * assessment. + * + * @return the networkAdapters value. + */ + public List networkAdapters() { + return this.networkAdapters; + } + + /** + * 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 Float 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 Float 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 Float percentageMemoryUtilization() { + return this.percentageMemoryUtilization; + } + + /** + * 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 (networkAdapters() != null) { + networkAdapters().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlMachineExtendedDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlMachineExtendedDetails 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 SqlMachineExtendedDetails. + */ + public static SqlMachineExtendedDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlMachineExtendedDetails deserializedSqlMachineExtendedDetails = new SqlMachineExtendedDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedSqlMachineExtendedDetails.displayName = reader.getString(); + } else if ("biosGuid".equals(fieldName)) { + deserializedSqlMachineExtendedDetails.biosGuid = reader.getString(); + } else if ("fqdn".equals(fieldName)) { + deserializedSqlMachineExtendedDetails.fqdn = reader.getString(); + } else if ("productSupportStatus".equals(fieldName)) { + deserializedSqlMachineExtendedDetails.productSupportStatus = ProductSupportStatus.fromJson(reader); + } else if ("disks".equals(fieldName)) { + List disks + = reader.readArray(reader1 -> AssessedSqlDiskDataV3.fromJson(reader1)); + deserializedSqlMachineExtendedDetails.disks = disks; + } else if ("networkAdapters".equals(fieldName)) { + List networkAdapters + = reader.readArray(reader1 -> AssessedSqlNetworkAdaptersV3.fromJson(reader1)); + deserializedSqlMachineExtendedDetails.networkAdapters = networkAdapters; + } else if ("bootType".equals(fieldName)) { + deserializedSqlMachineExtendedDetails.bootType = MachineBootType.fromString(reader.getString()); + } else if ("operatingSystemType".equals(fieldName)) { + deserializedSqlMachineExtendedDetails.operatingSystemType = reader.getString(); + } else if ("operatingSystemName".equals(fieldName)) { + deserializedSqlMachineExtendedDetails.operatingSystemName = reader.getString(); + } else if ("operatingSystemVersion".equals(fieldName)) { + deserializedSqlMachineExtendedDetails.operatingSystemVersion = reader.getString(); + } else if ("operatingSystemArchitecture".equals(fieldName)) { + deserializedSqlMachineExtendedDetails.operatingSystemArchitecture + = GuestOperatingSystemArchitecture.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedSqlMachineExtendedDetails.description = reader.getString(); + } else if ("megabytesOfMemory".equals(fieldName)) { + deserializedSqlMachineExtendedDetails.megabytesOfMemory = reader.getNullable(JsonReader::getFloat); + } else if ("numberOfCores".equals(fieldName)) { + deserializedSqlMachineExtendedDetails.numberOfCores = reader.getNullable(JsonReader::getInt); + } else if ("percentageCoresUtilization".equals(fieldName)) { + deserializedSqlMachineExtendedDetails.percentageCoresUtilization + = reader.getNullable(JsonReader::getFloat); + } else if ("percentageMemoryUtilization".equals(fieldName)) { + deserializedSqlMachineExtendedDetails.percentageMemoryUtilization + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlMachineExtendedDetails; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMachineRecommendations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMachineRecommendations.java new file mode 100644 index 000000000000..952eea81ed34 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMachineRecommendations.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Recommendations for assessed sql entities. + */ +@Immutable +public final class SqlMachineRecommendations implements JsonSerializable { + /* + * The configuration data. + */ + private Configuration configuration; + + /* + * The recommended details. + */ + private RecommendedFor recommendedFor; + + /* + * The migration Platform. + */ + private MigrationPlatform migrationPlatform; + + /* + * The confidence score. + */ + private Float 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; + + /* + * Gets the list of migration guidelines applicable to this target. + */ + private List migrationGuidelines; + + /** + * Creates an instance of SqlMachineRecommendations class. + */ + public SqlMachineRecommendations() { + } + + /** + * 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 Float 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 migrationGuidelines property: Gets the list of migration guidelines applicable to this target. + * + * @return the migrationGuidelines value. + */ + public List migrationGuidelines() { + return this.migrationGuidelines; + } + + /** + * 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 (migrationGuidelines() != null) { + migrationGuidelines().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlMachineRecommendations from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlMachineRecommendations 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 SqlMachineRecommendations. + */ + public static SqlMachineRecommendations fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlMachineRecommendations deserializedSqlMachineRecommendations = new SqlMachineRecommendations(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configuration".equals(fieldName)) { + deserializedSqlMachineRecommendations.configuration = Configuration.fromJson(reader); + } else if ("recommendedFor".equals(fieldName)) { + deserializedSqlMachineRecommendations.recommendedFor = RecommendedFor.fromJson(reader); + } else if ("migrationPlatform".equals(fieldName)) { + deserializedSqlMachineRecommendations.migrationPlatform + = MigrationPlatform.fromString(reader.getString()); + } else if ("confidenceScore".equals(fieldName)) { + deserializedSqlMachineRecommendations.confidenceScore = reader.getNullable(JsonReader::getFloat); + } else if ("migrationSuitability".equals(fieldName)) { + deserializedSqlMachineRecommendations.migrationSuitability = MigrationSuitability.fromJson(reader); + } else if ("securitySuitability".equals(fieldName)) { + deserializedSqlMachineRecommendations.securitySuitability = SecuritySuitability.fromJson(reader); + } else if ("totalCost".equals(fieldName)) { + List totalCost + = reader.readArray(reader1 -> CostDetailsCommon.fromJson(reader1)); + deserializedSqlMachineRecommendations.totalCost = totalCost; + } else if ("totalSavings".equals(fieldName)) { + List totalSavings + = reader.readArray(reader1 -> SavingsDetailsCommon.fromJson(reader1)); + deserializedSqlMachineRecommendations.totalSavings = totalSavings; + } else if ("migrationIssues".equals(fieldName)) { + List migrationIssues + = reader.readArray(reader1 -> MigrationIssues.fromJson(reader1)); + deserializedSqlMachineRecommendations.migrationIssues = migrationIssues; + } else if ("skus".equals(fieldName)) { + List skus + = reader.readArray(reader1 -> SqlMachineRecommendationsSkusItem.fromJson(reader1)); + deserializedSqlMachineRecommendations.skus = skus; + } else if ("migrationGuidelines".equals(fieldName)) { + List migrationGuidelines + = reader.readArray(reader1 -> SqlMigrationGuideline.fromJson(reader1)); + deserializedSqlMachineRecommendations.migrationGuidelines = migrationGuidelines; + } else { + reader.skipChildren(); + } + } + + return deserializedSqlMachineRecommendations; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMachineRecommendationsSkusItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMachineRecommendationsSkusItem.java new file mode 100644 index 000000000000..64c477fc516f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMachineRecommendationsSkusItem.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SqlMachineRecommendationsSkusItem 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 SqlMachineRecommendationsSkusItem class. + */ + public SqlMachineRecommendationsSkusItem() { + } + + /** + * 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 SqlMachineRecommendationsSkusItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlMachineRecommendationsSkusItem 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 SqlMachineRecommendationsSkusItem. + */ + public static SqlMachineRecommendationsSkusItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlMachineRecommendationsSkusItem deserializedSqlMachineRecommendationsSkusItem + = new SqlMachineRecommendationsSkusItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedSqlMachineRecommendationsSkusItem.kind = SkuKind.fromString(reader.getString()); + } else if ("resourceUri".equals(fieldName)) { + deserializedSqlMachineRecommendationsSkusItem.resourceUri = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedSqlMachineRecommendationsSkusItem.displayName = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedSqlMachineRecommendationsSkusItem.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSqlMachineRecommendationsSkusItem.type = SkuType.fromString(reader.getString()); + } else if ("sources".equals(fieldName)) { + List sources = reader + .readArray(reader1 -> SqlMachineRecommendationsSkusPropertiesItemsItem.fromJson(reader1)); + deserializedSqlMachineRecommendationsSkusItem.sources = sources; + } else if ("details".equals(fieldName)) { + deserializedSqlMachineRecommendationsSkusItem.details = SkuDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlMachineRecommendationsSkusItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMachineRecommendationsSkusPropertiesItemsItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMachineRecommendationsSkusPropertiesItemsItem.java new file mode 100644 index 000000000000..e0da1ab11514 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMachineRecommendationsSkusPropertiesItemsItem.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SqlMachineRecommendationsSkusPropertiesItemsItem + implements JsonSerializable { + /* + * The sku name. + */ + private String name; + + /* + * The sku type. + */ + private MigrationSuitability migrationSuitability; + + /** + * Creates an instance of SqlMachineRecommendationsSkusPropertiesItemsItem class. + */ + public SqlMachineRecommendationsSkusPropertiesItemsItem() { + } + + /** + * 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 SqlMachineRecommendationsSkusPropertiesItemsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlMachineRecommendationsSkusPropertiesItemsItem 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 SqlMachineRecommendationsSkusPropertiesItemsItem. + */ + public static SqlMachineRecommendationsSkusPropertiesItemsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlMachineRecommendationsSkusPropertiesItemsItem deserializedSqlMachineRecommendationsSkusPropertiesItemsItem + = new SqlMachineRecommendationsSkusPropertiesItemsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSqlMachineRecommendationsSkusPropertiesItemsItem.name = reader.getString(); + } else if ("migrationSuitability".equals(fieldName)) { + deserializedSqlMachineRecommendationsSkusPropertiesItemsItem.migrationSuitability + = MigrationSuitability.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlMachineRecommendationsSkusPropertiesItemsItem; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMiSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMiSettings.java deleted file mode 100644 index 6f47f1e4464a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMiSettings.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * SQL managed instance assessment settings. - */ -@Fluent -public final class SqlMiSettings implements JsonSerializable { - /* - * Gets or sets the azure SQL service tier. - */ - private AzureSqlServiceTier azureSqlServiceTier; - - /* - * Gets or sets the azure PAAS SQL instance type. - */ - private AzureSqlInstanceType azureSqlInstanceType; - - /** - * Creates an instance of SqlMiSettings class. - */ - public SqlMiSettings() { - } - - /** - * Get the azureSqlServiceTier property: Gets or sets the azure SQL service tier. - * - * @return the azureSqlServiceTier value. - */ - public AzureSqlServiceTier azureSqlServiceTier() { - return this.azureSqlServiceTier; - } - - /** - * Set the azureSqlServiceTier property: Gets or sets the azure SQL service tier. - * - * @param azureSqlServiceTier the azureSqlServiceTier value to set. - * @return the SqlMiSettings object itself. - */ - public SqlMiSettings withAzureSqlServiceTier(AzureSqlServiceTier azureSqlServiceTier) { - this.azureSqlServiceTier = azureSqlServiceTier; - return this; - } - - /** - * Get the azureSqlInstanceType property: Gets or sets the azure PAAS SQL instance type. - * - * @return the azureSqlInstanceType value. - */ - public AzureSqlInstanceType azureSqlInstanceType() { - return this.azureSqlInstanceType; - } - - /** - * Set the azureSqlInstanceType property: Gets or sets the azure PAAS SQL instance type. - * - * @param azureSqlInstanceType the azureSqlInstanceType value to set. - * @return the SqlMiSettings object itself. - */ - public SqlMiSettings withAzureSqlInstanceType(AzureSqlInstanceType azureSqlInstanceType) { - this.azureSqlInstanceType = azureSqlInstanceType; - 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("azureSqlServiceTier", - this.azureSqlServiceTier == null ? null : this.azureSqlServiceTier.toString()); - jsonWriter.writeStringField("azureSqlInstanceType", - this.azureSqlInstanceType == null ? null : this.azureSqlInstanceType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SqlMiSettings from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlMiSettings 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 SqlMiSettings. - */ - public static SqlMiSettings fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlMiSettings deserializedSqlMiSettings = new SqlMiSettings(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("azureSqlServiceTier".equals(fieldName)) { - deserializedSqlMiSettings.azureSqlServiceTier = AzureSqlServiceTier.fromString(reader.getString()); - } else if ("azureSqlInstanceType".equals(fieldName)) { - deserializedSqlMiSettings.azureSqlInstanceType - = AzureSqlInstanceType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlMiSettings; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMiSettingsV3.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMiSettingsV3.java new file mode 100644 index 000000000000..3f9304c71737 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMiSettingsV3.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * SQL managed instance assessment settings V3. + */ +@Fluent +public final class SqlMiSettingsV3 implements JsonSerializable { + /* + * Gets or sets the azure SQL service tier. + */ + private AzureSqlServiceTierV3 azureSqlServiceTier; + + /* + * Gets or sets the azure PAAS SQL instance type. + */ + private AzureSqlInstanceType azureSqlInstanceType; + + /** + * Creates an instance of SqlMiSettingsV3 class. + */ + public SqlMiSettingsV3() { + } + + /** + * Get the azureSqlServiceTier property: Gets or sets the azure SQL service tier. + * + * @return the azureSqlServiceTier value. + */ + public AzureSqlServiceTierV3 azureSqlServiceTier() { + return this.azureSqlServiceTier; + } + + /** + * Set the azureSqlServiceTier property: Gets or sets the azure SQL service tier. + * + * @param azureSqlServiceTier the azureSqlServiceTier value to set. + * @return the SqlMiSettingsV3 object itself. + */ + public SqlMiSettingsV3 withAzureSqlServiceTier(AzureSqlServiceTierV3 azureSqlServiceTier) { + this.azureSqlServiceTier = azureSqlServiceTier; + return this; + } + + /** + * Get the azureSqlInstanceType property: Gets or sets the azure PAAS SQL instance type. + * + * @return the azureSqlInstanceType value. + */ + public AzureSqlInstanceType azureSqlInstanceType() { + return this.azureSqlInstanceType; + } + + /** + * Set the azureSqlInstanceType property: Gets or sets the azure PAAS SQL instance type. + * + * @param azureSqlInstanceType the azureSqlInstanceType value to set. + * @return the SqlMiSettingsV3 object itself. + */ + public SqlMiSettingsV3 withAzureSqlInstanceType(AzureSqlInstanceType azureSqlInstanceType) { + this.azureSqlInstanceType = azureSqlInstanceType; + 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("azureSqlServiceTier", + this.azureSqlServiceTier == null ? null : this.azureSqlServiceTier.toString()); + jsonWriter.writeStringField("azureSqlInstanceType", + this.azureSqlInstanceType == null ? null : this.azureSqlInstanceType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlMiSettingsV3 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlMiSettingsV3 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 SqlMiSettingsV3. + */ + public static SqlMiSettingsV3 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlMiSettingsV3 deserializedSqlMiSettingsV3 = new SqlMiSettingsV3(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureSqlServiceTier".equals(fieldName)) { + deserializedSqlMiSettingsV3.azureSqlServiceTier + = AzureSqlServiceTierV3.fromString(reader.getString()); + } else if ("azureSqlInstanceType".equals(fieldName)) { + deserializedSqlMiSettingsV3.azureSqlInstanceType + = AzureSqlInstanceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlMiSettingsV3; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMigrationGuidelineCategory.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMigrationGuidelineCategory.java index cb83e88e4c93..1b95b01b0999 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMigrationGuidelineCategory.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlMigrationGuidelineCategory.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for SqlMigrationGuidelineCategory. + * Sql Migration Guideline Category. */ public final class SqlMigrationGuidelineCategory extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlPaaSTargetOptions.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlPaaSTargetOptions.java deleted file mode 100644 index 92d6ffb5b067..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlPaaSTargetOptions.java +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * SQL target options. - */ -@Fluent -public final class SqlPaaSTargetOptions implements JsonSerializable { - /* - * Gets or sets the Azure SQL compute tier. - */ - private ComputeTier computeTier; - - /* - * Gets or sets the Azure SQL hardware generation. - */ - private HardwareGeneration hardwareGeneration; - - /* - * Gets or sets the Azure SQL target type. - */ - private TargetType targetType; - - /* - * Gets or sets the Azure SQL service tier. - */ - private AzureSqlServiceTier serviceTier; - - /* - * Gets or sets the target location. - */ - private List targetLocations; - - /** - * Creates an instance of SqlPaaSTargetOptions class. - */ - public SqlPaaSTargetOptions() { - } - - /** - * Get the computeTier property: Gets or sets the Azure SQL compute tier. - * - * @return the computeTier value. - */ - public ComputeTier computeTier() { - return this.computeTier; - } - - /** - * Set the computeTier property: Gets or sets the Azure SQL compute tier. - * - * @param computeTier the computeTier value to set. - * @return the SqlPaaSTargetOptions object itself. - */ - public SqlPaaSTargetOptions withComputeTier(ComputeTier computeTier) { - this.computeTier = computeTier; - return this; - } - - /** - * Get the hardwareGeneration property: Gets or sets the Azure SQL hardware generation. - * - * @return the hardwareGeneration value. - */ - public HardwareGeneration hardwareGeneration() { - return this.hardwareGeneration; - } - - /** - * Set the hardwareGeneration property: Gets or sets the Azure SQL hardware generation. - * - * @param hardwareGeneration the hardwareGeneration value to set. - * @return the SqlPaaSTargetOptions object itself. - */ - public SqlPaaSTargetOptions withHardwareGeneration(HardwareGeneration hardwareGeneration) { - this.hardwareGeneration = hardwareGeneration; - return this; - } - - /** - * Get the targetType property: Gets or sets the Azure SQL target type. - * - * @return the targetType value. - */ - public TargetType targetType() { - return this.targetType; - } - - /** - * Set the targetType property: Gets or sets the Azure SQL target type. - * - * @param targetType the targetType value to set. - * @return the SqlPaaSTargetOptions object itself. - */ - public SqlPaaSTargetOptions withTargetType(TargetType targetType) { - this.targetType = targetType; - return this; - } - - /** - * Get the serviceTier property: Gets or sets the Azure SQL service tier. - * - * @return the serviceTier value. - */ - public AzureSqlServiceTier serviceTier() { - return this.serviceTier; - } - - /** - * Set the serviceTier property: Gets or sets the Azure SQL service tier. - * - * @param serviceTier the serviceTier value to set. - * @return the SqlPaaSTargetOptions object itself. - */ - public SqlPaaSTargetOptions withServiceTier(AzureSqlServiceTier serviceTier) { - this.serviceTier = serviceTier; - return this; - } - - /** - * Get the targetLocations property: Gets or sets the target location. - * - * @return the targetLocations value. - */ - public List targetLocations() { - return this.targetLocations; - } - - /** - * Set the targetLocations property: Gets or sets the target location. - * - * @param targetLocations the targetLocations value to set. - * @return the SqlPaaSTargetOptions object itself. - */ - public SqlPaaSTargetOptions withTargetLocations(List targetLocations) { - this.targetLocations = targetLocations; - 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("computeTier", this.computeTier == null ? null : this.computeTier.toString()); - jsonWriter.writeStringField("hardwareGeneration", - this.hardwareGeneration == null ? null : this.hardwareGeneration.toString()); - jsonWriter.writeStringField("targetType", this.targetType == null ? null : this.targetType.toString()); - jsonWriter.writeStringField("serviceTier", this.serviceTier == null ? null : this.serviceTier.toString()); - jsonWriter.writeArrayField("targetLocations", this.targetLocations, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SqlPaaSTargetOptions from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlPaaSTargetOptions 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 SqlPaaSTargetOptions. - */ - public static SqlPaaSTargetOptions fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlPaaSTargetOptions deserializedSqlPaaSTargetOptions = new SqlPaaSTargetOptions(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("computeTier".equals(fieldName)) { - deserializedSqlPaaSTargetOptions.computeTier = ComputeTier.fromString(reader.getString()); - } else if ("hardwareGeneration".equals(fieldName)) { - deserializedSqlPaaSTargetOptions.hardwareGeneration - = HardwareGeneration.fromString(reader.getString()); - } else if ("targetType".equals(fieldName)) { - deserializedSqlPaaSTargetOptions.targetType = TargetType.fromString(reader.getString()); - } else if ("serviceTier".equals(fieldName)) { - deserializedSqlPaaSTargetOptions.serviceTier = AzureSqlServiceTier.fromString(reader.getString()); - } else if ("targetLocations".equals(fieldName)) { - List targetLocations - = reader.readArray(reader1 -> AzureLocation.fromString(reader1.getString())); - deserializedSqlPaaSTargetOptions.targetLocations = targetLocations; - } else { - reader.skipChildren(); - } - } - - return deserializedSqlPaaSTargetOptions; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlServerLicense.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlServerLicense.java index 013dca5143dd..573f3b5818f3 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlServerLicense.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlServerLicense.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for SqlServerLicense. + * Sql Server License. */ public final class SqlServerLicense extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlServerLicenseType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlServerLicenseType.java new file mode 100644 index 000000000000..843ada5b3ea9 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlServerLicenseType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Business case supported SQL Server License types. + */ +public final class SqlServerLicenseType extends ExpandableStringEnum { + /** + * Static value Unknown for SqlServerLicenseType. + */ + public static final SqlServerLicenseType UNKNOWN = fromString("Unknown"); + + /** + * Static value Enterprise for SqlServerLicenseType. + */ + public static final SqlServerLicenseType ENTERPRISE = fromString("Enterprise"); + + /** + * Static value Standard for SqlServerLicenseType. + */ + public static final SqlServerLicenseType STANDARD = fromString("Standard"); + + /** + * Creates a new instance of SqlServerLicenseType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SqlServerLicenseType() { + } + + /** + * Creates or finds a SqlServerLicenseType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SqlServerLicenseType. + */ + public static SqlServerLicenseType fromString(String name) { + return fromString(name, SqlServerLicenseType.class); + } + + /** + * Gets known SqlServerLicenseType values. + * + * @return known SqlServerLicenseType values. + */ + public static Collection values() { + return values(SqlServerLicenseType.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlServerLicensingSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlServerLicensingSettings.java new file mode 100644 index 000000000000..3f3742268d69 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlServerLicensingSettings.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * SQL Server licensing settings. + */ +@Fluent +public final class SqlServerLicensingSettings implements JsonSerializable { + /* + * SQL Server version. + */ + private SqlServerLicenseType version; + + /* + * Licence cost. + */ + private float licenseCost; + + /* + * Software assurance (SA) cost. + */ + private float softwareAssuranceCost; + + /** + * Creates an instance of SqlServerLicensingSettings class. + */ + public SqlServerLicensingSettings() { + } + + /** + * Get the version property: SQL Server version. + * + * @return the version value. + */ + public SqlServerLicenseType version() { + return this.version; + } + + /** + * Set the version property: SQL Server version. + * + * @param version the version value to set. + * @return the SqlServerLicensingSettings object itself. + */ + public SqlServerLicensingSettings withVersion(SqlServerLicenseType version) { + this.version = version; + return this; + } + + /** + * Get the licenseCost property: Licence cost. + * + * @return the licenseCost value. + */ + public float licenseCost() { + return this.licenseCost; + } + + /** + * Set the licenseCost property: Licence cost. + * + * @param licenseCost the licenseCost value to set. + * @return the SqlServerLicensingSettings object itself. + */ + public SqlServerLicensingSettings withLicenseCost(float licenseCost) { + this.licenseCost = licenseCost; + return this; + } + + /** + * Get the softwareAssuranceCost property: Software assurance (SA) cost. + * + * @return the softwareAssuranceCost value. + */ + public float softwareAssuranceCost() { + return this.softwareAssuranceCost; + } + + /** + * Set the softwareAssuranceCost property: Software assurance (SA) cost. + * + * @param softwareAssuranceCost the softwareAssuranceCost value to set. + * @return the SqlServerLicensingSettings object itself. + */ + public SqlServerLicensingSettings withSoftwareAssuranceCost(float softwareAssuranceCost) { + this.softwareAssuranceCost = softwareAssuranceCost; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (version() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property version in model SqlServerLicensingSettings")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SqlServerLicensingSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("version", this.version == null ? null : this.version.toString()); + jsonWriter.writeFloatField("licenseCost", this.licenseCost); + jsonWriter.writeFloatField("softwareAssuranceCost", this.softwareAssuranceCost); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlServerLicensingSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlServerLicensingSettings 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 SqlServerLicensingSettings. + */ + public static SqlServerLicensingSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlServerLicensingSettings deserializedSqlServerLicensingSettings = new SqlServerLicensingSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedSqlServerLicensingSettings.version + = SqlServerLicenseType.fromString(reader.getString()); + } else if ("licenseCost".equals(fieldName)) { + deserializedSqlServerLicensingSettings.licenseCost = reader.getFloat(); + } else if ("softwareAssuranceCost".equals(fieldName)) { + deserializedSqlServerLicensingSettings.softwareAssuranceCost = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlServerLicensingSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlServiceTier.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlServiceTier.java new file mode 100644 index 000000000000..bced468533f7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlServiceTier.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SQL service tier. + */ +@Immutable +public final class SqlServiceTier implements JsonSerializable { + /* + * The service tier name. + */ + private String serviceTierName; + + /* + * The number of sql entities with this tier. + */ + private Float serviceTierNumber; + + /** + * Creates an instance of SqlServiceTier class. + */ + public SqlServiceTier() { + } + + /** + * Get the serviceTierName property: The service tier name. + * + * @return the serviceTierName value. + */ + public String serviceTierName() { + return this.serviceTierName; + } + + /** + * Get the serviceTierNumber property: The number of sql entities with this tier. + * + * @return the serviceTierNumber value. + */ + public Float serviceTierNumber() { + return this.serviceTierNumber; + } + + /** + * 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 SqlServiceTier from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlServiceTier 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 SqlServiceTier. + */ + public static SqlServiceTier fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlServiceTier deserializedSqlServiceTier = new SqlServiceTier(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceTierName".equals(fieldName)) { + deserializedSqlServiceTier.serviceTierName = reader.getString(); + } else if ("serviceTierNumber".equals(fieldName)) { + deserializedSqlServiceTier.serviceTierNumber = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlServiceTier; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlVersionDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlVersionDetails.java new file mode 100644 index 000000000000..c49ab9fec0a3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SqlVersionDetails.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SQL version details. + */ +@Immutable +public final class SqlVersionDetails implements JsonSerializable { + /* + * The SQL version. + */ + private String sqlVersion; + + /* + * Number of instances with the above SQL version. + */ + private Integer numberOfInstances; + + /** + * Creates an instance of SqlVersionDetails class. + */ + public SqlVersionDetails() { + } + + /** + * Get the sqlVersion property: The SQL version. + * + * @return the sqlVersion value. + */ + public String sqlVersion() { + return this.sqlVersion; + } + + /** + * Get the numberOfInstances property: Number of instances with the above SQL version. + * + * @return the numberOfInstances value. + */ + public Integer numberOfInstances() { + return this.numberOfInstances; + } + + /** + * 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 SqlVersionDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlVersionDetails 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 SqlVersionDetails. + */ + public static SqlVersionDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlVersionDetails deserializedSqlVersionDetails = new SqlVersionDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sqlVersion".equals(fieldName)) { + deserializedSqlVersionDetails.sqlVersion = reader.getString(); + } else if ("numberOfInstances".equals(fieldName)) { + deserializedSqlVersionDetails.numberOfInstances = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlVersionDetails; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/StorageSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/StorageSettings.java new file mode 100644 index 000000000000..035f536b5808 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/StorageSettings.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Storage settings. + */ +@Fluent +public final class StorageSettings implements JsonSerializable { + /* + * Cost per gigabyte per year. + */ + private float costPerGbPerYear; + + /* + * Maintenance cost percentage. + */ + private float maintainanceCostPercentageToAcquisitionCost; + + /** + * Creates an instance of StorageSettings class. + */ + public StorageSettings() { + } + + /** + * Get the costPerGbPerYear property: Cost per gigabyte per year. + * + * @return the costPerGbPerYear value. + */ + public float costPerGbPerYear() { + return this.costPerGbPerYear; + } + + /** + * Set the costPerGbPerYear property: Cost per gigabyte per year. + * + * @param costPerGbPerYear the costPerGbPerYear value to set. + * @return the StorageSettings object itself. + */ + public StorageSettings withCostPerGbPerYear(float costPerGbPerYear) { + this.costPerGbPerYear = costPerGbPerYear; + return this; + } + + /** + * Get the maintainanceCostPercentageToAcquisitionCost property: Maintenance cost percentage. + * + * @return the maintainanceCostPercentageToAcquisitionCost value. + */ + public float maintainanceCostPercentageToAcquisitionCost() { + return this.maintainanceCostPercentageToAcquisitionCost; + } + + /** + * Set the maintainanceCostPercentageToAcquisitionCost property: Maintenance cost percentage. + * + * @param maintainanceCostPercentageToAcquisitionCost the maintainanceCostPercentageToAcquisitionCost value to set. + * @return the StorageSettings object itself. + */ + public StorageSettings + withMaintainanceCostPercentageToAcquisitionCost(float maintainanceCostPercentageToAcquisitionCost) { + this.maintainanceCostPercentageToAcquisitionCost = maintainanceCostPercentageToAcquisitionCost; + 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.writeFloatField("costPerGbPerYear", this.costPerGbPerYear); + jsonWriter.writeFloatField("maintainanceCostPercentageToAcquisitionCost", + this.maintainanceCostPercentageToAcquisitionCost); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageSettings 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 StorageSettings. + */ + public static StorageSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageSettings deserializedStorageSettings = new StorageSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("costPerGbPerYear".equals(fieldName)) { + deserializedStorageSettings.costPerGbPerYear = reader.getFloat(); + } else if ("maintainanceCostPercentageToAcquisitionCost".equals(fieldName)) { + deserializedStorageSettings.maintainanceCostPercentageToAcquisitionCost = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/StrategyType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/StrategyType.java new file mode 100644 index 000000000000..8f9ccc5d20c1 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/StrategyType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Strategy type. + */ +public final class StrategyType extends ExpandableStringEnum { + /** + * Static value PaaSPreferred for StrategyType. + */ + public static final StrategyType PAA_SPREFERRED = fromString("PaaSPreferred"); + + /** + * Static value CostOptimized for StrategyType. + */ + public static final StrategyType COST_OPTIMIZED = fromString("CostOptimized"); + + /** + * Static value EffortOptimized for StrategyType. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SummaryProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SummaryProperties.java new file mode 100644 index 000000000000..5e961280e6df --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SummaryProperties.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SummaryType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SummaryType.java new file mode 100644 index 000000000000..f053a1b20ba4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SummaryType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Summary Type. + */ +public final class SummaryType extends ExpandableStringEnum { + /** + * Static value Unknown for SummaryType. + */ + public static final SummaryType UNKNOWN = fromString("Unknown"); + + /** + * Static value Strategy for SummaryType. + */ + public static final SummaryType STRATEGY = fromString("Strategy"); + + /** + * Static value Target for SummaryType. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SupportStatusDistribution.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SupportStatusDistribution.java new file mode 100644 index 000000000000..c77343bf69b6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SupportStatusDistribution.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Support Status Distribution. + */ +@Immutable +public final class SupportStatusDistribution implements JsonSerializable { + /* + * Unknown support. + */ + private Integer unknownSupport; + + /* + * Mainstream support. + */ + private Integer mainStream; + + /* + * Extended support. + */ + private Integer extended; + + /* + * Out of support. + */ + private Integer outOfSupport; + + /** + * Creates an instance of SupportStatusDistribution class. + */ + public SupportStatusDistribution() { + } + + /** + * Get the unknownSupport property: Unknown support. + * + * @return the unknownSupport value. + */ + public Integer unknownSupport() { + return this.unknownSupport; + } + + /** + * Get the mainStream property: Mainstream support. + * + * @return the mainStream value. + */ + public Integer mainStream() { + return this.mainStream; + } + + /** + * Get the extended property: Extended support. + * + * @return the extended value. + */ + public Integer extended() { + return this.extended; + } + + /** + * Get the outOfSupport property: Out of support. + * + * @return the outOfSupport value. + */ + public Integer outOfSupport() { + return this.outOfSupport; + } + + /** + * 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 SupportStatusDistribution from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SupportStatusDistribution 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 SupportStatusDistribution. + */ + public static SupportStatusDistribution fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SupportStatusDistribution deserializedSupportStatusDistribution = new SupportStatusDistribution(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("unknownSupport".equals(fieldName)) { + deserializedSupportStatusDistribution.unknownSupport = reader.getNullable(JsonReader::getInt); + } else if ("mainStream".equals(fieldName)) { + deserializedSupportStatusDistribution.mainStream = reader.getNullable(JsonReader::getInt); + } else if ("extended".equals(fieldName)) { + deserializedSupportStatusDistribution.extended = reader.getNullable(JsonReader::getInt); + } else if ("outOfSupport".equals(fieldName)) { + deserializedSupportStatusDistribution.outOfSupport = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSupportStatusDistribution; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SupportabilityStatus.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SupportabilityStatus.java new file mode 100644 index 000000000000..cd0f765ecb9f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/SupportabilityStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Supportability Status. + */ +public final class SupportabilityStatus extends ExpandableStringEnum { + /** + * Static value Unknown for SupportabilityStatus. + */ + public static final SupportabilityStatus UNKNOWN = fromString("Unknown"); + + /** + * Static value Mainstream for SupportabilityStatus. + */ + public static final SupportabilityStatus MAINSTREAM = fromString("Mainstream"); + + /** + * Static value Extended for SupportabilityStatus. + */ + public static final SupportabilityStatus EXTENDED = fromString("Extended"); + + /** + * Static value OutOfSupport for SupportabilityStatus. + */ + public static final SupportabilityStatus OUT_OF_SUPPORT = fromString("OutOfSupport"); + + /** + * Creates a new instance of SupportabilityStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SupportabilityStatus() { + } + + /** + * Creates or finds a SupportabilityStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SupportabilityStatus. + */ + public static SupportabilityStatus fromString(String name) { + return fromString(name, SupportabilityStatus.class); + } + + /** + * Gets known SupportabilityStatus values. + * + * @return known SupportabilityStatus values. + */ + public static Collection values() { + return values(SupportabilityStatus.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TargetAssessmentArmIds.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TargetAssessmentArmIds.java new file mode 100644 index 000000000000..234bbb969776 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TargetAssessmentArmIds.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * ARM IDs of the target assessments. + */ +@Fluent +public final class TargetAssessmentArmIds implements JsonSerializable { + /* + * ARM ID for Azure Kubernetes Service assessment. + */ + private String aks; + + /* + * ARM ID for Azure App Service assessment. + */ + private String azureAppService; + + /* + * ARM ID for Azure App Service Container assessment. + */ + private String azureAppServiceContainer; + + /** + * Creates an instance of TargetAssessmentArmIds class. + */ + public TargetAssessmentArmIds() { + } + + /** + * Get the aks property: ARM ID for Azure Kubernetes Service assessment. + * + * @return the aks value. + */ + public String aks() { + return this.aks; + } + + /** + * Set the aks property: ARM ID for Azure Kubernetes Service assessment. + * + * @param aks the aks value to set. + * @return the TargetAssessmentArmIds object itself. + */ + public TargetAssessmentArmIds withAks(String aks) { + this.aks = aks; + return this; + } + + /** + * Get the azureAppService property: ARM ID for Azure App Service assessment. + * + * @return the azureAppService value. + */ + public String azureAppService() { + return this.azureAppService; + } + + /** + * Set the azureAppService property: ARM ID for Azure App Service assessment. + * + * @param azureAppService the azureAppService value to set. + * @return the TargetAssessmentArmIds object itself. + */ + public TargetAssessmentArmIds withAzureAppService(String azureAppService) { + this.azureAppService = azureAppService; + return this; + } + + /** + * Get the azureAppServiceContainer property: ARM ID for Azure App Service Container assessment. + * + * @return the azureAppServiceContainer value. + */ + public String azureAppServiceContainer() { + return this.azureAppServiceContainer; + } + + /** + * Set the azureAppServiceContainer property: ARM ID for Azure App Service Container assessment. + * + * @param azureAppServiceContainer the azureAppServiceContainer value to set. + * @return the TargetAssessmentArmIds object itself. + */ + public TargetAssessmentArmIds withAzureAppServiceContainer(String azureAppServiceContainer) { + this.azureAppServiceContainer = azureAppServiceContainer; + 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("aks", this.aks); + jsonWriter.writeStringField("azureAppService", this.azureAppService); + jsonWriter.writeStringField("azureAppServiceContainer", this.azureAppServiceContainer); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetAssessmentArmIds from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetAssessmentArmIds 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 TargetAssessmentArmIds. + */ + public static TargetAssessmentArmIds fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetAssessmentArmIds deserializedTargetAssessmentArmIds = new TargetAssessmentArmIds(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("aks".equals(fieldName)) { + deserializedTargetAssessmentArmIds.aks = reader.getString(); + } else if ("azureAppService".equals(fieldName)) { + deserializedTargetAssessmentArmIds.azureAppService = reader.getString(); + } else if ("azureAppServiceContainer".equals(fieldName)) { + deserializedTargetAssessmentArmIds.azureAppServiceContainer = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetAssessmentArmIds; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TargetDetails.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TargetDetails.java new file mode 100644 index 000000000000..01809bc9b026 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TargetDetails.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TargetSourcePair.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TargetSourcePair.java new file mode 100644 index 000000000000..b61653e403dd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TargetSourcePair.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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. + */ + public 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TargetType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TargetType.java index 2ce49e07e271..56993cf33503 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TargetType.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TargetType.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for TargetType. + * Target Type. */ public final class TargetType extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ThirdPartyManagementSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ThirdPartyManagementSettings.java new file mode 100644 index 000000000000..d56c1b5022a0 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/ThirdPartyManagementSettings.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Third Party Management settings. + */ +@Fluent +public final class ThirdPartyManagementSettings implements JsonSerializable { + /* + * License Cost. + */ + private float licenseCost; + + /* + * Support Cost. + */ + private float supportCost; + + /** + * Creates an instance of ThirdPartyManagementSettings class. + */ + public ThirdPartyManagementSettings() { + } + + /** + * Get the licenseCost property: License Cost. + * + * @return the licenseCost value. + */ + public float licenseCost() { + return this.licenseCost; + } + + /** + * Set the licenseCost property: License Cost. + * + * @param licenseCost the licenseCost value to set. + * @return the ThirdPartyManagementSettings object itself. + */ + public ThirdPartyManagementSettings withLicenseCost(float licenseCost) { + this.licenseCost = licenseCost; + return this; + } + + /** + * Get the supportCost property: Support Cost. + * + * @return the supportCost value. + */ + public float supportCost() { + return this.supportCost; + } + + /** + * Set the supportCost property: Support Cost. + * + * @param supportCost the supportCost value to set. + * @return the ThirdPartyManagementSettings object itself. + */ + public ThirdPartyManagementSettings withSupportCost(float supportCost) { + this.supportCost = supportCost; + 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.writeFloatField("licenseCost", this.licenseCost); + jsonWriter.writeFloatField("supportCost", this.supportCost); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThirdPartyManagementSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThirdPartyManagementSettings 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 ThirdPartyManagementSettings. + */ + public static ThirdPartyManagementSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThirdPartyManagementSettings deserializedThirdPartyManagementSettings = new ThirdPartyManagementSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("licenseCost".equals(fieldName)) { + deserializedThirdPartyManagementSettings.licenseCost = reader.getFloat(); + } else if ("supportCost".equals(fieldName)) { + deserializedThirdPartyManagementSettings.supportCost = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedThirdPartyManagementSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TimeRange.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TimeRange.java index 92be582b80a0..08a8bd6f078f 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TimeRange.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/TimeRange.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for TimeRange. + * Time Range for Performance Data. */ public final class TimeRange extends ExpandableStringEnum { /** diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/UltraDiskAssessmentOptions.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/UltraDiskAssessmentOptions.java deleted file mode 100644 index 587443557fd3..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/UltraDiskAssessmentOptions.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Assessment options for Ultra disk type. - */ -@Fluent -public final class UltraDiskAssessmentOptions implements JsonSerializable { - /* - * Family name. - */ - private String familyName; - - /* - * List of locations where ultra disk is supported for this VMfamily. - */ - private List targetLocations; - - /** - * Creates an instance of UltraDiskAssessmentOptions class. - */ - public UltraDiskAssessmentOptions() { - } - - /** - * Get the familyName property: Family name. - * - * @return the familyName value. - */ - public String familyName() { - return this.familyName; - } - - /** - * Set the familyName property: Family name. - * - * @param familyName the familyName value to set. - * @return the UltraDiskAssessmentOptions object itself. - */ - public UltraDiskAssessmentOptions withFamilyName(String familyName) { - this.familyName = familyName; - return this; - } - - /** - * Get the targetLocations property: List of locations where ultra disk is supported for this VMfamily. - * - * @return the targetLocations value. - */ - public List targetLocations() { - return this.targetLocations; - } - - /** - * Set the targetLocations property: List of locations where ultra disk is supported for this VMfamily. - * - * @param targetLocations the targetLocations value to set. - * @return the UltraDiskAssessmentOptions object itself. - */ - public UltraDiskAssessmentOptions withTargetLocations(List targetLocations) { - this.targetLocations = targetLocations; - 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("familyName", this.familyName); - jsonWriter.writeArrayField("targetLocations", this.targetLocations, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UltraDiskAssessmentOptions from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UltraDiskAssessmentOptions 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 UltraDiskAssessmentOptions. - */ - public static UltraDiskAssessmentOptions fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UltraDiskAssessmentOptions deserializedUltraDiskAssessmentOptions = new UltraDiskAssessmentOptions(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("familyName".equals(fieldName)) { - deserializedUltraDiskAssessmentOptions.familyName = reader.getString(); - } else if ("targetLocations".equals(fieldName)) { - List targetLocations = reader.readArray(reader1 -> reader1.getString()); - deserializedUltraDiskAssessmentOptions.targetLocations = targetLocations; - } else { - reader.skipChildren(); - } - } - - return deserializedUltraDiskAssessmentOptions; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/UltraDiskSupport.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/UltraDiskSupport.java new file mode 100644 index 000000000000..126886ae677c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/UltraDiskSupport.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Ultra Disk Support. + */ +public final class UltraDiskSupport extends ExpandableStringEnum { + /** + * Static value UltraDiskSupported for UltraDiskSupport. + */ + public static final UltraDiskSupport ULTRA_DISK_SUPPORTED = fromString("UltraDiskSupported"); + + /** + * Static value UltraDiskNotSupported for UltraDiskSupport. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/UpdateGroupBody.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/UpdateGroupBody.java deleted file mode 100644 index 83f8027ee956..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/UpdateGroupBody.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Properties of group update. - */ -@Fluent -public final class UpdateGroupBody implements JsonSerializable { - /* - * For optimistic concurrency control. - */ - private String etag; - - /* - * Properties of the group. - */ - private GroupBodyProperties properties; - - /** - * Creates an instance of UpdateGroupBody class. - */ - public UpdateGroupBody() { - } - - /** - * Get the etag property: For optimistic concurrency control. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: For optimistic concurrency control. - * - * @param etag the etag value to set. - * @return the UpdateGroupBody object itself. - */ - public UpdateGroupBody withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the properties property: Properties of the group. - * - * @return the properties value. - */ - public GroupBodyProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the group. - * - * @param properties the properties value to set. - * @return the UpdateGroupBody object itself. - */ - public UpdateGroupBody withProperties(GroupBodyProperties properties) { - this.properties = properties; - return this; - } - - /** - * 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.writeStringField("eTag", this.etag); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UpdateGroupBody from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UpdateGroupBody 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 UpdateGroupBody. - */ - public static UpdateGroupBody fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UpdateGroupBody deserializedUpdateGroupBody = new UpdateGroupBody(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("eTag".equals(fieldName)) { - deserializedUpdateGroupBody.etag = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedUpdateGroupBody.properties = GroupBodyProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedUpdateGroupBody; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/UtilizationData.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/UtilizationData.java new file mode 100644 index 000000000000..333af34360dd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/UtilizationData.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 SQL on premises utilization insights. + */ +@Immutable +public final class UtilizationData implements JsonSerializable { + /* + * The number of active entities. + */ + private Integer numberOfActiveEntities; + + /* + * The number of inactive entities. + */ + private Integer numberOfInactiveEntities; + + /* + * The number of decommission entities. + */ + private Integer numberOfDecommisionEntities; + + /* + * The number of unknown entities. + */ + private Integer numberOfUnknownEntities; + + /** + * Creates an instance of UtilizationData class. + */ + public UtilizationData() { + } + + /** + * Get the numberOfActiveEntities property: The number of active entities. + * + * @return the numberOfActiveEntities value. + */ + public Integer numberOfActiveEntities() { + return this.numberOfActiveEntities; + } + + /** + * Get the numberOfInactiveEntities property: The number of inactive entities. + * + * @return the numberOfInactiveEntities value. + */ + public Integer numberOfInactiveEntities() { + return this.numberOfInactiveEntities; + } + + /** + * Get the numberOfDecommisionEntities property: The number of decommission entities. + * + * @return the numberOfDecommisionEntities value. + */ + public Integer numberOfDecommisionEntities() { + return this.numberOfDecommisionEntities; + } + + /** + * Get the numberOfUnknownEntities property: The number of unknown entities. + * + * @return the numberOfUnknownEntities value. + */ + public Integer numberOfUnknownEntities() { + return this.numberOfUnknownEntities; + } + + /** + * 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 UtilizationData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UtilizationData 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 UtilizationData. + */ + public static UtilizationData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UtilizationData deserializedUtilizationData = new UtilizationData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("numberOfActiveEntities".equals(fieldName)) { + deserializedUtilizationData.numberOfActiveEntities = reader.getNullable(JsonReader::getInt); + } else if ("numberOfInactiveEntities".equals(fieldName)) { + deserializedUtilizationData.numberOfInactiveEntities = reader.getNullable(JsonReader::getInt); + } else if ("numberOfDecommisionEntities".equals(fieldName)) { + deserializedUtilizationData.numberOfDecommisionEntities = reader.getNullable(JsonReader::getInt); + } else if ("numberOfUnknownEntities".equals(fieldName)) { + deserializedUtilizationData.numberOfUnknownEntities = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedUtilizationData; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/VirtualizationSoftwareSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/VirtualizationSoftwareSettings.java new file mode 100644 index 000000000000..afdcd4f4602b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/VirtualizationSoftwareSettings.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Virtualization software settings. + */ +@Fluent +public final class VirtualizationSoftwareSettings implements JsonSerializable { + /* + * VMware cloud foundation license cost. + */ + private float vMwareCloudFoundationLicenseCost; + + /** + * Creates an instance of VirtualizationSoftwareSettings class. + */ + public VirtualizationSoftwareSettings() { + } + + /** + * Get the vMwareCloudFoundationLicenseCost property: VMware cloud foundation license cost. + * + * @return the vMwareCloudFoundationLicenseCost value. + */ + public float vMwareCloudFoundationLicenseCost() { + return this.vMwareCloudFoundationLicenseCost; + } + + /** + * Set the vMwareCloudFoundationLicenseCost property: VMware cloud foundation license cost. + * + * @param vMwareCloudFoundationLicenseCost the vMwareCloudFoundationLicenseCost value to set. + * @return the VirtualizationSoftwareSettings object itself. + */ + public VirtualizationSoftwareSettings withVMwareCloudFoundationLicenseCost(float vMwareCloudFoundationLicenseCost) { + this.vMwareCloudFoundationLicenseCost = vMwareCloudFoundationLicenseCost; + 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.writeFloatField("vMwareCloudFoundationLicenseCost", this.vMwareCloudFoundationLicenseCost); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualizationSoftwareSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualizationSoftwareSettings 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 VirtualizationSoftwareSettings. + */ + public static VirtualizationSoftwareSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualizationSoftwareSettings deserializedVirtualizationSoftwareSettings + = new VirtualizationSoftwareSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vMwareCloudFoundationLicenseCost".equals(fieldName)) { + deserializedVirtualizationSoftwareSettings.vMwareCloudFoundationLicenseCost = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualizationSoftwareSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/VmFamilyCategoryItem.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/VmFamilyCategoryItem.java new file mode 100644 index 000000000000..b348c1894976 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/VmFamilyCategoryItem.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Vm Family Category Item. + */ +public final class VmFamilyCategoryItem extends ExpandableStringEnum { + /** + * Static value Unknown for VmFamilyCategoryItem. + */ + public static final VmFamilyCategoryItem UNKNOWN = fromString("Unknown"); + + /** + * Static value GeneralPurpose for VmFamilyCategoryItem. + */ + public static final VmFamilyCategoryItem GENERAL_PURPOSE = fromString("GeneralPurpose"); + + /** + * Static value ComputeOptimized for VmFamilyCategoryItem. + */ + public static final VmFamilyCategoryItem COMPUTE_OPTIMIZED = fromString("ComputeOptimized"); + + /** + * Static value MemoryOptimized for VmFamilyCategoryItem. + */ + public static final VmFamilyCategoryItem MEMORY_OPTIMIZED = fromString("MemoryOptimized"); + + /** + * Static value StorageOptimized for VmFamilyCategoryItem. + */ + public static final VmFamilyCategoryItem STORAGE_OPTIMIZED = fromString("StorageOptimized"); + + /** + * Static value GpuOptimized for VmFamilyCategoryItem. + */ + public static final VmFamilyCategoryItem GPU_OPTIMIZED = fromString("GpuOptimized"); + + /** + * Static value HighPerformanceCompute for VmFamilyCategoryItem. + */ + public static final VmFamilyCategoryItem HIGH_PERFORMANCE_COMPUTE = fromString("HighPerformanceCompute"); + + /** + * Static value SupportsPremiumStorage for VmFamilyCategoryItem. + */ + public static final VmFamilyCategoryItem SUPPORTS_PREMIUM_STORAGE = fromString("SupportsPremiumStorage"); + + /** + * Static value Confidential for VmFamilyCategoryItem. + */ + public static final VmFamilyCategoryItem CONFIDENTIAL = fromString("Confidential"); + + /** + * Static value SupportsUltraDiskStorage for VmFamilyCategoryItem. + */ + 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/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/VmFamilyOptions.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/VmFamilyOptions.java deleted file mode 100644 index 669fcdde8739..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/VmFamilyOptions.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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 family name, the list of targeted azure locations and the category of the - * family. - */ -@Immutable -public final class VmFamilyOptions implements JsonSerializable { - /* - * Name of the VM family. - */ - private String familyName; - - /* - * List of Azure regions. - */ - private List targetLocations; - - /* - * Category of the VM family. - */ - private List category; - - /** - * Creates an instance of VmFamilyOptions class. - */ - public VmFamilyOptions() { - } - - /** - * Get the familyName property: Name of the VM family. - * - * @return the familyName value. - */ - public String familyName() { - return this.familyName; - } - - /** - * Get the targetLocations property: List of Azure regions. - * - * @return the targetLocations value. - */ - public List targetLocations() { - return this.targetLocations; - } - - /** - * Get the category property: Category of the VM family. - * - * @return the category value. - */ - public List category() { - return this.category; - } - - /** - * 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 VmFamilyOptions from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of VmFamilyOptions 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 VmFamilyOptions. - */ - public static VmFamilyOptions fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - VmFamilyOptions deserializedVmFamilyOptions = new VmFamilyOptions(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("familyName".equals(fieldName)) { - deserializedVmFamilyOptions.familyName = reader.getString(); - } else if ("targetLocations".equals(fieldName)) { - List targetLocations = reader.readArray(reader1 -> reader1.getString()); - deserializedVmFamilyOptions.targetLocations = targetLocations; - } else if ("category".equals(fieldName)) { - List category = reader.readArray(reader1 -> reader1.getString()); - deserializedVmFamilyOptions.category = category; - } else { - reader.skipChildren(); - } - } - - return deserializedVmFamilyOptions; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/VmwareCollectorsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/VmwareCollectorsOperations.java index 1452f2c3f131..23516568abcf 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/VmwareCollectorsOperations.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/VmwareCollectorsOperations.java @@ -22,7 +22,7 @@ public interface VmwareCollectorsOperations { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a VmwareCollector list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName); + PagedIterable listByParent(String resourceGroupName, String projectName); /** * List VmwareCollector resources by AssessmentProject. @@ -35,8 +35,7 @@ public interface VmwareCollectorsOperations { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a VmwareCollector list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByAssessmentProject(String resourceGroupName, String projectName, - Context context); + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); /** * Get a VmwareCollector. diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentSettings.java new file mode 100644 index 000000000000..59c0b8e49f47 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentSettings.java @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Web app assessment settings class. + */ +@Fluent +public final class WebAppAssessmentSettings 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 Float scalingFactor; + + /* + * Custom discount percentage. + */ + private Float 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; + + /* + * App Service native settings. + */ + private AppSvcNativeSettings appSvcNativeSettings; + + /* + * App Service container settings. + */ + private AppSvcContainerSettings appSvcContainerSettings; + + /* + * Azure security offering type. + */ + private AzureSecurityOfferingType azureSecurityOfferingType; + + /** + * Creates an instance of WebAppAssessmentSettings class. + */ + public WebAppAssessmentSettings() { + } + + /** + * 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 WebAppAssessmentSettings object itself. + */ + public WebAppAssessmentSettings 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 WebAppAssessmentSettings object itself. + */ + public WebAppAssessmentSettings 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 Float 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 WebAppAssessmentSettings object itself. + */ + public WebAppAssessmentSettings withScalingFactor(Float scalingFactor) { + this.scalingFactor = scalingFactor; + return this; + } + + /** + * Get the discountPercentage property: Custom discount percentage. + * + * @return the discountPercentage value. + */ + public Float discountPercentage() { + return this.discountPercentage; + } + + /** + * Set the discountPercentage property: Custom discount percentage. + * + * @param discountPercentage the discountPercentage value to set. + * @return the WebAppAssessmentSettings object itself. + */ + public WebAppAssessmentSettings withDiscountPercentage(Float 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 WebAppAssessmentSettings object itself. + */ + public WebAppAssessmentSettings 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 WebAppAssessmentSettings object itself. + */ + public WebAppAssessmentSettings 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 WebAppAssessmentSettings object itself. + */ + public WebAppAssessmentSettings 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 WebAppAssessmentSettings object itself. + */ + public WebAppAssessmentSettings 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 WebAppAssessmentSettings object itself. + */ + public WebAppAssessmentSettings withEnvironmentType(EnvironmentType environmentType) { + this.environmentType = environmentType; + return this; + } + + /** + * Get the appSvcNativeSettings property: App Service native settings. + * + * @return the appSvcNativeSettings value. + */ + public AppSvcNativeSettings appSvcNativeSettings() { + return this.appSvcNativeSettings; + } + + /** + * Set the appSvcNativeSettings property: App Service native settings. + * + * @param appSvcNativeSettings the appSvcNativeSettings value to set. + * @return the WebAppAssessmentSettings object itself. + */ + public WebAppAssessmentSettings withAppSvcNativeSettings(AppSvcNativeSettings appSvcNativeSettings) { + this.appSvcNativeSettings = appSvcNativeSettings; + return this; + } + + /** + * Get the appSvcContainerSettings property: App Service container settings. + * + * @return the appSvcContainerSettings value. + */ + public AppSvcContainerSettings appSvcContainerSettings() { + return this.appSvcContainerSettings; + } + + /** + * Set the appSvcContainerSettings property: App Service container settings. + * + * @param appSvcContainerSettings the appSvcContainerSettings value to set. + * @return the WebAppAssessmentSettings object itself. + */ + public WebAppAssessmentSettings withAppSvcContainerSettings(AppSvcContainerSettings appSvcContainerSettings) { + this.appSvcContainerSettings = appSvcContainerSettings; + return this; + } + + /** + * Get the azureSecurityOfferingType property: Azure security offering type. + * + * @return the azureSecurityOfferingType value. + */ + public AzureSecurityOfferingType azureSecurityOfferingType() { + return this.azureSecurityOfferingType; + } + + /** + * Set the azureSecurityOfferingType property: Azure security offering type. + * + * @param azureSecurityOfferingType the azureSecurityOfferingType value to set. + * @return the WebAppAssessmentSettings object itself. + */ + public WebAppAssessmentSettings withAzureSecurityOfferingType(AzureSecurityOfferingType azureSecurityOfferingType) { + this.azureSecurityOfferingType = azureSecurityOfferingType; + 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 (appSvcNativeSettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property appSvcNativeSettings in model WebAppAssessmentSettings")); + } else { + appSvcNativeSettings().validate(); + } + if (appSvcContainerSettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property appSvcContainerSettings in model WebAppAssessmentSettings")); + } else { + appSvcContainerSettings().validate(); + } + if (azureSecurityOfferingType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property azureSecurityOfferingType in model WebAppAssessmentSettings")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebAppAssessmentSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("appSvcNativeSettings", this.appSvcNativeSettings); + jsonWriter.writeJsonField("appSvcContainerSettings", this.appSvcContainerSettings); + jsonWriter.writeStringField("azureSecurityOfferingType", + this.azureSecurityOfferingType == null ? null : this.azureSecurityOfferingType.toString()); + 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()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebAppAssessmentSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppAssessmentSettings 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 WebAppAssessmentSettings. + */ + public static WebAppAssessmentSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppAssessmentSettings deserializedWebAppAssessmentSettings = new WebAppAssessmentSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appSvcNativeSettings".equals(fieldName)) { + deserializedWebAppAssessmentSettings.appSvcNativeSettings = AppSvcNativeSettings.fromJson(reader); + } else if ("appSvcContainerSettings".equals(fieldName)) { + deserializedWebAppAssessmentSettings.appSvcContainerSettings + = AppSvcContainerSettings.fromJson(reader); + } else if ("azureSecurityOfferingType".equals(fieldName)) { + deserializedWebAppAssessmentSettings.azureSecurityOfferingType + = AzureSecurityOfferingType.fromString(reader.getString()); + } else if ("azureLocation".equals(fieldName)) { + deserializedWebAppAssessmentSettings.azureLocation = reader.getString(); + } else if ("currency".equals(fieldName)) { + deserializedWebAppAssessmentSettings.currency = AzureCurrency.fromString(reader.getString()); + } else if ("scalingFactor".equals(fieldName)) { + deserializedWebAppAssessmentSettings.scalingFactor = reader.getNullable(JsonReader::getFloat); + } else if ("discountPercentage".equals(fieldName)) { + deserializedWebAppAssessmentSettings.discountPercentage = reader.getNullable(JsonReader::getFloat); + } else if ("sizingCriterion".equals(fieldName)) { + deserializedWebAppAssessmentSettings.sizingCriterion + = AssessmentSizingCriterion.fromString(reader.getString()); + } else if ("performanceData".equals(fieldName)) { + deserializedWebAppAssessmentSettings.performanceData = PerformanceData.fromJson(reader); + } else if ("savingsSettings".equals(fieldName)) { + deserializedWebAppAssessmentSettings.savingsSettings = SavingsSettings.fromJson(reader); + } else if ("billingSettings".equals(fieldName)) { + deserializedWebAppAssessmentSettings.billingSettings = BillingSettings.fromJson(reader); + } else if ("environmentType".equals(fieldName)) { + deserializedWebAppAssessmentSettings.environmentType + = EnvironmentType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppAssessmentSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3.java new file mode 100644 index 000000000000..ffceb3fd30cd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppAssessmentV3Inner; + +/** + * An immutable client-side representation of WebAppAssessmentV3. + */ +public interface WebAppAssessmentV3 { + /** + * 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. + */ + WebAppAssessmentV3Properties 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.migration.assessment.fluent.models.WebAppAssessmentV3Inner object. + * + * @return the inner object. + */ + WebAppAssessmentV3Inner innerModel(); + + /** + * The entirety of the WebAppAssessmentV3 definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The WebAppAssessmentV3 definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the WebAppAssessmentV3 definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the WebAppAssessmentV3 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 WebAppAssessmentV3 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. + */ + WebAppAssessmentV3 create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WebAppAssessmentV3 create(Context context); + } + + /** + * The stage of the WebAppAssessmentV3 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(WebAppAssessmentV3Properties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WebAppAssessmentV3 refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WebAppAssessmentV3 refresh(Context context); + + /** + * A long-running resource action. + * + * @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 data model of Download URL for assessment report. + */ + DownloadUrl downloadUrl(Object body); + + /** + * A long-running resource action. + * + * @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 data model of Download URL for assessment report. + */ + DownloadUrl downloadUrl(Object body, Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3ListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3ListResult.java new file mode 100644 index 000000000000..c421d28913dc --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3ListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.WebAppAssessmentV3Inner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a WebAppAssessmentV3 list operation. + */ +@Fluent +public final class WebAppAssessmentV3ListResult implements JsonSerializable { + /* + * The WebAppAssessmentV3 items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of WebAppAssessmentV3ListResult class. + */ + public WebAppAssessmentV3ListResult() { + } + + /** + * Get the value property: The WebAppAssessmentV3 items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The WebAppAssessmentV3 items on this page. + * + * @param value the value value to set. + * @return the WebAppAssessmentV3ListResult object itself. + */ + public WebAppAssessmentV3ListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the WebAppAssessmentV3ListResult object itself. + */ + public WebAppAssessmentV3ListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 WebAppAssessmentV3ListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebAppAssessmentV3ListResult.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 WebAppAssessmentV3ListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppAssessmentV3ListResult 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 WebAppAssessmentV3ListResult. + */ + public static WebAppAssessmentV3ListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppAssessmentV3ListResult deserializedWebAppAssessmentV3ListResult = new WebAppAssessmentV3ListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> WebAppAssessmentV3Inner.fromJson(reader1)); + deserializedWebAppAssessmentV3ListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWebAppAssessmentV3ListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppAssessmentV3ListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3Operations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3Operations.java new file mode 100644 index 000000000000..f8933f43e115 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3Operations.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 WebAppAssessmentV3Operations. + */ +public interface WebAppAssessmentV3Operations { + /** + * List WebAppAssessmentV3 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 WebAppAssessmentV3 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List WebAppAssessmentV3 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 WebAppAssessmentV3 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + Context context); + + /** + * Get a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3. + */ + WebAppAssessmentV3 get(String resourceGroupName, String projectName, String assessmentName); + + /** + * Delete a WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report. + */ + DownloadUrl downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 data model of Download URL for assessment report. + */ + DownloadUrl downloadUrl(String resourceGroupName, String projectName, String assessmentName, Object body, + Context context); + + /** + * Get a WebAppAssessmentV3. + * + * @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 WebAppAssessmentV3 along with {@link Response}. + */ + WebAppAssessmentV3 getById(String id); + + /** + * Get a WebAppAssessmentV3. + * + * @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 WebAppAssessmentV3 along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a WebAppAssessmentV3. + * + * @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 WebAppAssessmentV3. + * + * @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 WebAppAssessmentV3 resource. + * + * @param name resource name. + * @return the first stage of the new WebAppAssessmentV3 definition. + */ + WebAppAssessmentV3.DefinitionStages.Blank define(String name); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3Properties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3Properties.java new file mode 100644 index 000000000000..7c0a4bd97226 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3Properties.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * WebApp assessment resource properties. + */ +@Fluent +public final class WebAppAssessmentV3Properties 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 WebAppAssessmentSettings settings; + + /* + * Gets or sets the details of the assessment. + */ + private AssessmentDetails details; + + /* + * Gets or sets the machine assessment ARM ID for VM fallback. + */ + private String fallbackMachineAssessmentArmId; + + /** + * Creates an instance of WebAppAssessmentV3Properties class. + */ + public WebAppAssessmentV3Properties() { + } + + /** + * 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 WebAppAssessmentV3Properties object itself. + */ + public WebAppAssessmentV3Properties 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 WebAppAssessmentSettings 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 WebAppAssessmentV3Properties object itself. + */ + public WebAppAssessmentV3Properties withSettings(WebAppAssessmentSettings 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 WebAppAssessmentV3Properties object itself. + */ + public WebAppAssessmentV3Properties withDetails(AssessmentDetails details) { + this.details = details; + return this; + } + + /** + * Get the fallbackMachineAssessmentArmId property: Gets or sets the machine assessment ARM ID for VM fallback. + * + * @return the fallbackMachineAssessmentArmId value. + */ + public String fallbackMachineAssessmentArmId() { + return this.fallbackMachineAssessmentArmId; + } + + /** + * Set the fallbackMachineAssessmentArmId property: Gets or sets the machine assessment ARM ID for VM fallback. + * + * @param fallbackMachineAssessmentArmId the fallbackMachineAssessmentArmId value to set. + * @return the WebAppAssessmentV3Properties object itself. + */ + public WebAppAssessmentV3Properties withFallbackMachineAssessmentArmId(String fallbackMachineAssessmentArmId) { + this.fallbackMachineAssessmentArmId = fallbackMachineAssessmentArmId; + 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); + jsonWriter.writeStringField("fallbackMachineAssessmentArmId", this.fallbackMachineAssessmentArmId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebAppAssessmentV3Properties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppAssessmentV3Properties 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 WebAppAssessmentV3Properties. + */ + public static WebAppAssessmentV3Properties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppAssessmentV3Properties deserializedWebAppAssessmentV3Properties = new WebAppAssessmentV3Properties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedWebAppAssessmentV3Properties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("scope".equals(fieldName)) { + deserializedWebAppAssessmentV3Properties.scope = Scope.fromJson(reader); + } else if ("settings".equals(fieldName)) { + deserializedWebAppAssessmentV3Properties.settings = WebAppAssessmentSettings.fromJson(reader); + } else if ("details".equals(fieldName)) { + deserializedWebAppAssessmentV3Properties.details = AssessmentDetails.fromJson(reader); + } else if ("fallbackMachineAssessmentArmId".equals(fieldName)) { + deserializedWebAppAssessmentV3Properties.fallbackMachineAssessmentArmId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppAssessmentV3Properties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3Summary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3Summary.java new file mode 100644 index 000000000000..e92357fc6dce --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3Summary.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppAssessmentV3SummaryInner; + +/** + * An immutable client-side representation of WebAppAssessmentV3Summary. + */ +public interface WebAppAssessmentV3Summary { + /** + * 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. + */ + WebAppSummaryProperties 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.migration.assessment.fluent.models.WebAppAssessmentV3SummaryInner + * object. + * + * @return the inner object. + */ + WebAppAssessmentV3SummaryInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3SummaryListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3SummaryListResult.java new file mode 100644 index 000000000000..e0cb93cf0d9d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3SummaryListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.WebAppAssessmentV3SummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a WebAppAssessmentV3Summary list operation. + */ +@Fluent +public final class WebAppAssessmentV3SummaryListResult + implements JsonSerializable { + /* + * The WebAppAssessmentV3Summary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of WebAppAssessmentV3SummaryListResult class. + */ + public WebAppAssessmentV3SummaryListResult() { + } + + /** + * Get the value property: The WebAppAssessmentV3Summary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The WebAppAssessmentV3Summary items on this page. + * + * @param value the value value to set. + * @return the WebAppAssessmentV3SummaryListResult object itself. + */ + public WebAppAssessmentV3SummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the WebAppAssessmentV3SummaryListResult object itself. + */ + public WebAppAssessmentV3SummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 WebAppAssessmentV3SummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebAppAssessmentV3SummaryListResult.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 WebAppAssessmentV3SummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppAssessmentV3SummaryListResult 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 WebAppAssessmentV3SummaryListResult. + */ + public static WebAppAssessmentV3SummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppAssessmentV3SummaryListResult deserializedWebAppAssessmentV3SummaryListResult + = new WebAppAssessmentV3SummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> WebAppAssessmentV3SummaryInner.fromJson(reader1)); + deserializedWebAppAssessmentV3SummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWebAppAssessmentV3SummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppAssessmentV3SummaryListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3SummaryOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3SummaryOperations.java new file mode 100644 index 000000000000..764c99db64e4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppAssessmentV3SummaryOperations.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 WebAppAssessmentV3SummaryOperations. + */ +public interface WebAppAssessmentV3SummaryOperations { + /** + * List WebAppAssessmentV3Summary resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3Summary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List WebAppAssessmentV3Summary resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppAssessmentV3Summary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a WebAppAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param summaryName Gets the Name of the WebApp assessment 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 WebAppAssessmentV3Summary along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String summaryName, Context context); + + /** + * Get a WebAppAssessmentV3Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param summaryName Gets the Name of the WebApp assessment 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 WebAppAssessmentV3Summary. + */ + WebAppAssessmentV3Summary get(String resourceGroupName, String projectName, String assessmentName, + String summaryName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCollector.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCollector.java new file mode 100644 index 000000000000..78981e6c6934 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCollector.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppCollectorInner; + +/** + * An immutable client-side representation of WebAppCollector. + */ +public interface WebAppCollector { + /** + * 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. + */ + CollectorPropertiesBaseWithAgent 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.migration.assessment.fluent.models.WebAppCollectorInner object. + * + * @return the inner object. + */ + WebAppCollectorInner innerModel(); + + /** + * The entirety of the WebAppCollector definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The WebAppCollector definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the WebAppCollector definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the WebAppCollector 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 WebAppCollector 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. + */ + WebAppCollector create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WebAppCollector create(Context context); + } + + /** + * The stage of the WebAppCollector 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(CollectorPropertiesBaseWithAgent properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WebAppCollector refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WebAppCollector refresh(Context context); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCollectorListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCollectorListResult.java new file mode 100644 index 000000000000..246baf338703 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCollectorListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.WebAppCollectorInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a WebAppCollector list operation. + */ +@Fluent +public final class WebAppCollectorListResult implements JsonSerializable { + /* + * The WebAppCollector items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of WebAppCollectorListResult class. + */ + public WebAppCollectorListResult() { + } + + /** + * Get the value property: The WebAppCollector items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The WebAppCollector items on this page. + * + * @param value the value value to set. + * @return the WebAppCollectorListResult object itself. + */ + public WebAppCollectorListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the WebAppCollectorListResult object itself. + */ + public WebAppCollectorListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 WebAppCollectorListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebAppCollectorListResult.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 WebAppCollectorListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppCollectorListResult 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 WebAppCollectorListResult. + */ + public static WebAppCollectorListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppCollectorListResult deserializedWebAppCollectorListResult = new WebAppCollectorListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> WebAppCollectorInner.fromJson(reader1)); + deserializedWebAppCollectorListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWebAppCollectorListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppCollectorListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCollectorOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCollectorOperations.java new file mode 100644 index 000000000000..5827b4716b41 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCollectorOperations.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 WebAppCollectorOperations. + */ +public interface WebAppCollectorOperations { + /** + * List WebAppCollector 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 WebAppCollector list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List WebAppCollector 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 WebAppCollector list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Get a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 WebAppCollector along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String collectorName, + Context context); + + /** + * Get a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 WebAppCollector. + */ + WebAppCollector get(String resourceGroupName, String projectName, String collectorName); + + /** + * Delete a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 collectorName, + Context context); + + /** + * Delete a WebAppCollector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param collectorName Web app collector 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 collectorName); + + /** + * Get a WebAppCollector. + * + * @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 WebAppCollector along with {@link Response}. + */ + WebAppCollector getById(String id); + + /** + * Get a WebAppCollector. + * + * @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 WebAppCollector along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a WebAppCollector. + * + * @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 WebAppCollector. + * + * @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 WebAppCollector resource. + * + * @param name resource name. + * @return the first stage of the new WebAppCollector definition. + */ + WebAppCollector.DefinitionStages.Blank define(String name); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCompoundAssessmentSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCompoundAssessmentSummary.java new file mode 100644 index 000000000000..2f3647c8b26b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCompoundAssessmentSummary.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppCompoundAssessmentSummaryInner; + +/** + * An immutable client-side representation of WebAppCompoundAssessmentSummary. + */ +public interface WebAppCompoundAssessmentSummary { + /** + * 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. + */ + WebAppCompoundAssessmentSummaryProperties 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.migration.assessment.fluent.models.WebAppCompoundAssessmentSummaryInner + * object. + * + * @return the inner object. + */ + WebAppCompoundAssessmentSummaryInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCompoundAssessmentSummaryListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCompoundAssessmentSummaryListResult.java new file mode 100644 index 000000000000..bd57026b2b75 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCompoundAssessmentSummaryListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.WebAppCompoundAssessmentSummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a WebAppCompoundAssessmentSummary list operation. + */ +@Fluent +public final class WebAppCompoundAssessmentSummaryListResult + implements JsonSerializable { + /* + * The WebAppCompoundAssessmentSummary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of WebAppCompoundAssessmentSummaryListResult class. + */ + public WebAppCompoundAssessmentSummaryListResult() { + } + + /** + * Get the value property: The WebAppCompoundAssessmentSummary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The WebAppCompoundAssessmentSummary items on this page. + * + * @param value the value value to set. + * @return the WebAppCompoundAssessmentSummaryListResult object itself. + */ + public WebAppCompoundAssessmentSummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the WebAppCompoundAssessmentSummaryListResult object itself. + */ + public WebAppCompoundAssessmentSummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 WebAppCompoundAssessmentSummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebAppCompoundAssessmentSummaryListResult.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 WebAppCompoundAssessmentSummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppCompoundAssessmentSummaryListResult 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 WebAppCompoundAssessmentSummaryListResult. + */ + public static WebAppCompoundAssessmentSummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppCompoundAssessmentSummaryListResult deserializedWebAppCompoundAssessmentSummaryListResult + = new WebAppCompoundAssessmentSummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> WebAppCompoundAssessmentSummaryInner.fromJson(reader1)); + deserializedWebAppCompoundAssessmentSummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWebAppCompoundAssessmentSummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppCompoundAssessmentSummaryListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCompoundAssessmentSummaryProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCompoundAssessmentSummaryProperties.java new file mode 100644 index 000000000000..38a867507cf8 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppCompoundAssessmentSummaryProperties.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * WebApp compound assessment summary properties class. + */ +@Fluent +public final class WebAppCompoundAssessmentSummaryProperties + 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; + + /* + * Name of the assessment. + */ + private String assessmentName; + + /* + * Light summary of the compound assessment. + */ + private DiscoveredLightSummary discoveredLightSummary; + + /** + * Creates an instance of WebAppCompoundAssessmentSummaryProperties class. + */ + public WebAppCompoundAssessmentSummaryProperties() { + } + + /** + * 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; + } + + /** + * Get the assessmentName property: Name of the assessment. + * + * @return the assessmentName value. + */ + public String assessmentName() { + return this.assessmentName; + } + + /** + * Set the assessmentName property: Name of the assessment. + * + * @param assessmentName the assessmentName value to set. + * @return the WebAppCompoundAssessmentSummaryProperties object itself. + */ + public WebAppCompoundAssessmentSummaryProperties withAssessmentName(String assessmentName) { + this.assessmentName = assessmentName; + return this; + } + + /** + * Get the discoveredLightSummary property: Light summary of the compound assessment. + * + * @return the discoveredLightSummary value. + */ + public DiscoveredLightSummary discoveredLightSummary() { + return this.discoveredLightSummary; + } + + /** + * Set the discoveredLightSummary property: Light summary of the compound assessment. + * + * @param discoveredLightSummary the discoveredLightSummary value to set. + * @return the WebAppCompoundAssessmentSummaryProperties object itself. + */ + public WebAppCompoundAssessmentSummaryProperties + withDiscoveredLightSummary(DiscoveredLightSummary discoveredLightSummary) { + this.discoveredLightSummary = discoveredLightSummary; + return this; + } + + /** + * 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()); + } + if (discoveredLightSummary() != null) { + discoveredLightSummary().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("assessmentName", this.assessmentName); + jsonWriter.writeJsonField("discoveredLightSummary", this.discoveredLightSummary); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebAppCompoundAssessmentSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppCompoundAssessmentSummaryProperties 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 WebAppCompoundAssessmentSummaryProperties. + */ + public static WebAppCompoundAssessmentSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppCompoundAssessmentSummaryProperties deserializedWebAppCompoundAssessmentSummaryProperties + = new WebAppCompoundAssessmentSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("summaryType".equals(fieldName)) { + deserializedWebAppCompoundAssessmentSummaryProperties.summaryType + = SummaryType.fromString(reader.getString()); + } else if ("summaryName".equals(fieldName)) { + deserializedWebAppCompoundAssessmentSummaryProperties.summaryName = reader.getString(); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> SourceDetails.fromJson(reader1)); + deserializedWebAppCompoundAssessmentSummaryProperties.sources = sources; + } else if ("targets".equals(fieldName)) { + List targets = reader.readArray(reader1 -> TargetDetails.fromJson(reader1)); + deserializedWebAppCompoundAssessmentSummaryProperties.targets = targets; + } else if ("targetSourceMapping".equals(fieldName)) { + List targetSourceMapping + = reader.readArray(reader1 -> TargetSourcePair.fromJson(reader1)); + deserializedWebAppCompoundAssessmentSummaryProperties.targetSourceMapping = targetSourceMapping; + } else if ("costComponents".equals(fieldName)) { + List costComponents + = reader.readArray(reader1 -> CostDetailsCommon.fromJson(reader1)); + deserializedWebAppCompoundAssessmentSummaryProperties.costComponents = costComponents; + } else if ("savingsComponents".equals(fieldName)) { + List savingsComponents + = reader.readArray(reader1 -> SavingsDetailsCommon.fromJson(reader1)); + deserializedWebAppCompoundAssessmentSummaryProperties.savingsComponents = savingsComponents; + } else if ("assessmentName".equals(fieldName)) { + deserializedWebAppCompoundAssessmentSummaryProperties.assessmentName = reader.getString(); + } else if ("discoveredLightSummary".equals(fieldName)) { + deserializedWebAppCompoundAssessmentSummaryProperties.discoveredLightSummary + = DiscoveredLightSummary.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppCompoundAssessmentSummaryProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppDistribution.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppDistribution.java new file mode 100644 index 000000000000..cdc77ad37451 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppDistribution.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 app type distribution. + */ +@Immutable +public final class WebAppDistribution implements JsonSerializable { + /* + * WebApp type. + */ + private WebAppTypes webAppType; + + /* + * The cost details. + */ + private Float numberOfWebApps; + + /** + * Creates an instance of WebAppDistribution class. + */ + public WebAppDistribution() { + } + + /** + * Get the webAppType property: WebApp type. + * + * @return the webAppType value. + */ + public WebAppTypes webAppType() { + return this.webAppType; + } + + /** + * Get the numberOfWebApps property: The cost details. + * + * @return the numberOfWebApps value. + */ + public Float numberOfWebApps() { + return this.numberOfWebApps; + } + + /** + * 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 WebAppDistribution from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppDistribution 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 WebAppDistribution. + */ + public static WebAppDistribution fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppDistribution deserializedWebAppDistribution = new WebAppDistribution(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("webAppType".equals(fieldName)) { + deserializedWebAppDistribution.webAppType = WebAppTypes.fromString(reader.getString()); + } else if ("numberOfWebApps".equals(fieldName)) { + deserializedWebAppDistribution.numberOfWebApps = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppDistribution; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppGraphAssessmentOptionsOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppGraphAssessmentOptionsOperations.java new file mode 100644 index 000000000000..cd5707295d1e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppGraphAssessmentOptionsOperations.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 WebAppGraphAssessmentOptionsOperations. + */ +public interface WebAppGraphAssessmentOptionsOperations { + /** + * List WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List WepAppGraphAssessmentOptions 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 WepAppGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + Context context); + + /** + * Get a WepAppGraphAssessmentOptions. + * + * @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 WepAppGraphAssessmentOptions along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, + Context context); + + /** + * Get a WepAppGraphAssessmentOptions. + * + * @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 WepAppGraphAssessmentOptions. + */ + WepAppGraphAssessmentOptions get(String resourceGroupName, String projectName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppServicePlanV3.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppServicePlanV3.java new file mode 100644 index 000000000000..304b7dd95c81 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppServicePlanV3.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.WebAppServicePlanV3Inner; + +/** + * An immutable client-side representation of WebAppServicePlanV3. + */ +public interface WebAppServicePlanV3 { + /** + * 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. + */ + WebAppServicePlanV3Properties 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.migration.assessment.fluent.models.WebAppServicePlanV3Inner object. + * + * @return the inner object. + */ + WebAppServicePlanV3Inner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppServicePlanV3ListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppServicePlanV3ListResult.java new file mode 100644 index 000000000000..2d323dec24db --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppServicePlanV3ListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.WebAppServicePlanV3Inner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a WebAppServicePlanV3 list operation. + */ +@Fluent +public final class WebAppServicePlanV3ListResult implements JsonSerializable { + /* + * The WebAppServicePlanV3 items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of WebAppServicePlanV3ListResult class. + */ + public WebAppServicePlanV3ListResult() { + } + + /** + * Get the value property: The WebAppServicePlanV3 items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The WebAppServicePlanV3 items on this page. + * + * @param value the value value to set. + * @return the WebAppServicePlanV3ListResult object itself. + */ + public WebAppServicePlanV3ListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the WebAppServicePlanV3ListResult object itself. + */ + public WebAppServicePlanV3ListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 WebAppServicePlanV3ListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebAppServicePlanV3ListResult.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 WebAppServicePlanV3ListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppServicePlanV3ListResult 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 WebAppServicePlanV3ListResult. + */ + public static WebAppServicePlanV3ListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppServicePlanV3ListResult deserializedWebAppServicePlanV3ListResult + = new WebAppServicePlanV3ListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> WebAppServicePlanV3Inner.fromJson(reader1)); + deserializedWebAppServicePlanV3ListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWebAppServicePlanV3ListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppServicePlanV3ListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppServicePlanV3Properties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppServicePlanV3Properties.java new file mode 100644 index 000000000000..58decacfd572 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppServicePlanV3Properties.java @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * WebApp assessment service plan properties class. + */ +@Immutable +public final class WebAppServicePlanV3Properties implements JsonSerializable { + /* + * Target type of the webapp. + */ + private WebAppTargetType webAppTargetType; + + /* + * Type of webapp. + */ + private WebServerType webAppType; + + /* + * Webapp service plan name. + */ + private String webAppServicePlanName; + + /* + * Number of web apps. + */ + private int numberOfWebApps; + + /* + * Monthly cost of the web app service plan. + */ + private double monthlyCost; + + /* + * Storage used by the web app service plan. + */ + private double storage; + + /* + * Number of scale-out instances. + */ + private int scaleOutInstances; + + /* + * Number of cores. + */ + private int cores; + + /* + * Amount of RAM. + */ + private double ram; + + /* + * SKU name of the web app. + */ + private String webAppSkuName; + + /* + * SKU size of the web app. + */ + private String webAppSkuSize; + + /* + * Timestamp when the web app service plan was created. + */ + private OffsetDateTime createdTimestamp; + + /* + * Timestamp when the web app service plan was last updated. + */ + private OffsetDateTime updatedTimestamp; + + /* + * Cost components of the web app service plan. + */ + private List costComponents; + + /** + * Creates an instance of WebAppServicePlanV3Properties class. + */ + public WebAppServicePlanV3Properties() { + } + + /** + * Get the webAppTargetType property: Target type of the webapp. + * + * @return the webAppTargetType value. + */ + public WebAppTargetType webAppTargetType() { + return this.webAppTargetType; + } + + /** + * Get the webAppType property: Type of webapp. + * + * @return the webAppType value. + */ + public WebServerType webAppType() { + return this.webAppType; + } + + /** + * Get the webAppServicePlanName property: Webapp service plan name. + * + * @return the webAppServicePlanName value. + */ + public String webAppServicePlanName() { + return this.webAppServicePlanName; + } + + /** + * Get the numberOfWebApps property: Number of web apps. + * + * @return the numberOfWebApps value. + */ + public int numberOfWebApps() { + return this.numberOfWebApps; + } + + /** + * Get the monthlyCost property: Monthly cost of the web app service plan. + * + * @return the monthlyCost value. + */ + public double monthlyCost() { + return this.monthlyCost; + } + + /** + * Get the storage property: Storage used by the web app service plan. + * + * @return the storage value. + */ + public double storage() { + return this.storage; + } + + /** + * Get the scaleOutInstances property: Number of scale-out instances. + * + * @return the scaleOutInstances value. + */ + public int scaleOutInstances() { + return this.scaleOutInstances; + } + + /** + * Get the cores property: Number of cores. + * + * @return the cores value. + */ + public int cores() { + return this.cores; + } + + /** + * Get the ram property: Amount of RAM. + * + * @return the ram value. + */ + public double ram() { + return this.ram; + } + + /** + * Get the webAppSkuName property: SKU name of the web app. + * + * @return the webAppSkuName value. + */ + public String webAppSkuName() { + return this.webAppSkuName; + } + + /** + * Get the webAppSkuSize property: SKU size of the web app. + * + * @return the webAppSkuSize value. + */ + public String webAppSkuSize() { + return this.webAppSkuSize; + } + + /** + * Get the createdTimestamp property: Timestamp when the web app service plan was created. + * + * @return the createdTimestamp value. + */ + public OffsetDateTime createdTimestamp() { + return this.createdTimestamp; + } + + /** + * Get the updatedTimestamp property: Timestamp when the web app service plan was last updated. + * + * @return the updatedTimestamp value. + */ + public OffsetDateTime updatedTimestamp() { + return this.updatedTimestamp; + } + + /** + * Get the costComponents property: Cost components of the web app service plan. + * + * @return the costComponents value. + */ + public List costComponents() { + return this.costComponents; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (costComponents() != null) { + costComponents().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebAppServicePlanV3Properties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppServicePlanV3Properties 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 WebAppServicePlanV3Properties. + */ + public static WebAppServicePlanV3Properties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppServicePlanV3Properties deserializedWebAppServicePlanV3Properties + = new WebAppServicePlanV3Properties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("webAppTargetType".equals(fieldName)) { + deserializedWebAppServicePlanV3Properties.webAppTargetType + = WebAppTargetType.fromString(reader.getString()); + } else if ("webAppType".equals(fieldName)) { + deserializedWebAppServicePlanV3Properties.webAppType = WebServerType.fromString(reader.getString()); + } else if ("webAppServicePlanName".equals(fieldName)) { + deserializedWebAppServicePlanV3Properties.webAppServicePlanName = reader.getString(); + } else if ("numberOfWebApps".equals(fieldName)) { + deserializedWebAppServicePlanV3Properties.numberOfWebApps = reader.getInt(); + } else if ("monthlyCost".equals(fieldName)) { + deserializedWebAppServicePlanV3Properties.monthlyCost = reader.getDouble(); + } else if ("storage".equals(fieldName)) { + deserializedWebAppServicePlanV3Properties.storage = reader.getDouble(); + } else if ("scaleOutInstances".equals(fieldName)) { + deserializedWebAppServicePlanV3Properties.scaleOutInstances = reader.getInt(); + } else if ("cores".equals(fieldName)) { + deserializedWebAppServicePlanV3Properties.cores = reader.getInt(); + } else if ("ram".equals(fieldName)) { + deserializedWebAppServicePlanV3Properties.ram = reader.getDouble(); + } else if ("webAppSkuName".equals(fieldName)) { + deserializedWebAppServicePlanV3Properties.webAppSkuName = reader.getString(); + } else if ("webAppSkuSize".equals(fieldName)) { + deserializedWebAppServicePlanV3Properties.webAppSkuSize = reader.getString(); + } else if ("createdTimestamp".equals(fieldName)) { + deserializedWebAppServicePlanV3Properties.createdTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedTimestamp".equals(fieldName)) { + deserializedWebAppServicePlanV3Properties.updatedTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("costComponents".equals(fieldName)) { + List costComponents = reader.readArray(reader1 -> CostComponent.fromJson(reader1)); + deserializedWebAppServicePlanV3Properties.costComponents = costComponents; + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppServicePlanV3Properties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppServicePlansOperations.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppServicePlansOperations.java new file mode 100644 index 000000000000..d2c9c80d1c70 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppServicePlansOperations.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 WebAppServicePlansOperations. + */ +public interface WebAppServicePlansOperations { + /** + * List WebAppServicePlanV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppServicePlanV3 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List WebAppServicePlanV3 resources by WebAppAssessmentV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment 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 WebAppServicePlanV3 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName, + Context context); + + /** + * Get a WebAppServicePlanV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param servicePlanName Gets the Name of the WebApp assessment service plan. + * @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 WebAppServicePlanV3 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + String servicePlanName, Context context); + + /** + * Get a WebAppServicePlanV3. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName WebApp Assessment ARM name. + * @param servicePlanName Gets the Name of the WebApp assessment service plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 WebAppServicePlanV3. + */ + WebAppServicePlanV3 get(String resourceGroupName, String projectName, String assessmentName, + String servicePlanName); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppSummaryProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppSummaryProperties.java new file mode 100644 index 000000000000..978e14c50fda --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppSummaryProperties.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * WebApp assessment summary resource properties. + */ +@Immutable +public final class WebAppSummaryProperties 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; + + /* + * Light summary of the discovered entity. + */ + private DiscoveredEntityLightSummary discoveredEntityLightSummary; + + /** + * Creates an instance of WebAppSummaryProperties class. + */ + public WebAppSummaryProperties() { + } + + /** + * 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; + } + + /** + * Get the discoveredEntityLightSummary property: Light summary of the discovered entity. + * + * @return the discoveredEntityLightSummary value. + */ + public DiscoveredEntityLightSummary discoveredEntityLightSummary() { + return this.discoveredEntityLightSummary; + } + + /** + * 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()); + } + if (discoveredEntityLightSummary() != null) { + discoveredEntityLightSummary().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebAppSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppSummaryProperties 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 WebAppSummaryProperties. + */ + public static WebAppSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppSummaryProperties deserializedWebAppSummaryProperties = new WebAppSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("summaryType".equals(fieldName)) { + deserializedWebAppSummaryProperties.summaryType = SummaryType.fromString(reader.getString()); + } else if ("summaryName".equals(fieldName)) { + deserializedWebAppSummaryProperties.summaryName = reader.getString(); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> SourceDetails.fromJson(reader1)); + deserializedWebAppSummaryProperties.sources = sources; + } else if ("targets".equals(fieldName)) { + List targets = reader.readArray(reader1 -> TargetDetails.fromJson(reader1)); + deserializedWebAppSummaryProperties.targets = targets; + } else if ("targetSourceMapping".equals(fieldName)) { + List targetSourceMapping + = reader.readArray(reader1 -> TargetSourcePair.fromJson(reader1)); + deserializedWebAppSummaryProperties.targetSourceMapping = targetSourceMapping; + } else if ("costComponents".equals(fieldName)) { + List costComponents + = reader.readArray(reader1 -> CostDetailsCommon.fromJson(reader1)); + deserializedWebAppSummaryProperties.costComponents = costComponents; + } else if ("savingsComponents".equals(fieldName)) { + List savingsComponents + = reader.readArray(reader1 -> SavingsDetailsCommon.fromJson(reader1)); + deserializedWebAppSummaryProperties.savingsComponents = savingsComponents; + } else if ("discoveredEntityLightSummary".equals(fieldName)) { + deserializedWebAppSummaryProperties.discoveredEntityLightSummary + = DiscoveredEntityLightSummary.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppSummaryProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppTargetSku.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppTargetSku.java new file mode 100644 index 000000000000..c2b153a4a161 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppTargetSku.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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 Webapp target SKU with corresponding cost. + */ +@Immutable +public final class WebAppTargetSku implements JsonSerializable { + /* + * The SKU name. + */ + private String skuName; + + /* + * The cost details. + */ + private Float cost; + + /* + * The number of service plans or node pools recommended. + */ + private Integer count; + + /** + * Creates an instance of WebAppTargetSku class. + */ + public WebAppTargetSku() { + } + + /** + * Get the skuName property: The SKU name. + * + * @return the skuName value. + */ + public String skuName() { + return this.skuName; + } + + /** + * Get the cost property: The cost details. + * + * @return the cost value. + */ + public Float cost() { + return this.cost; + } + + /** + * Get the count property: The number of service plans or node pools recommended. + * + * @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 WebAppTargetSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppTargetSku 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 WebAppTargetSku. + */ + public static WebAppTargetSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppTargetSku deserializedWebAppTargetSku = new WebAppTargetSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("skuName".equals(fieldName)) { + deserializedWebAppTargetSku.skuName = reader.getString(); + } else if ("cost".equals(fieldName)) { + deserializedWebAppTargetSku.cost = reader.getNullable(JsonReader::getFloat); + } else if ("count".equals(fieldName)) { + deserializedWebAppTargetSku.count = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppTargetSku; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppTargetType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppTargetType.java new file mode 100644 index 000000000000..960befbe8a98 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppTargetType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Web App Target type. + */ +public final class WebAppTargetType extends ExpandableStringEnum { + /** + * Static value Unknown for WebAppTargetType. + */ + public static final WebAppTargetType UNKNOWN = fromString("Unknown"); + + /** + * Static value AzureAppService for WebAppTargetType. + */ + public static final WebAppTargetType AZURE_APP_SERVICE = fromString("AzureAppService"); + + /** + * Static value AzureAppServiceContainer for WebAppTargetType. + */ + public static final WebAppTargetType AZURE_APP_SERVICE_CONTAINER = fromString("AzureAppServiceContainer"); + + /** + * Creates a new instance of WebAppTargetType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebAppTargetType() { + } + + /** + * Creates or finds a WebAppTargetType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebAppTargetType. + */ + public static WebAppTargetType fromString(String name) { + return fromString(name, WebAppTargetType.class); + } + + /** + * Gets known WebAppTargetType values. + * + * @return known WebAppTargetType values. + */ + public static Collection values() { + return values(WebAppTargetType.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppType.java new file mode 100644 index 000000000000..552f199804e3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Web App Type. + */ +public final class WebAppType extends ExpandableStringEnum { + /** + * Static value Unknown for WebAppType. + */ + public static final WebAppType UNKNOWN = fromString("Unknown"); + + /** + * Static value ASP.Net for WebAppType. + */ + public static final WebAppType ASP_NET = fromString("ASP.Net"); + + /** + * Static value Java for WebAppType. + */ + public static final WebAppType JAVA = fromString("Java"); + + /** + * Creates a new instance of WebAppType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebAppType() { + } + + /** + * Creates or finds a WebAppType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebAppType. + */ + public static WebAppType fromString(String name) { + return fromString(name, WebAppType.class); + } + + /** + * Gets known WebAppType values. + * + * @return known WebAppType values. + */ + public static Collection values() { + return values(WebAppType.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppTypes.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppTypes.java new file mode 100644 index 000000000000..f74a9bdb680d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppTypes.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Business case supported WebApp types. + */ +public final class WebAppTypes extends ExpandableStringEnum { + /** + * Static value Unknown for WebAppTypes. + */ + public static final WebAppTypes UNKNOWN = fromString("Unknown"); + + /** + * Static value ASPNET for WebAppTypes. + */ + public static final WebAppTypes ASPNET = fromString("ASPNET"); + + /** + * Static value Java for WebAppTypes. + */ + public static final WebAppTypes JAVA = fromString("Java"); + + /** + * Creates a new instance of WebAppTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebAppTypes() { + } + + /** + * Creates or finds a WebAppTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebAppTypes. + */ + public static WebAppTypes fromString(String name) { + return fromString(name, WebAppTypes.class); + } + + /** + * Gets known WebAppTypes values. + * + * @return known WebAppTypes values. + */ + public static Collection values() { + return values(WebAppTypes.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppsPerType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppsPerType.java new file mode 100644 index 000000000000..cb6e8d45acc5 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebAppsPerType.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Number of web apps per type. + */ +@Fluent +public final class WebAppsPerType implements JsonSerializable { + /* + * Name of the web app type. + */ + private WebAppType webAppType; + + /* + * Count of the web app type. + */ + private int count; + + /** + * Creates an instance of WebAppsPerType class. + */ + public WebAppsPerType() { + } + + /** + * Get the webAppType property: Name of the web app type. + * + * @return the webAppType value. + */ + public WebAppType webAppType() { + return this.webAppType; + } + + /** + * Set the webAppType property: Name of the web app type. + * + * @param webAppType the webAppType value to set. + * @return the WebAppsPerType object itself. + */ + public WebAppsPerType withWebAppType(WebAppType webAppType) { + this.webAppType = webAppType; + return this; + } + + /** + * Get the count property: Count of the web app type. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Set the count property: Count of the web app type. + * + * @param count the count value to set. + * @return the WebAppsPerType object itself. + */ + public WebAppsPerType withCount(int count) { + this.count = count; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (webAppType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property webAppType in model WebAppsPerType")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebAppsPerType.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("webAppType", this.webAppType == null ? null : this.webAppType.toString()); + jsonWriter.writeIntField("count", this.count); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebAppsPerType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebAppsPerType 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 WebAppsPerType. + */ + public static WebAppsPerType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebAppsPerType deserializedWebAppsPerType = new WebAppsPerType(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("webAppType".equals(fieldName)) { + deserializedWebAppsPerType.webAppType = WebAppType.fromString(reader.getString()); + } else if ("count".equals(fieldName)) { + deserializedWebAppsPerType.count = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedWebAppsPerType; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebServerType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebServerType.java new file mode 100644 index 000000000000..d1096c039e61 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebServerType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Web Server Type. + */ +public final class WebServerType extends ExpandableStringEnum { + /** + * Static value Unknown for WebServerType. + */ + public static final WebServerType UNKNOWN = fromString("Unknown"); + + /** + * Static value IIS for WebServerType. + */ + public static final WebServerType IIS = fromString("IIS"); + + /** + * Static value Tomcat for WebServerType. + */ + public static final WebServerType TOMCAT = fromString("Tomcat"); + + /** + * Creates a new instance of WebServerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebServerType() { + } + + /** + * Creates or finds a WebServerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebServerType. + */ + public static WebServerType fromString(String name) { + return fromString(name, WebServerType.class); + } + + /** + * Gets known WebServerType values. + * + * @return known WebServerType values. + */ + public static Collection values() { + return values(WebServerType.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebServersPerType.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebServersPerType.java new file mode 100644 index 000000000000..8e8e862ca68d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WebServersPerType.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Number of web servers per type. + */ +@Fluent +public final class WebServersPerType implements JsonSerializable { + /* + * Name of the web app type. + */ + private WebServerType webServerType; + + /* + * Count of the web app type. + */ + private int count; + + /** + * Creates an instance of WebServersPerType class. + */ + public WebServersPerType() { + } + + /** + * Get the webServerType property: Name of the web app type. + * + * @return the webServerType value. + */ + public WebServerType webServerType() { + return this.webServerType; + } + + /** + * Set the webServerType property: Name of the web app type. + * + * @param webServerType the webServerType value to set. + * @return the WebServersPerType object itself. + */ + public WebServersPerType withWebServerType(WebServerType webServerType) { + this.webServerType = webServerType; + return this; + } + + /** + * Get the count property: Count of the web app type. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Set the count property: Count of the web app type. + * + * @param count the count value to set. + * @return the WebServersPerType object itself. + */ + public WebServersPerType withCount(int count) { + this.count = count; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (webServerType() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property webServerType in model WebServersPerType")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebServersPerType.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("webServerType", this.webServerType == null ? null : this.webServerType.toString()); + jsonWriter.writeIntField("count", this.count); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebServersPerType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebServersPerType 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 WebServersPerType. + */ + public static WebServersPerType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebServersPerType deserializedWebServersPerType = new WebServersPerType(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("webServerType".equals(fieldName)) { + deserializedWebServersPerType.webServerType = WebServerType.fromString(reader.getString()); + } else if ("count".equals(fieldName)) { + deserializedWebServersPerType.count = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedWebServersPerType; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WepAppAssessmentOptionsOutboundEdgeGroup.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WepAppAssessmentOptionsOutboundEdgeGroup.java new file mode 100644 index 000000000000..4f3df113547b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WepAppAssessmentOptionsOutboundEdgeGroup.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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. + */ +@Fluent +public final class WepAppAssessmentOptionsOutboundEdgeGroup + 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 WepApp Tier. + */ + private List webAppTier; + + /** + * Creates an instance of WepAppAssessmentOptionsOutboundEdgeGroup class. + */ + public WepAppAssessmentOptionsOutboundEdgeGroup() { + } + + /** + * Get the targetLocations property: Gets or sets the Azure Locations. + * + * @return the targetLocations value. + */ + public List targetLocations() { + return this.targetLocations; + } + + /** + * Set the targetLocations property: Gets or sets the Azure Locations. + * + * @param targetLocations the targetLocations value to set. + * @return the WepAppAssessmentOptionsOutboundEdgeGroup object itself. + */ + public WepAppAssessmentOptionsOutboundEdgeGroup withTargetLocations(List targetLocations) { + this.targetLocations = targetLocations; + return this; + } + + /** + * Get the currencies property: Gets or sets the Azure Currency. + * + * @return the currencies value. + */ + public List currencies() { + return this.currencies; + } + + /** + * Set the currencies property: Gets or sets the Azure Currency. + * + * @param currencies the currencies value to set. + * @return the WepAppAssessmentOptionsOutboundEdgeGroup object itself. + */ + public WepAppAssessmentOptionsOutboundEdgeGroup withCurrencies(List currencies) { + this.currencies = currencies; + return this; + } + + /** + * Get the savingsOptions property: Gets or sets the Assessment Savings Options. + * + * @return the savingsOptions value. + */ + public List savingsOptions() { + return this.savingsOptions; + } + + /** + * Set the savingsOptions property: Gets or sets the Assessment Savings Options. + * + * @param savingsOptions the savingsOptions value to set. + * @return the WepAppAssessmentOptionsOutboundEdgeGroup object itself. + */ + public WepAppAssessmentOptionsOutboundEdgeGroup withSavingsOptions(List savingsOptions) { + this.savingsOptions = savingsOptions; + return this; + } + + /** + * Get the licensingProgram property: Gets or sets the Licensing Program. + * + * @return the licensingProgram value. + */ + public List licensingProgram() { + return this.licensingProgram; + } + + /** + * Set the licensingProgram property: Gets or sets the Licensing Program. + * + * @param licensingProgram the licensingProgram value to set. + * @return the WepAppAssessmentOptionsOutboundEdgeGroup object itself. + */ + public WepAppAssessmentOptionsOutboundEdgeGroup withLicensingProgram(List licensingProgram) { + this.licensingProgram = licensingProgram; + return this; + } + + /** + * Get the webAppTier property: Gets or sets the Azure WepApp Tier. + * + * @return the webAppTier value. + */ + public List webAppTier() { + return this.webAppTier; + } + + /** + * Set the webAppTier property: Gets or sets the Azure WepApp Tier. + * + * @param webAppTier the webAppTier value to set. + * @return the WepAppAssessmentOptionsOutboundEdgeGroup object itself. + */ + public WepAppAssessmentOptionsOutboundEdgeGroup withWebAppTier(List webAppTier) { + this.webAppTier = webAppTier; + return this; + } + + /** + * 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 WepAppAssessmentOptionsOutboundEdgeGroup")); + } + if (currencies() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property currencies in model WepAppAssessmentOptionsOutboundEdgeGroup")); + } + if (savingsOptions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property savingsOptions in model WepAppAssessmentOptionsOutboundEdgeGroup")); + } + if (licensingProgram() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property licensingProgram in model WepAppAssessmentOptionsOutboundEdgeGroup")); + } + if (webAppTier() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property webAppTier in model WepAppAssessmentOptionsOutboundEdgeGroup")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WepAppAssessmentOptionsOutboundEdgeGroup.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("webAppTier", this.webAppTier, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WepAppAssessmentOptionsOutboundEdgeGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WepAppAssessmentOptionsOutboundEdgeGroup 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 WepAppAssessmentOptionsOutboundEdgeGroup. + */ + public static WepAppAssessmentOptionsOutboundEdgeGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WepAppAssessmentOptionsOutboundEdgeGroup deserializedWepAppAssessmentOptionsOutboundEdgeGroup + = new WepAppAssessmentOptionsOutboundEdgeGroup(); + 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())); + deserializedWepAppAssessmentOptionsOutboundEdgeGroup.targetLocations = targetLocations; + } else if ("currencies".equals(fieldName)) { + List currencies + = reader.readArray(reader1 -> AzureCurrency.fromString(reader1.getString())); + deserializedWepAppAssessmentOptionsOutboundEdgeGroup.currencies = currencies; + } else if ("savingsOptions".equals(fieldName)) { + List savingsOptions + = reader.readArray(reader1 -> SavingsOptions.fromString(reader1.getString())); + deserializedWepAppAssessmentOptionsOutboundEdgeGroup.savingsOptions = savingsOptions; + } else if ("licensingProgram".equals(fieldName)) { + List licensingProgram + = reader.readArray(reader1 -> LicensingProgram.fromString(reader1.getString())); + deserializedWepAppAssessmentOptionsOutboundEdgeGroup.licensingProgram = licensingProgram; + } else if ("webAppTier".equals(fieldName)) { + List webAppTier + = reader.readArray(reader1 -> AzureWebAppTier.fromString(reader1.getString())); + deserializedWepAppAssessmentOptionsOutboundEdgeGroup.webAppTier = webAppTier; + } else { + reader.skipChildren(); + } + } + + return deserializedWepAppAssessmentOptionsOutboundEdgeGroup; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WepAppGraphAssessmentOptions.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WepAppGraphAssessmentOptions.java new file mode 100644 index 000000000000..fc12d89944c8 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WepAppGraphAssessmentOptions.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migration.assessment.fluent.models.WepAppGraphAssessmentOptionsInner; + +/** + * An immutable client-side representation of WepAppGraphAssessmentOptions. + */ +public interface WepAppGraphAssessmentOptions { + /** + * 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. + */ + WepAppGraphAssessmentOptionsProperties 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.migration.assessment.fluent.models.WepAppGraphAssessmentOptionsInner + * object. + * + * @return the inner object. + */ + WepAppGraphAssessmentOptionsInner innerModel(); +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WepAppGraphAssessmentOptionsListResult.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WepAppGraphAssessmentOptionsListResult.java new file mode 100644 index 000000000000..9798cfc29b88 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WepAppGraphAssessmentOptionsListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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.migration.assessment.fluent.models.WepAppGraphAssessmentOptionsInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a WepAppGraphAssessmentOptions list operation. + */ +@Fluent +public final class WepAppGraphAssessmentOptionsListResult + implements JsonSerializable { + /* + * The WepAppGraphAssessmentOptions items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of WepAppGraphAssessmentOptionsListResult class. + */ + public WepAppGraphAssessmentOptionsListResult() { + } + + /** + * Get the value property: The WepAppGraphAssessmentOptions items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The WepAppGraphAssessmentOptions items on this page. + * + * @param value the value value to set. + * @return the WepAppGraphAssessmentOptionsListResult object itself. + */ + public WepAppGraphAssessmentOptionsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the WepAppGraphAssessmentOptionsListResult object itself. + */ + public WepAppGraphAssessmentOptionsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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 WepAppGraphAssessmentOptionsListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WepAppGraphAssessmentOptionsListResult.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 WepAppGraphAssessmentOptionsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WepAppGraphAssessmentOptionsListResult 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 WepAppGraphAssessmentOptionsListResult. + */ + public static WepAppGraphAssessmentOptionsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WepAppGraphAssessmentOptionsListResult deserializedWepAppGraphAssessmentOptionsListResult + = new WepAppGraphAssessmentOptionsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> WepAppGraphAssessmentOptionsInner.fromJson(reader1)); + deserializedWepAppGraphAssessmentOptionsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWepAppGraphAssessmentOptionsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWepAppGraphAssessmentOptionsListResult; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WepAppGraphAssessmentOptionsProperties.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WepAppGraphAssessmentOptionsProperties.java new file mode 100644 index 000000000000..1e225e83d80f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WepAppGraphAssessmentOptionsProperties.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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. + */ +@Fluent +public final class WepAppGraphAssessmentOptionsProperties + implements JsonSerializable { + /* + * Gets or sets the edges. + */ + private Map edges; + + /** + * Creates an instance of WepAppGraphAssessmentOptionsProperties class. + */ + public WepAppGraphAssessmentOptionsProperties() { + } + + /** + * Get the edges property: Gets or sets the edges. + * + * @return the edges value. + */ + public Map edges() { + return this.edges; + } + + /** + * Set the edges property: Gets or sets the edges. + * + * @param edges the edges value to set. + * @return the WepAppGraphAssessmentOptionsProperties object itself. + */ + public WepAppGraphAssessmentOptionsProperties + withEdges(Map edges) { + this.edges = edges; + return this; + } + + /** + * 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 WepAppGraphAssessmentOptionsProperties")); + } else { + edges().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WepAppGraphAssessmentOptionsProperties.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 WepAppGraphAssessmentOptionsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WepAppGraphAssessmentOptionsProperties 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 WepAppGraphAssessmentOptionsProperties. + */ + public static WepAppGraphAssessmentOptionsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WepAppGraphAssessmentOptionsProperties deserializedWepAppGraphAssessmentOptionsProperties + = new WepAppGraphAssessmentOptionsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("edges".equals(fieldName)) { + Map edges + = reader.readMap(reader1 -> WepAppAssessmentOptionsOutboundEdgeGroup.fromJson(reader1)); + deserializedWepAppGraphAssessmentOptionsProperties.edges = edges; + } else { + reader.skipChildren(); + } + } + + return deserializedWepAppGraphAssessmentOptionsProperties; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WindowsServerLicensingSettings.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WindowsServerLicensingSettings.java new file mode 100644 index 000000000000..7b306362c1ee --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WindowsServerLicensingSettings.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Windows Server licensing settings. + */ +@Fluent +public final class WindowsServerLicensingSettings implements JsonSerializable { + /* + * Licence Cost. + */ + private float licenseCost; + + /* + * Software assurance (SA) cost. + */ + private float softwareAssuranceCost; + + /* + * Licenses per core. + */ + private int licensesPerCore; + + /** + * Creates an instance of WindowsServerLicensingSettings class. + */ + public WindowsServerLicensingSettings() { + } + + /** + * Get the licenseCost property: Licence Cost. + * + * @return the licenseCost value. + */ + public float licenseCost() { + return this.licenseCost; + } + + /** + * Set the licenseCost property: Licence Cost. + * + * @param licenseCost the licenseCost value to set. + * @return the WindowsServerLicensingSettings object itself. + */ + public WindowsServerLicensingSettings withLicenseCost(float licenseCost) { + this.licenseCost = licenseCost; + return this; + } + + /** + * Get the softwareAssuranceCost property: Software assurance (SA) cost. + * + * @return the softwareAssuranceCost value. + */ + public float softwareAssuranceCost() { + return this.softwareAssuranceCost; + } + + /** + * Set the softwareAssuranceCost property: Software assurance (SA) cost. + * + * @param softwareAssuranceCost the softwareAssuranceCost value to set. + * @return the WindowsServerLicensingSettings object itself. + */ + public WindowsServerLicensingSettings withSoftwareAssuranceCost(float softwareAssuranceCost) { + this.softwareAssuranceCost = softwareAssuranceCost; + return this; + } + + /** + * Get the licensesPerCore property: Licenses per core. + * + * @return the licensesPerCore value. + */ + public int licensesPerCore() { + return this.licensesPerCore; + } + + /** + * Set the licensesPerCore property: Licenses per core. + * + * @param licensesPerCore the licensesPerCore value to set. + * @return the WindowsServerLicensingSettings object itself. + */ + public WindowsServerLicensingSettings withLicensesPerCore(int licensesPerCore) { + this.licensesPerCore = licensesPerCore; + 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.writeFloatField("licenseCost", this.licenseCost); + jsonWriter.writeFloatField("softwareAssuranceCost", this.softwareAssuranceCost); + jsonWriter.writeIntField("licensesPerCore", this.licensesPerCore); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WindowsServerLicensingSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WindowsServerLicensingSettings 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 WindowsServerLicensingSettings. + */ + public static WindowsServerLicensingSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WindowsServerLicensingSettings deserializedWindowsServerLicensingSettings + = new WindowsServerLicensingSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("licenseCost".equals(fieldName)) { + deserializedWindowsServerLicensingSettings.licenseCost = reader.getFloat(); + } else if ("softwareAssuranceCost".equals(fieldName)) { + deserializedWindowsServerLicensingSettings.softwareAssuranceCost = reader.getFloat(); + } else if ("licensesPerCore".equals(fieldName)) { + deserializedWindowsServerLicensingSettings.licensesPerCore = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedWindowsServerLicensingSettings; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WorkloadSummary.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WorkloadSummary.java deleted file mode 100644 index 62d1d1ab0e07..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/WorkloadSummary.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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; - -/** - * Workload summary. - */ -@Fluent -public final class WorkloadSummary implements JsonSerializable { - /* - * Gets or sets oracle databases. - */ - private Integer oracleInstances; - - /* - * Gets or sets oracle databases. - */ - private Integer springApps; - - /** - * Creates an instance of WorkloadSummary class. - */ - public WorkloadSummary() { - } - - /** - * Get the oracleInstances property: Gets or sets oracle databases. - * - * @return the oracleInstances value. - */ - public Integer oracleInstances() { - return this.oracleInstances; - } - - /** - * Set the oracleInstances property: Gets or sets oracle databases. - * - * @param oracleInstances the oracleInstances value to set. - * @return the WorkloadSummary object itself. - */ - public WorkloadSummary withOracleInstances(Integer oracleInstances) { - this.oracleInstances = oracleInstances; - return this; - } - - /** - * Get the springApps property: Gets or sets oracle databases. - * - * @return the springApps value. - */ - public Integer springApps() { - return this.springApps; - } - - /** - * Set the springApps property: Gets or sets oracle databases. - * - * @param springApps the springApps value to set. - * @return the WorkloadSummary object itself. - */ - public WorkloadSummary withSpringApps(Integer springApps) { - this.springApps = springApps; - 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("oracleInstances", this.oracleInstances); - jsonWriter.writeNumberField("springApps", this.springApps); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WorkloadSummary from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkloadSummary 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 WorkloadSummary. - */ - public static WorkloadSummary fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkloadSummary deserializedWorkloadSummary = new WorkloadSummary(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("oracleInstances".equals(fieldName)) { - deserializedWorkloadSummary.oracleInstances = reader.getNullable(JsonReader::getInt); - } else if ("springApps".equals(fieldName)) { - deserializedWorkloadSummary.springApps = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedWorkloadSummary; - }); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Year.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Year.java new file mode 100644 index 000000000000..ea95def462fa --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/Year.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Year values. + */ +public final class Year extends ExpandableStringEnum { + /** + * Static value Year0 for Year. + */ + public static final Year YEAR0 = fromString("Year0"); + + /** + * Static value Year1 for Year. + */ + public static final Year YEAR1 = fromString("Year1"); + + /** + * Static value Year2 for Year. + */ + public static final Year YEAR2 = fromString("Year2"); + + /** + * Static value Year3 for Year. + */ + public static final Year YEAR3 = fromString("Year3"); + + /** + * Creates a new instance of Year value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Year() { + } + + /** + * Creates or finds a Year from its string representation. + * + * @param name a name to look for. + * @return the corresponding Year. + */ + public static Year fromString(String name) { + return fromString(name, Year.class); + } + + /** + * Gets known Year values. + * + * @return known Year values. + */ + public static Collection values() { + return values(Year.class); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/YearOnYearCost.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/YearOnYearCost.java new file mode 100644 index 000000000000..6b86e69b03b3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/YearOnYearCost.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Year on Year cost. + */ +@Fluent +public final class YearOnYearCost implements JsonSerializable { + /* + * Year value. + */ + private Year year; + + /* + * Cost for the specified year. + */ + private Float cost; + + /** + * Creates an instance of YearOnYearCost class. + */ + public YearOnYearCost() { + } + + /** + * Get the year property: Year value. + * + * @return the year value. + */ + public Year year() { + return this.year; + } + + /** + * Set the year property: Year value. + * + * @param year the year value to set. + * @return the YearOnYearCost object itself. + */ + public YearOnYearCost withYear(Year year) { + this.year = year; + return this; + } + + /** + * Get the cost property: Cost for the specified year. + * + * @return the cost value. + */ + public Float cost() { + return this.cost; + } + + /** + * Set the cost property: Cost for the specified year. + * + * @param cost the cost value to set. + * @return the YearOnYearCost object itself. + */ + public YearOnYearCost withCost(Float cost) { + this.cost = cost; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (year() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property year in model YearOnYearCost")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(YearOnYearCost.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("year", this.year == null ? null : this.year.toString()); + jsonWriter.writeNumberField("cost", this.cost); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of YearOnYearCost from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of YearOnYearCost 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 YearOnYearCost. + */ + public static YearOnYearCost fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + YearOnYearCost deserializedYearOnYearCost = new YearOnYearCost(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("year".equals(fieldName)) { + deserializedYearOnYearCost.year = Year.fromString(reader.getString()); + } else if ("cost".equals(fieldName)) { + deserializedYearOnYearCost.cost = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedYearOnYearCost; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/YearOnYearEmissions.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/YearOnYearEmissions.java new file mode 100644 index 000000000000..cf4eccb9d736 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/YearOnYearEmissions.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Year on Year Emissions. + */ +@Fluent +public final class YearOnYearEmissions implements JsonSerializable { + /* + * Year value. + */ + private Year year; + + /* + * Emissions for the specified year. + */ + private Float emissions; + + /** + * Creates an instance of YearOnYearEmissions class. + */ + public YearOnYearEmissions() { + } + + /** + * Get the year property: Year value. + * + * @return the year value. + */ + public Year year() { + return this.year; + } + + /** + * Set the year property: Year value. + * + * @param year the year value to set. + * @return the YearOnYearEmissions object itself. + */ + public YearOnYearEmissions withYear(Year year) { + this.year = year; + return this; + } + + /** + * Get the emissions property: Emissions for the specified year. + * + * @return the emissions value. + */ + public Float emissions() { + return this.emissions; + } + + /** + * Set the emissions property: Emissions for the specified year. + * + * @param emissions the emissions value to set. + * @return the YearOnYearEmissions object itself. + */ + public YearOnYearEmissions withEmissions(Float emissions) { + this.emissions = emissions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (year() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property year in model YearOnYearEmissions")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(YearOnYearEmissions.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("year", this.year == null ? null : this.year.toString()); + jsonWriter.writeNumberField("emissions", this.emissions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of YearOnYearEmissions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of YearOnYearEmissions 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 YearOnYearEmissions. + */ + public static YearOnYearEmissions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + YearOnYearEmissions deserializedYearOnYearEmissions = new YearOnYearEmissions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("year".equals(fieldName)) { + deserializedYearOnYearEmissions.year = Year.fromString(reader.getString()); + } else if ("emissions".equals(fieldName)) { + deserializedYearOnYearEmissions.emissions = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedYearOnYearEmissions; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/YearOnYearEstimates.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/YearOnYearEstimates.java new file mode 100644 index 000000000000..34a61dd5018d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/java/com/azure/resourcemanager/migration/assessment/models/YearOnYearEstimates.java @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.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; + +/** + * Shows the year-on-year cost overall. + */ +@Immutable +public final class YearOnYearEstimates implements JsonSerializable { + /* + * Year-on-Year on-premises cost. + */ + private List onPremisesCost; + + /* + * Year-on-Year Azure cost. + */ + private List azureCost; + + /* + * Year-on-Year savings. + */ + private List savings; + + /* + * Year-on-Year on-premises capex cost. + */ + private List onPremisesCapexCost; + + /* + * Year-on-Year on-premises opex cost. + */ + private List onPremisesOpexCost; + + /* + * Year-on-Year azure capex cost. + */ + private List azureCapexCost; + + /* + * Year-on-Year azure opex cost. + */ + private List azureOpexCost; + + /* + * Payback period. + */ + private Integer paybackPeriod; + + /* + * Year-on-Year azure arc enabled on-premises cost. + */ + private List azureArcEnabledOnPremisesCost; + + /* + * Year-on-Year azure with arc enabled on-premises cost. + */ + private List futureCost; + + /* + * Year-on-Year azure arc enabled on-premises esu cost of the remaining infra on-premises. + */ + private List futureAzureArcEnabledOnPremisesEsuCost; + + /* + * Year-on-Year on-premises esu cost of the remaining infra on-premises. + */ + private List futureOnPremisesEsuCost; + + /* + * Year-on-Year on-premises emissions estimates. + */ + private List onPremisesEmissionsEstimates; + + /* + * Year-on-Year Azure emissions estimates. + */ + private List azureEmissionsEstimates; + + /** + * Creates an instance of YearOnYearEstimates class. + */ + public YearOnYearEstimates() { + } + + /** + * Get the onPremisesCost property: Year-on-Year on-premises cost. + * + * @return the onPremisesCost value. + */ + public List onPremisesCost() { + return this.onPremisesCost; + } + + /** + * Get the azureCost property: Year-on-Year Azure cost. + * + * @return the azureCost value. + */ + public List azureCost() { + return this.azureCost; + } + + /** + * Get the savings property: Year-on-Year savings. + * + * @return the savings value. + */ + public List savings() { + return this.savings; + } + + /** + * Get the onPremisesCapexCost property: Year-on-Year on-premises capex cost. + * + * @return the onPremisesCapexCost value. + */ + public List onPremisesCapexCost() { + return this.onPremisesCapexCost; + } + + /** + * Get the onPremisesOpexCost property: Year-on-Year on-premises opex cost. + * + * @return the onPremisesOpexCost value. + */ + public List onPremisesOpexCost() { + return this.onPremisesOpexCost; + } + + /** + * Get the azureCapexCost property: Year-on-Year azure capex cost. + * + * @return the azureCapexCost value. + */ + public List azureCapexCost() { + return this.azureCapexCost; + } + + /** + * Get the azureOpexCost property: Year-on-Year azure opex cost. + * + * @return the azureOpexCost value. + */ + public List azureOpexCost() { + return this.azureOpexCost; + } + + /** + * Get the paybackPeriod property: Payback period. + * + * @return the paybackPeriod value. + */ + public Integer paybackPeriod() { + return this.paybackPeriod; + } + + /** + * Get the azureArcEnabledOnPremisesCost property: Year-on-Year azure arc enabled on-premises cost. + * + * @return the azureArcEnabledOnPremisesCost value. + */ + public List azureArcEnabledOnPremisesCost() { + return this.azureArcEnabledOnPremisesCost; + } + + /** + * Get the futureCost property: Year-on-Year azure with arc enabled on-premises cost. + * + * @return the futureCost value. + */ + public List futureCost() { + return this.futureCost; + } + + /** + * Get the futureAzureArcEnabledOnPremisesEsuCost property: Year-on-Year azure arc enabled on-premises esu cost of + * the remaining infra on-premises. + * + * @return the futureAzureArcEnabledOnPremisesEsuCost value. + */ + public List futureAzureArcEnabledOnPremisesEsuCost() { + return this.futureAzureArcEnabledOnPremisesEsuCost; + } + + /** + * Get the futureOnPremisesEsuCost property: Year-on-Year on-premises esu cost of the remaining infra on-premises. + * + * @return the futureOnPremisesEsuCost value. + */ + public List futureOnPremisesEsuCost() { + return this.futureOnPremisesEsuCost; + } + + /** + * Get the onPremisesEmissionsEstimates property: Year-on-Year on-premises emissions estimates. + * + * @return the onPremisesEmissionsEstimates value. + */ + public List onPremisesEmissionsEstimates() { + return this.onPremisesEmissionsEstimates; + } + + /** + * Get the azureEmissionsEstimates property: Year-on-Year Azure emissions estimates. + * + * @return the azureEmissionsEstimates value. + */ + public List azureEmissionsEstimates() { + return this.azureEmissionsEstimates; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (onPremisesCost() != null) { + onPremisesCost().forEach(e -> e.validate()); + } + if (azureCost() != null) { + azureCost().forEach(e -> e.validate()); + } + if (savings() != null) { + savings().forEach(e -> e.validate()); + } + if (onPremisesCapexCost() != null) { + onPremisesCapexCost().forEach(e -> e.validate()); + } + if (onPremisesOpexCost() != null) { + onPremisesOpexCost().forEach(e -> e.validate()); + } + if (azureCapexCost() != null) { + azureCapexCost().forEach(e -> e.validate()); + } + if (azureOpexCost() != null) { + azureOpexCost().forEach(e -> e.validate()); + } + if (azureArcEnabledOnPremisesCost() != null) { + azureArcEnabledOnPremisesCost().forEach(e -> e.validate()); + } + if (futureCost() != null) { + futureCost().forEach(e -> e.validate()); + } + if (futureAzureArcEnabledOnPremisesEsuCost() != null) { + futureAzureArcEnabledOnPremisesEsuCost().forEach(e -> e.validate()); + } + if (futureOnPremisesEsuCost() != null) { + futureOnPremisesEsuCost().forEach(e -> e.validate()); + } + if (onPremisesEmissionsEstimates() != null) { + onPremisesEmissionsEstimates().forEach(e -> e.validate()); + } + if (azureEmissionsEstimates() != null) { + azureEmissionsEstimates().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of YearOnYearEstimates from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of YearOnYearEstimates 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 YearOnYearEstimates. + */ + public static YearOnYearEstimates fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + YearOnYearEstimates deserializedYearOnYearEstimates = new YearOnYearEstimates(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("onPremisesCost".equals(fieldName)) { + List onPremisesCost = reader.readArray(reader1 -> YearOnYearCost.fromJson(reader1)); + deserializedYearOnYearEstimates.onPremisesCost = onPremisesCost; + } else if ("azureCost".equals(fieldName)) { + List azureCost = reader.readArray(reader1 -> YearOnYearCost.fromJson(reader1)); + deserializedYearOnYearEstimates.azureCost = azureCost; + } else if ("savings".equals(fieldName)) { + List savings = reader.readArray(reader1 -> YearOnYearCost.fromJson(reader1)); + deserializedYearOnYearEstimates.savings = savings; + } else if ("onPremisesCapexCost".equals(fieldName)) { + List onPremisesCapexCost + = reader.readArray(reader1 -> YearOnYearCost.fromJson(reader1)); + deserializedYearOnYearEstimates.onPremisesCapexCost = onPremisesCapexCost; + } else if ("onPremisesOpexCost".equals(fieldName)) { + List onPremisesOpexCost + = reader.readArray(reader1 -> YearOnYearCost.fromJson(reader1)); + deserializedYearOnYearEstimates.onPremisesOpexCost = onPremisesOpexCost; + } else if ("azureCapexCost".equals(fieldName)) { + List azureCapexCost = reader.readArray(reader1 -> YearOnYearCost.fromJson(reader1)); + deserializedYearOnYearEstimates.azureCapexCost = azureCapexCost; + } else if ("azureOpexCost".equals(fieldName)) { + List azureOpexCost = reader.readArray(reader1 -> YearOnYearCost.fromJson(reader1)); + deserializedYearOnYearEstimates.azureOpexCost = azureOpexCost; + } else if ("paybackPeriod".equals(fieldName)) { + deserializedYearOnYearEstimates.paybackPeriod = reader.getNullable(JsonReader::getInt); + } else if ("azureArcEnabledOnPremisesCost".equals(fieldName)) { + List azureArcEnabledOnPremisesCost + = reader.readArray(reader1 -> YearOnYearCost.fromJson(reader1)); + deserializedYearOnYearEstimates.azureArcEnabledOnPremisesCost = azureArcEnabledOnPremisesCost; + } else if ("futureCost".equals(fieldName)) { + List futureCost = reader.readArray(reader1 -> YearOnYearCost.fromJson(reader1)); + deserializedYearOnYearEstimates.futureCost = futureCost; + } else if ("futureAzureArcEnabledOnPremisesEsuCost".equals(fieldName)) { + List futureAzureArcEnabledOnPremisesEsuCost + = reader.readArray(reader1 -> YearOnYearCost.fromJson(reader1)); + deserializedYearOnYearEstimates.futureAzureArcEnabledOnPremisesEsuCost + = futureAzureArcEnabledOnPremisesEsuCost; + } else if ("futureOnPremisesEsuCost".equals(fieldName)) { + List futureOnPremisesEsuCost + = reader.readArray(reader1 -> YearOnYearCost.fromJson(reader1)); + deserializedYearOnYearEstimates.futureOnPremisesEsuCost = futureOnPremisesEsuCost; + } else if ("onPremisesEmissionsEstimates".equals(fieldName)) { + List onPremisesEmissionsEstimates + = reader.readArray(reader1 -> YearOnYearEmissions.fromJson(reader1)); + deserializedYearOnYearEstimates.onPremisesEmissionsEstimates = onPremisesEmissionsEstimates; + } else if ("azureEmissionsEstimates".equals(fieldName)) { + List azureEmissionsEstimates + = reader.readArray(reader1 -> YearOnYearEmissions.fromJson(reader1)); + deserializedYearOnYearEstimates.azureEmissionsEstimates = azureEmissionsEstimates; + } else { + reader.skipChildren(); + } + } + + return deserializedYearOnYearEstimates; + }); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migration-assessment/proxy-config.json b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migration-assessment/proxy-config.json index abc36389852e..ee28da6eb23d 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migration-assessment/proxy-config.json +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migration-assessment/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.migration.assessment.implementation.AssessedMachinesOperationsClientImpl$AssessedMachinesOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessedSqlDatabaseV2OperationsClientImpl$AssessedSqlDatabaseV2OperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessedSqlInstanceV2OperationsClientImpl$AssessedSqlInstanceV2OperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessedSqlMachinesOperationsClientImpl$AssessedSqlMachinesOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessedSqlRecommendedEntityOperationsClientImpl$AssessedSqlRecommendedEntityOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessmentOptionsOperationsClientImpl$AssessmentOptionsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessmentProjectSummaryOperationsClientImpl$AssessmentProjectSummaryOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessmentProjectsOperationsClientImpl$AssessmentProjectsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessmentsOperationsClientImpl$AssessmentsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AvsAssessedMachinesOperationsClientImpl$AvsAssessedMachinesOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AvsAssessmentOptionsOperationsClientImpl$AvsAssessmentOptionsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AvsAssessmentsOperationsClientImpl$AvsAssessmentsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.GroupsOperationsClientImpl$GroupsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.HypervCollectorsOperationsClientImpl$HypervCollectorsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.ImportCollectorsOperationsClientImpl$ImportCollectorsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.MachinesOperationsClientImpl$MachinesOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.PrivateEndpointConnectionOperationsClientImpl$PrivateEndpointConnectionOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.PrivateLinkResourceOperationsClientImpl$PrivateLinkResourceOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.ServerCollectorsOperationsClientImpl$ServerCollectorsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.SqlAssessmentOptionsOperationsClientImpl$SqlAssessmentOptionsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.SqlAssessmentV2OperationsClientImpl$SqlAssessmentV2OperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.SqlAssessmentV2SummaryOperationsClientImpl$SqlAssessmentV2SummaryOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.SqlCollectorOperationsClientImpl$SqlCollectorOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.VmwareCollectorsOperationsClientImpl$VmwareCollectorsOperationsService"]] \ No newline at end of file +[["com.azure.resourcemanager.migration.assessment.implementation.AksAssessmentOperationsClientImpl$AksAssessmentOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AksClusterOperationsClientImpl$AksClusterOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AksCostDetailOperationsClientImpl$AksCostDetailOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AksOptionsOperationsClientImpl$AksOptionsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AksSummaryOperationsClientImpl$AksSummaryOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessedMachinesV2OperationsClientImpl$AssessedMachinesV2OperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessedSqlDatabaseV3OperationsClientImpl$AssessedSqlDatabaseV3OperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessedSqlInstanceV3OperationsClientImpl$AssessedSqlInstanceV3OperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessedSqlMachinesV3OperationsClientImpl$AssessedSqlMachinesV3OperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessedWebApplicationOperationsClientImpl$AssessedWebApplicationOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessedWebAppsV3OperationsClientImpl$AssessedWebAppsV3OperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessmentProjectSummaryOperationsClientImpl$AssessmentProjectSummaryOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AssessmentProjectsOperationsClientImpl$AssessmentProjectsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AvsAssessedMachinesV2OperationsClientImpl$AvsAssessedMachinesV2OperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AvsAssessmentV2SummaryOperationsClientImpl$AvsAssessmentV2SummaryOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AvsAssessmentsV2OperationsClientImpl$AvsAssessmentsV2OperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.AvsGraphAssessmentOptionsOperationsClientImpl$AvsGraphAssessmentOptionsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.BusinessCaseAvsSummaryOperationsClientImpl$BusinessCaseAvsSummaryOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.BusinessCaseIaasSummaryOperationsClientImpl$BusinessCaseIaasSummaryOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.BusinessCaseOperationsClientImpl$BusinessCaseOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.BusinessCaseOverviewSummaryOperationsClientImpl$BusinessCaseOverviewSummaryOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.BusinessCasePaasSummaryOperationsClientImpl$BusinessCasePaasSummaryOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.CompoundAssessmentOperationsClientImpl$CompoundAssessmentOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.CompoundAssessmentSummaryOperationsClientImpl$CompoundAssessmentSummaryOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.EvaluatedAvsMachinesOperationsClientImpl$EvaluatedAvsMachinesOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.EvaluatedMachinesOperationsClientImpl$EvaluatedMachinesOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.EvaluatedSqlEntitiesOperationsClientImpl$EvaluatedSqlEntitiesOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.EvaluatedWebAppsOperationsClientImpl$EvaluatedWebAppsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.HeterogeneousAssessmentOperationsClientImpl$HeterogeneousAssessmentOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.HeterogeneousAssessmentSummaryOperationsClientImpl$HeterogeneousAssessmentSummaryOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.HypervCollectorsOperationsClientImpl$HypervCollectorsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.ImportCollectorsOperationsClientImpl$ImportCollectorsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.ImportSqlCollectorOperationsClientImpl$ImportSqlCollectorOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.MachineAssessmentV2SummaryOperationsClientImpl$MachineAssessmentV2SummaryOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.MachineAssessmentsV2OperationsClientImpl$MachineAssessmentsV2OperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.MachineGraphAssessmentOptionsOperationsClientImpl$MachineGraphAssessmentOptionsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.PrivateEndpointConnectionOperationsClientImpl$PrivateEndpointConnectionOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.PrivateLinkResourceOperationsClientImpl$PrivateLinkResourceOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.ServerCollectorsOperationsClientImpl$ServerCollectorsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.SqlAssessmentV3OperationsClientImpl$SqlAssessmentV3OperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.SqlAssessmentV3SummaryOperationsClientImpl$SqlAssessmentV3SummaryOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.SqlCollectorOperationsClientImpl$SqlCollectorOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.SqlGraphAssessmentOptionsOperationsClientImpl$SqlGraphAssessmentOptionsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.VmwareCollectorsOperationsClientImpl$VmwareCollectorsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.WebAppAssessmentV3OperationsClientImpl$WebAppAssessmentV3OperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.WebAppAssessmentV3SummaryOperationsClientImpl$WebAppAssessmentV3SummaryOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.WebAppCollectorOperationsClientImpl$WebAppCollectorOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.WebAppGraphAssessmentOptionsOperationsClientImpl$WebAppGraphAssessmentOptionsOperationsService"],["com.azure.resourcemanager.migration.assessment.implementation.WebAppServicePlansOperationsClientImpl$WebAppServicePlansOperationsService"]] \ No newline at end of file diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksAssessmentOperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksAssessmentOperationsCreateSamples.java new file mode 100644 index 000000000000..62c13315056d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksAssessmentOperationsCreateSamples.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.resourcemanager.migration.assessment.models.AksAssessmentProperties; +import com.azure.resourcemanager.migration.assessment.models.AksAssessmentSettings; +import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; +import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; +import com.azure.resourcemanager.migration.assessment.models.AzureOffer; +import com.azure.resourcemanager.migration.assessment.models.AzureVmCategory; +import com.azure.resourcemanager.migration.assessment.models.BillingSettings; +import com.azure.resourcemanager.migration.assessment.models.ConsolidationType; +import com.azure.resourcemanager.migration.assessment.models.EnvironmentType; +import com.azure.resourcemanager.migration.assessment.models.LicensingProgram; +import com.azure.resourcemanager.migration.assessment.models.Percentile; +import com.azure.resourcemanager.migration.assessment.models.PerformanceData; +import com.azure.resourcemanager.migration.assessment.models.PricingTier; +import com.azure.resourcemanager.migration.assessment.models.SavingsOptions; +import com.azure.resourcemanager.migration.assessment.models.SavingsSettings; +import com.azure.resourcemanager.migration.assessment.models.Scope; +import com.azure.resourcemanager.migration.assessment.models.ScopeType; +import com.azure.resourcemanager.migration.assessment.models.TimeRange; +import java.time.OffsetDateTime; + +/** + * Samples for AksAssessmentOperations Create. + */ +public final class AksAssessmentOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksAssessmentOperations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: AksAssessmentOperations_Create_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void aksAssessmentOperationsCreateMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.aksAssessmentOperations() + .define("testaksassessment") + .withExistingAssessmentProject("rgaksAssessments", "testProject") + .withProperties(new AksAssessmentProperties() + .withScope(new Scope().withScopeType(ScopeType.SERVER_GROUP_ID) + .withServerGroupId("this-will-be-a-valid-arm-id") + .withAzureResourceGraphQuery("zyhczkubwaqjqrmyithugmedmtdjxb")) + .withSettings(new AksAssessmentSettings().withAzureLocation("EastUS") + .withCurrency(AzureCurrency.USD) + .withScalingFactor(20.0F) + .withDiscountPercentage(14.0F) + .withSizingCriterion(AssessmentSizingCriterion.PERFORMANCE_BASED) + .withPerformanceData(new PerformanceData().withPercentile(Percentile.fromString("Unknown")) + .withTimeRange(TimeRange.DAY) + .withPerfDataStartTime(OffsetDateTime.parse("2025-02-14T07:09:09.242Z")) + .withPerfDataEndTime(OffsetDateTime.parse("2025-02-14T07:09:09.242Z"))) + .withSavingsSettings(new SavingsSettings().withSavingsOptions(SavingsOptions.NONE) + .withAzureOfferCode(AzureOffer.UNKNOWN)) + .withBillingSettings(new BillingSettings().withLicensingProgram(LicensingProgram.EA) + .withSubscriptionId("572C3D3F-425D-4AE8-A935-72631EADDE56")) + .withEnvironmentType(EnvironmentType.PRODUCTION) + .withCategory(AzureVmCategory.ALL) + .withConsolidation(ConsolidationType.FULL) + .withPricingTier(PricingTier.STANDARD))) + .create(); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksAssessmentOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksAssessmentOperationsDeleteSamples.java new file mode 100644 index 000000000000..f0b012db897b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksAssessmentOperationsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AksAssessmentOperations Delete. + */ +public final class AksAssessmentOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksAssessmentOperations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: AksAssessmentOperations_Delete_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void aksAssessmentOperationsDeleteMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.aksAssessmentOperations() + .deleteWithResponse("rgaksAssessments", "testProject", "testaksassessment", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksAssessmentOperationsDownloadUrlSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksAssessmentOperationsDownloadUrlSamples.java new file mode 100644 index 000000000000..e0aaed445372 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksAssessmentOperationsDownloadUrlSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for AksAssessmentOperations DownloadUrl. + */ +public final class AksAssessmentOperationsDownloadUrlSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksAssessmentOperations_DownloadUrl_MaximumSet_Gen.json + */ + /** + * Sample code: AksAssessmentOperations_DownloadUrl_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void aksAssessmentOperationsDownloadUrlMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { + manager.aksAssessmentOperations() + .downloadUrl("rgaksAssessments", "testProject", "testaksassessment", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksAssessmentOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksAssessmentOperationsGetSamples.java new file mode 100644 index 000000000000..b03c83537e7f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksAssessmentOperationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AksAssessmentOperations Get. + */ +public final class AksAssessmentOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksAssessmentOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AksAssessmentOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void aksAssessmentOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.aksAssessmentOperations() + .getWithResponse("rgaksAssessments", "testProject", "testaksassessment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksAssessmentOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksAssessmentOperationsListByParentSamples.java new file mode 100644 index 000000000000..1f8eb29c0387 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksAssessmentOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AksAssessmentOperations ListByParent. + */ +public final class AksAssessmentOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksAssessmentOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AksAssessmentOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void aksAssessmentOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.aksAssessmentOperations() + .listByParent("rgaksAssessments", "testProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksClusterOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksClusterOperationsGetSamples.java new file mode 100644 index 000000000000..854e1d0dae4c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksClusterOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AksClusterOperations Get. + */ +public final class AksClusterOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksClusterOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AksClusterOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void aksClusterOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.aksClusterOperations() + .getWithResponse("rgaksAssessments", "testProject", "testaksassessment", "testaksassessment-cluster", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksClusterOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksClusterOperationsListByParentSamples.java new file mode 100644 index 000000000000..0c80edb691e2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksClusterOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AksClusterOperations ListByParent. + */ +public final class AksClusterOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksClusterOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AksClusterOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void aksClusterOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.aksClusterOperations() + .listByParent("rgaksAssessments", "testProject", "testaksassessment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksCostDetailOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksCostDetailOperationsListByParentSamples.java new file mode 100644 index 000000000000..670478a2f062 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksCostDetailOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AksCostDetailOperations ListByParent. + */ +public final class AksCostDetailOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksCostDetailOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AksCostDetailOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void aksCostDetailOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.aksCostDetailOperations() + .listByParent("rgaksAssessments", "testProject", "testaksassessment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksOptionsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksOptionsOperationsGetSamples.java new file mode 100644 index 000000000000..bf726e9ee58c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksOptionsOperationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AksOptionsOperations Get. + */ +public final class AksOptionsOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksOptionsOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AksOptionsOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void aksOptionsOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.aksOptionsOperations() + .getWithResponse("rgaksAssessments", "testProject", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksOptionsOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksOptionsOperationsListByParentSamples.java new file mode 100644 index 000000000000..a462107b61c4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksOptionsOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AksOptionsOperations ListByParent. + */ +public final class AksOptionsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksOptionsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AksOptionsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void aksOptionsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.aksOptionsOperations() + .listByParent("rgaksAssessments", "testProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksSummaryOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksSummaryOperationsGetSamples.java new file mode 100644 index 000000000000..36e162c8fe0a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksSummaryOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AksSummaryOperations Get. + */ +public final class AksSummaryOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksSummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AksSummaryOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void aksSummaryOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.aksSummaryOperations() + .getWithResponse("rgaksAssessments", "testProject", "testaksassessment", "AKS", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksSummaryOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksSummaryOperationsListByParentSamples.java new file mode 100644 index 000000000000..085631cf3112 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AksSummaryOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AksSummaryOperations ListByParent. + */ +public final class AksSummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AksSummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AksSummaryOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void aksSummaryOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.aksSummaryOperations() + .listByParent("rgaksAssessments", "testProject", "testaksassessment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedMachinesOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedMachinesOperationsGetSamples.java deleted file mode 100644 index accdb6ebadec..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedMachinesOperationsGetSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessedMachinesOperations Get. - */ -public final class AssessedMachinesOperationsGetSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedMachinesOperations_Get_MaximumSet_Gen.json - */ - /** - * Sample code: AssessedMachinesOperations_Get_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessedMachinesOperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedMachinesOperations() - .getWithResponse("rgopenapi", "pavqtntysjn", "smawqdmhfngray", "qjlumxyqsitd", "oqxjeheiipjmuo", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedMachinesOperationsListByAssessmentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedMachinesOperationsListByAssessmentSamples.java deleted file mode 100644 index e6be6e870bf2..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedMachinesOperationsListByAssessmentSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessedMachinesOperations ListByAssessment. - */ -public final class AssessedMachinesOperationsListByAssessmentSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedMachinesOperations_ListByAssessment_MaximumSet_Gen.json - */ - /** - * Sample code: AssessedMachinesOperations_ListByAssessment_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessedMachinesOperationsListByAssessmentMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedMachinesOperations() - .listByAssessment("rgopenapi", "sloqixzfjk", "kjuepxerwseq", "rhzcmubwrrkhtocsibu", "sbkdovsfqldhdb", 10, - "hbyseetshbplfkjmpjhsiurqgt", 25, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedMachinesV2OperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedMachinesV2OperationsGetSamples.java new file mode 100644 index 000000000000..11042997bcfa --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedMachinesV2OperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AssessedMachinesV2Operations Get. + */ +public final class AssessedMachinesV2OperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedMachinesV2Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedMachinesV2Operations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void assessedMachinesV2OperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.assessedMachinesV2Operations() + .getWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", "machine1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedMachinesV2OperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedMachinesV2OperationsListByParentSamples.java new file mode 100644 index 000000000000..96fa56aa6d2c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedMachinesV2OperationsListByParentSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AssessedMachinesV2Operations ListByParent. + */ +public final class AssessedMachinesV2OperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedMachinesV2Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedMachinesV2Operations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void assessedMachinesV2OperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.assessedMachinesV2Operations() + .listByParent("rgmachineAssessments", "contosoProject", "assessmentName", "eabpcsewhenpdfcsjck", 13, + "lsuhpxtnundds", 28, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2OperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2OperationsGetSamples.java deleted file mode 100644 index 85f410cfa537..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2OperationsGetSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessedSqlDatabaseV2Operations Get. - */ -public final class AssessedSqlDatabaseV2OperationsGetSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlDatabaseV2Operations_Get_MaximumSet_Gen.json - */ - /** - * Sample code: AssessedSqlDatabaseV2Operations_Get_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessedSqlDatabaseV2OperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlDatabaseV2Operations() - .getWithResponse("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "858eb860-9e07-417c-91b6-bca1bffb3bf5", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2OperationsListBySqlAssessmentV2Samples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2OperationsListBySqlAssessmentV2Samples.java deleted file mode 100644 index f9add54d0304..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2OperationsListBySqlAssessmentV2Samples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessedSqlDatabaseV2Operations ListBySqlAssessmentV2. - */ -public final class AssessedSqlDatabaseV2OperationsListBySqlAssessmentV2Samples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlDatabaseV2Operations_ListBySqlAssessmentV2_MaximumSet_Gen.json - */ - /** - * Sample code: AssessedSqlDatabaseV2Operations_ListBySqlAssessmentV2_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessedSqlDatabaseV2OperationsListBySqlAssessmentV2MaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlDatabaseV2Operations() - .listBySqlAssessmentV2("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "(contains(Properties/DatabaseName,'adv130'))", 23, null, 1, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV3OperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV3OperationsGetSamples.java new file mode 100644 index 000000000000..35b7b47f86c0 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV3OperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AssessedSqlDatabaseV3Operations Get. + */ +public final class AssessedSqlDatabaseV3OperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedSqlDatabaseV3Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedSqlDatabaseV3Operations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void assessedSqlDatabaseV3OperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.assessedSqlDatabaseV3Operations() + .getWithResponse("rgsqlAssessments", "contosoProject", "assessmentName", "db1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV3OperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV3OperationsListByParentSamples.java new file mode 100644 index 000000000000..44a690e5b64d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV3OperationsListByParentSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AssessedSqlDatabaseV3Operations ListByParent. + */ +public final class AssessedSqlDatabaseV3OperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedSqlDatabaseV3Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedSqlDatabaseV3Operations_ListByParent. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void assessedSqlDatabaseV3OperationsListByParent( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.assessedSqlDatabaseV3Operations() + .listByParent("rgsqlAssessments", "contosoProject", "assessmentName", "cbywgnphlxhqdkrnzgylmumtbtbocx", 11, + "ahjkwi", 11, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV2OperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV2OperationsGetSamples.java deleted file mode 100644 index c8c0842ea66a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV2OperationsGetSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessedSqlInstanceV2Operations Get. - */ -public final class AssessedSqlInstanceV2OperationsGetSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlInstanceV2Operations_Get_MaximumSet_Gen.json - */ - /** - * Sample code: AssessedSqlInstanceV2Operations_Get_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessedSqlInstanceV2OperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlInstanceV2Operations() - .getWithResponse("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "3c6574cf-b4e1-4fdc-93db-6bbcc570dda2", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV2OperationsListBySqlAssessmentV2Samples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV2OperationsListBySqlAssessmentV2Samples.java deleted file mode 100644 index b6fd88e00f8e..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV2OperationsListBySqlAssessmentV2Samples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessedSqlInstanceV2Operations ListBySqlAssessmentV2. - */ -public final class AssessedSqlInstanceV2OperationsListBySqlAssessmentV2Samples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlInstanceV2Operations_ListBySqlAssessmentV2_MaximumSet_Gen.json - */ - /** - * Sample code: AssessedSqlInstanceV2Operations_ListBySqlAssessmentV2_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessedSqlInstanceV2OperationsListBySqlAssessmentV2MaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlInstanceV2Operations() - .listBySqlAssessmentV2("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "(contains(Properties/InstanceName,'MSSQLSERVER'))", 23, null, 1, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV3OperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV3OperationsGetSamples.java new file mode 100644 index 000000000000..4fb091b6d5b2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV3OperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AssessedSqlInstanceV3Operations Get. + */ +public final class AssessedSqlInstanceV3OperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedSqlInstanceV3Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedSqlInstanceV3Operations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void assessedSqlInstanceV3OperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.assessedSqlInstanceV3Operations() + .getWithResponse("rgsqlAssessments", "contosoProject", "assessmentName", "sql1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV3OperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV3OperationsListByParentSamples.java new file mode 100644 index 000000000000..ddd24bc7fe36 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV3OperationsListByParentSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AssessedSqlInstanceV3Operations ListByParent. + */ +public final class AssessedSqlInstanceV3OperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedSqlInstanceV3Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedSqlInstanceV3Operations_ListByParent. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void assessedSqlInstanceV3OperationsListByParent( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.assessedSqlInstanceV3Operations() + .listByParent("rgsqlAssessments", "contosoProject", "assessmentName", "tbkvgswkchdzuwegejuas", 30, + "tvblslp", 29, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesOperationsGetSamples.java deleted file mode 100644 index 462ef4f2b3cb..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesOperationsGetSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessedSqlMachinesOperations Get. - */ -public final class AssessedSqlMachinesOperationsGetSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlMachinesOperations_Get_MaximumSet_Gen.json - */ - /** - * Sample code: AssessedSqlMachinesOperations_Get_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessedSqlMachinesOperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlMachinesOperations() - .getWithResponse("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "cc64c9dc-b38e-435d-85ad-d509df5d92c6", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesOperationsListBySqlAssessmentV2Samples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesOperationsListBySqlAssessmentV2Samples.java deleted file mode 100644 index 8b6dca420d5e..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesOperationsListBySqlAssessmentV2Samples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessedSqlMachinesOperations ListBySqlAssessmentV2. - */ -public final class AssessedSqlMachinesOperationsListBySqlAssessmentV2Samples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlMachinesOperations_ListBySqlAssessmentV2_MaximumSet_Gen.json - */ - /** - * Sample code: AssessedSqlMachinesOperations_ListBySqlAssessmentV2_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessedSqlMachinesOperationsListBySqlAssessmentV2MaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlMachinesOperations() - .listBySqlAssessmentV2("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "(contains(Properties/DisplayName,'SQLHAVM17'))", 23, null, 1, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesV3OperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesV3OperationsGetSamples.java new file mode 100644 index 000000000000..7d3d0e006231 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesV3OperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AssessedSqlMachinesV3Operations Get. + */ +public final class AssessedSqlMachinesV3OperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedSqlMachinesV3Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedSqlMachinesV3Operations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void assessedSqlMachinesV3OperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.assessedSqlMachinesV3Operations() + .getWithResponse("rgsqlAssessments", "contosoProject", "assessmentName", "machine1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesV3OperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesV3OperationsListByParentSamples.java new file mode 100644 index 000000000000..5ce5433fac95 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesV3OperationsListByParentSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AssessedSqlMachinesV3Operations ListByParent. + */ +public final class AssessedSqlMachinesV3OperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedSqlMachinesV3Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedSqlMachinesV3Operations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void assessedSqlMachinesV3OperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.assessedSqlMachinesV3Operations() + .listByParent("rgsqlAssessments", "contosoProject", "assessmentName", "xzirrhfzrsgksfgxerscseqkggcess", 27, + "vzjkdmjvvkeuvm", 30, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityOperationsGetSamples.java deleted file mode 100644 index 7dc9719c1ff6..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityOperationsGetSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessedSqlRecommendedEntityOperations Get. - */ -public final class AssessedSqlRecommendedEntityOperationsGetSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlRecommendedEntityOperations_Get_MaximumSet_Gen.json - */ - /** - * Sample code: AssessedSqlRecommendedEntityOperations_Get_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessedSqlRecommendedEntityOperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlRecommendedEntityOperations() - .getWithResponse("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "cc64c9dc-b38e-435d-85ad-d509df5d92c6", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityOperationsListBySqlAssessmentV2Samples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityOperationsListBySqlAssessmentV2Samples.java deleted file mode 100644 index 1fd81e8fa19d..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityOperationsListBySqlAssessmentV2Samples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessedSqlRecommendedEntityOperations ListBySqlAssessmentV2. - */ -public final class AssessedSqlRecommendedEntityOperationsListBySqlAssessmentV2Samples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessedSqlRecommendedEntityOperations_ListBySqlAssessmentV2_MaximumSet_Gen.json - */ - /** - * Sample code: AssessedSqlRecommendedEntityOperations_ListBySqlAssessmentV2_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessedSqlRecommendedEntityOperationsListBySqlAssessmentV2MaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessedSqlRecommendedEntityOperations() - .listBySqlAssessmentV2("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - "(contains(Properties/InstanceName,'MSSQLSERVER'))", 23, null, 1, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedWebApplicationOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedWebApplicationOperationsGetSamples.java new file mode 100644 index 000000000000..0115428b7b13 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedWebApplicationOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AssessedWebApplicationOperations Get. + */ +public final class AssessedWebApplicationOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedWebApplicationOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedWebApplicationOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void assessedWebApplicationOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.assessedWebApplicationOperations() + .getWithResponse("rgaksAssessments", "testProject", "testaksassessment", "webapp", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedWebApplicationOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedWebApplicationOperationsListByParentSamples.java new file mode 100644 index 000000000000..bf719bf2fdb7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedWebApplicationOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AssessedWebApplicationOperations ListByParent. + */ +public final class AssessedWebApplicationOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedWebApplicationOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedWebApplicationOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void assessedWebApplicationOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.assessedWebApplicationOperations() + .listByParent("rgaksAssessments", "testProject", "testaksassessment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedWebAppsV3OperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedWebAppsV3OperationsGetSamples.java new file mode 100644 index 000000000000..04d1d504159e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedWebAppsV3OperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AssessedWebAppsV3Operations Get. + */ +public final class AssessedWebAppsV3OperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedWebAppsV3Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedWebAppsV3Operations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void assessedWebAppsV3OperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.assessedWebAppsV3Operations() + .getWithResponse("rgwebAppAssessments", "contosoProject", "assessmentName", "webapp1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedWebAppsV3OperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedWebAppsV3OperationsListByParentSamples.java new file mode 100644 index 000000000000..b0a966b57bec --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessedWebAppsV3OperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AssessedWebAppsV3Operations ListByParent. + */ +public final class AssessedWebAppsV3OperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessedWebAppsV3Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedWebAppsV3Operations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void assessedWebAppsV3OperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.assessedWebAppsV3Operations() + .listByParent("rgwebAppAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsOperationsGetSamples.java deleted file mode 100644 index 61647144788a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsOperationsGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessmentOptionsOperations Get. - */ -public final class AssessmentOptionsOperationsGetSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentOptionsOperations_Get_MaximumSet_Gen.json - */ - /** - * Sample code: AssessmentOptionsOperations_Get_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessmentOptionsOperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentOptionsOperations() - .getWithResponse("ayagrawrg", "app18700project", "default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsOperationsListByAssessmentProjectSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsOperationsListByAssessmentProjectSamples.java deleted file mode 100644 index 29de193eacd7..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsOperationsListByAssessmentProjectSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessmentOptionsOperations ListByAssessmentProject. - */ -public final class AssessmentOptionsOperationsListByAssessmentProjectSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentOptionsOperations_ListByAssessmentProject_MaximumSet_Gen.json - */ - /** - * Sample code: AssessmentOptionsOperations_ListByAssessmentProject_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessmentOptionsOperationsListByAssessmentProjectMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentOptionsOperations() - .listByAssessmentProject("rgmigrate", "fhodvffhuoqwbysrrqbizete", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsGetSamples.java index 4a2528a260bd..b542d83fc433 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsGetSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsGetSamples.java @@ -10,15 +10,15 @@ public final class AssessmentProjectSummaryOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * AssessmentProjectSummaryOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: AssessmentProjectSummaryOperations_Get_MaximumSet_Gen. + * Sample code: AssessmentProjectSummaryOperations_Get. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentProjectSummaryOperationsGetMaximumSetGen( + public static void assessmentProjectSummaryOperationsGet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.assessmentProjectSummaryOperations() .getWithResponse("piyushapp1", "PiyushApp15328project", "default", com.azure.core.util.Context.NONE); diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsListByAssessmentProjectSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsListByAssessmentProjectSamples.java deleted file mode 100644 index 433b783b57de..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsListByAssessmentProjectSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessmentProjectSummaryOperations ListByAssessmentProject. - */ -public final class AssessmentProjectSummaryOperationsListByAssessmentProjectSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentProjectSummaryOperations_ListByAssessmentProject_MaximumSet_Gen.json - */ - /** - * Sample code: AssessmentProjectSummaryOperations_ListByAssessmentProject_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessmentProjectSummaryOperationsListByAssessmentProjectMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentProjectSummaryOperations() - .listByAssessmentProject("piyushapp1", "PiyushApp15328project", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsListByParentSamples.java new file mode 100644 index 000000000000..3a13a12efb69 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AssessmentProjectSummaryOperations ListByParent. + */ +public final class AssessmentProjectSummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessmentProjectSummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AssessmentProjectSummaryOperations_ListByParent. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void assessmentProjectSummaryOperationsListByParent( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.assessmentProjectSummaryOperations() + .listByParent("piyushapp1", "PiyushApp15328project", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsCreateSamples.java index 402f89e5dcdc..3a000bc32228 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsCreateSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsCreateSamples.java @@ -6,7 +6,6 @@ import com.azure.resourcemanager.migration.assessment.models.ProjectProperties; import com.azure.resourcemanager.migration.assessment.models.ProjectStatus; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; import java.util.HashMap; import java.util.Map; @@ -16,24 +15,23 @@ public final class AssessmentProjectsOperationsCreateSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * AssessmentProjectsOperations_Create_MaximumSet_Gen.json */ /** - * Sample code: AssessmentProjectsOperations_Create_MaximumSet_Gen. + * Sample code: AssessmentProjectsOperations_Create. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentProjectsOperationsCreateMaximumSetGen( + public static void assessmentProjectsOperationsCreate( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.assessmentProjectsOperations() .define("sakanwar1204project") .withRegion("southeastasia") .withExistingResourceGroup("sakanwar") .withTags(mapOf("Migrate Project", "sakanwar-PE-SEA")) - .withProperties(new ProjectProperties().withProvisioningState(ProvisioningState.SUCCEEDED) - .withAssessmentSolutionId( - "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa") + .withProperties(new ProjectProperties().withAssessmentSolutionId( + "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa") .withProjectStatus(ProjectStatus.ACTIVE) .withPublicNetworkAccess("Disabled") .withCustomerStorageAccountArmId( diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsDeleteSamples.java index 20fd879ba5aa..2d671b642d84 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsDeleteSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsDeleteSamples.java @@ -10,15 +10,15 @@ public final class AssessmentProjectsOperationsDeleteSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * AssessmentProjectsOperations_Delete_MaximumSet_Gen.json */ /** - * Sample code: AssessmentProjectsOperations_Delete_MaximumSet_Gen. + * Sample code: AssessmentProjectsOperations_Delete. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentProjectsOperationsDeleteMaximumSetGen( + public static void assessmentProjectsOperationsDelete( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.assessmentProjectsOperations() .deleteByResourceGroupWithResponse("rgmigrate", "zqrsyncwahgydqvwuchkfd", com.azure.core.util.Context.NONE); diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsGetByResourceGroupSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsGetByResourceGroupSamples.java index c79cc729bed8..bcd3f53e7ae5 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsGetByResourceGroupSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsGetByResourceGroupSamples.java @@ -10,15 +10,15 @@ public final class AssessmentProjectsOperationsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * AssessmentProjectsOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: AssessmentProjectsOperations_Get_MaximumSet_Gen. + * Sample code: AssessmentProjectsOperations_Get. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentProjectsOperationsGetMaximumSetGen( + public static void assessmentProjectsOperationsGet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.assessmentProjectsOperations() .getByResourceGroupWithResponse("sakanwar", "sakanwar1204project", com.azure.core.util.Context.NONE); diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsListByResourceGroupSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsListByResourceGroupSamples.java index 4bdec57e0e44..8df00f07d88e 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsListByResourceGroupSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsListByResourceGroupSamples.java @@ -10,15 +10,15 @@ public final class AssessmentProjectsOperationsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentProjectsOperations_ListByResourceGroup_MaximumSet_Gen.json + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AssessmentProjectsOperations_ListByParent_MaximumSet_Gen.json */ /** - * Sample code: AssessmentProjectsOperations_ListByResourceGroup_MaximumSet_Gen. + * Sample code: AssessmentProjectsOperations_ListByParent. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentProjectsOperationsListByResourceGroupMaximumSetGen( + public static void assessmentProjectsOperationsListByParent( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.assessmentProjectsOperations().listByResourceGroup("sakanwar", com.azure.core.util.Context.NONE); } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsListSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsListSamples.java index 65dacec8fc24..72ac6c5c2e4a 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsListSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsListSamples.java @@ -10,15 +10,15 @@ public final class AssessmentProjectsOperationsListSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * AssessmentProjectsOperations_ListBySubscription_MaximumSet_Gen.json */ /** - * Sample code: AssessmentProjectsOperations_ListBySubscription_MaximumSet_Gen. + * Sample code: AssessmentProjectsOperations_ListBySubscription. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentProjectsOperationsListBySubscriptionMaximumSetGen( + public static void assessmentProjectsOperationsListBySubscription( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.assessmentProjectsOperations().list(com.azure.core.util.Context.NONE); } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsUpdateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsUpdateSamples.java index 186a92d476b9..2faca67b935a 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsUpdateSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsUpdateSamples.java @@ -5,9 +5,8 @@ package com.azure.resourcemanager.migration.assessment.generated; import com.azure.resourcemanager.migration.assessment.models.AssessmentProject; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectUpdateProperties; +import com.azure.resourcemanager.migration.assessment.models.ProjectProperties; import com.azure.resourcemanager.migration.assessment.models.ProjectStatus; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; import java.util.HashMap; import java.util.Map; @@ -17,28 +16,27 @@ public final class AssessmentProjectsOperationsUpdateSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * AssessmentProjectsOperations_Update_MaximumSet_Gen.json */ /** - * Sample code: AssessmentProjectsOperations_Update_MaximumSet_Gen. + * Sample code: AssessmentProjectsOperations_Update. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void assessmentProjectsOperationsUpdateMaximumSetGen( + public static void assessmentProjectsOperationsUpdate( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { AssessmentProject resource = manager.assessmentProjectsOperations() .getByResourceGroupWithResponse("sakanwar", "sakanwar1204project", com.azure.core.util.Context.NONE) .getValue(); resource.update() .withTags(mapOf("Migrate Project", "sakanwar-PE-SEA")) - .withProperties(new AssessmentProjectUpdateProperties().withAssessmentSolutionId( + .withProperties(new ProjectProperties().withAssessmentSolutionId( "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa") .withProjectStatus(ProjectStatus.ACTIVE) .withPublicNetworkAccess("Disabled") .withCustomerStorageAccountArmId( - "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa") - .withProvisioningState(ProvisioningState.SUCCEEDED)) + "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa")) .apply(); } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsCreateSamples.java deleted file mode 100644 index 950967fb5760..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsCreateSamples.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; -import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureDiskType; -import com.azure.resourcemanager.migration.assessment.models.AzureHybridUseBenefit; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.AzurePricingTier; -import com.azure.resourcemanager.migration.assessment.models.AzureReservedInstance; -import com.azure.resourcemanager.migration.assessment.models.AzureStorageRedundancy; -import com.azure.resourcemanager.migration.assessment.models.AzureVmFamily; -import com.azure.resourcemanager.migration.assessment.models.MachineAssessmentProperties; -import com.azure.resourcemanager.migration.assessment.models.Percentile; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.TimeRange; -import com.azure.resourcemanager.migration.assessment.models.VmUptime; -import java.time.OffsetDateTime; -import java.util.Arrays; - -/** - * Samples for AssessmentsOperations Create. - */ -public final class AssessmentsOperationsCreateSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentsOperations_Create_MaximumSet_Gen.json - */ - /** - * Sample code: AssessmentsOperations_Create_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessmentsOperationsCreateMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentsOperations() - .define("asm1") - .withExistingGroup("ayagrawrg", "app18700project", "kuchatur-test") - .withProperties(new MachineAssessmentProperties().withProvisioningState(ProvisioningState.SUCCEEDED) - .withEaSubscriptionId("kwsu") - .withAzurePricingTier(AzurePricingTier.STANDARD) - .withAzureStorageRedundancy(AzureStorageRedundancy.UNKNOWN) - .withReservedInstance(AzureReservedInstance.NONE) - .withAzureHybridUseBenefit(AzureHybridUseBenefit.UNKNOWN) - .withAzureDiskTypes(Arrays.asList(AzureDiskType.PREMIUM, AzureDiskType.STANDARD_SSD)) - .withAzureVmFamilies( - Arrays.asList(AzureVmFamily.D_SERIES, AzureVmFamily.LSV2_SERIES, AzureVmFamily.M_SERIES, - AzureVmFamily.MDSV2_SERIES, AzureVmFamily.MSV2_SERIES, AzureVmFamily.MV2_SERIES)) - .withVmUptime(new VmUptime().withDaysPerMonth(13).withHoursPerDay(26)) - .withAzureLocation("njxbwdtsxzhichsnk") - .withAzureOfferCode(AzureOfferCode.UNKNOWN) - .withCurrency(AzureCurrency.UNKNOWN) - .withScalingFactor(24.0F) - .withPercentile(Percentile.PERCENTILE50) - .withTimeRange(TimeRange.DAY) - .withPerfDataStartTime(OffsetDateTime.parse("2023-09-26T09:36:48.491Z")) - .withPerfDataEndTime(OffsetDateTime.parse("2023-09-26T09:36:48.491Z")) - .withDiscountPercentage(6.0F) - .withSizingCriterion(AssessmentSizingCriterion.PERFORMANCE_BASED)) - .create(); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsDeleteSamples.java deleted file mode 100644 index bbf96fea4a1c..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsDeleteSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessmentsOperations Delete. - */ -public final class AssessmentsOperationsDeleteSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentsOperations_Delete_MaximumSet_Gen.json - */ - /** - * Sample code: AssessmentsOperations_Delete_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessmentsOperationsDeleteMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentsOperations() - .deleteWithResponse("ayagrawrg", "app18700project", "kuchatur-test", "asm1", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsDownloadUrlSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsDownloadUrlSamples.java deleted file mode 100644 index 646f7f290ea0..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsDownloadUrlSamples.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; - -/** - * Samples for AssessmentsOperations DownloadUrl. - */ -public final class AssessmentsOperationsDownloadUrlSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentsOperations_DownloadUrl_MaximumSet_Gen.json - */ - /** - * Sample code: AssessmentsOperations_DownloadUrl_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessmentsOperationsDownloadUrlMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { - manager.assessmentsOperations() - .downloadUrl("ayagrawrg", "app18700project", "kuchatur-test", "asm1", - SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsGetSamples.java deleted file mode 100644 index 8f226261f0db..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessmentsOperations Get. - */ -public final class AssessmentsOperationsGetSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentsOperations_Get_MaximumSet_Gen.json - */ - /** - * Sample code: AssessmentsOperations_Get_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessmentsOperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentsOperations() - .getWithResponse("ayagrawrg", "app18700project", "kuchatur-test", "asm1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsListByGroupSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsListByGroupSamples.java deleted file mode 100644 index 24468b13434b..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsListByGroupSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AssessmentsOperations ListByGroup. - */ -public final class AssessmentsOperationsListByGroupSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AssessmentsOperations_ListByGroup_MaximumSet_Gen.json - */ - /** - * Sample code: AssessmentsOperations_ListByGroup_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void assessmentsOperationsListByGroupMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.assessmentsOperations() - .listByGroup("ayagrawrg", "app18700project", "kuchatur-test", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedMachinesOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedMachinesOperationsGetSamples.java deleted file mode 100644 index ed8c57e350c0..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedMachinesOperationsGetSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AvsAssessedMachinesOperations Get. - */ -public final class AvsAssessedMachinesOperationsGetSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessedMachinesOperations_Get_MaximumSet_Gen.json - */ - /** - * Sample code: AvsAssessedMachinesOperations_Get_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void avsAssessedMachinesOperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessedMachinesOperations() - .getWithResponse("ayagrawrg", "app18700project", "kuchatur-test", "asm2", - "b6d6fc6f-796f-4c16-96af-a6d22e0f12f7", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedMachinesOperationsListByAvsAssessmentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedMachinesOperationsListByAvsAssessmentSamples.java deleted file mode 100644 index 8432cc6130f2..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedMachinesOperationsListByAvsAssessmentSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AvsAssessedMachinesOperations ListByAvsAssessment. - */ -public final class AvsAssessedMachinesOperationsListByAvsAssessmentSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessedMachinesOperations_ListByAvsAssessment_MaximumSet_Gen.json - */ - /** - * Sample code: AvsAssessedMachinesOperations_ListByAvsAssessment_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void avsAssessedMachinesOperationsListByAvsAssessmentMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessedMachinesOperations() - .listByAvsAssessment("ayagrawrg", "app18700project", "kuchatur-test", "asm2", "ujmwhhuloficljxcjyc", 6, - "qwrjeiukbcicfrkqlqsfukfc", 19, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedMachinesV2OperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedMachinesV2OperationsGetSamples.java new file mode 100644 index 000000000000..33d0eea4b83f --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedMachinesV2OperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AvsAssessedMachinesV2Operations Get. + */ +public final class AvsAssessedMachinesV2OperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessedMachinesV2Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AvsAssessedMachinesV2Operations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void avsAssessedMachinesV2OperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.avsAssessedMachinesV2Operations() + .getWithResponse("rgavsAssessments", "contosoProject", "assessmentName", "machine1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedMachinesV2OperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedMachinesV2OperationsListByParentSamples.java new file mode 100644 index 000000000000..9dbc1f5e3f0b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedMachinesV2OperationsListByParentSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AvsAssessedMachinesV2Operations ListByParent. + */ +public final class AvsAssessedMachinesV2OperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessedMachinesV2Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AvsAssessedMachinesV2Operations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void avsAssessedMachinesV2OperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.avsAssessedMachinesV2Operations() + .listByParent("rgavsAssessments", "contosoProject", "assessmentName", "ozyotnnfedxreohjtgfqxmefn", 26, + "vhdrqptyyromhgz", 7, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsOperationsGetSamples.java deleted file mode 100644 index 1b95a32adae2..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsOperationsGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AvsAssessmentOptionsOperations Get. - */ -public final class AvsAssessmentOptionsOperationsGetSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessmentOptionsOperations_Get_MaximumSet_Gen.json - */ - /** - * Sample code: AvsAssessmentOptionsOperations_Get_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void avsAssessmentOptionsOperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessmentOptionsOperations() - .getWithResponse("ayagrawrg", "app18700project", "default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsOperationsListByAssessmentProjectSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsOperationsListByAssessmentProjectSamples.java deleted file mode 100644 index 1273d8d4b80d..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsOperationsListByAssessmentProjectSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AvsAssessmentOptionsOperations ListByAssessmentProject. - */ -public final class AvsAssessmentOptionsOperationsListByAssessmentProjectSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessmentOptionsOperations_ListByAssessmentProject_MaximumSet_Gen.json - */ - /** - * Sample code: AvsAssessmentOptionsOperations_ListByAssessmentProject_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void avsAssessmentOptionsOperationsListByAssessmentProjectMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessmentOptionsOperations() - .listByAssessmentProject("ayagrawrg", "app18700project", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentV2SummaryOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentV2SummaryOperationsGetSamples.java new file mode 100644 index 000000000000..a9045c5602e4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentV2SummaryOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AvsAssessmentV2SummaryOperations Get. + */ +public final class AvsAssessmentV2SummaryOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AvsAssessmentV2SummaryOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void avsAssessmentV2SummaryOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.avsAssessmentV2SummaryOperations() + .getWithResponse("rgavsAssessments", "contosoProject", "assessmentName", "PaaSPreferred", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentV2SummaryOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentV2SummaryOperationsListByParentSamples.java new file mode 100644 index 000000000000..b0332c3d6004 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentV2SummaryOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AvsAssessmentV2SummaryOperations ListByParent. + */ +public final class AvsAssessmentV2SummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessmentV2SummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AvsAssessmentV2SummaryOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void avsAssessmentV2SummaryOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.avsAssessmentV2SummaryOperations() + .listByParent("rgavsAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsCreateSamples.java deleted file mode 100644 index 836828ff1265..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsCreateSamples.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentProperties; -import com.azure.resourcemanager.migration.assessment.models.AzureAvsNodeType; -import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.AzureReservedInstance; -import com.azure.resourcemanager.migration.assessment.models.FttAndRaidLevel; -import com.azure.resourcemanager.migration.assessment.models.Percentile; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.TimeRange; -import java.time.OffsetDateTime; - -/** - * Samples for AvsAssessmentsOperations Create. - */ -public final class AvsAssessmentsOperationsCreateSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessmentsOperations_Create_MaximumSet_Gen.json - */ - /** - * Sample code: AvsAssessmentsOperations_Create_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void avsAssessmentsOperationsCreateMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessmentsOperations() - .define("asm2") - .withExistingGroup("ayagrawrg", "app18700project", "kuchatur-test") - .withProperties(new AvsAssessmentProperties().withProvisioningState(ProvisioningState.SUCCEEDED) - .withFailuresToTolerateAndRaidLevel(FttAndRaidLevel.FTT1RAID1) - .withVcpuOversubscription(4.0F) - .withNodeType(AzureAvsNodeType.AV36) - .withReservedInstance(AzureReservedInstance.RI3YEAR) - .withMemOvercommit(1.0F) - .withDedupeCompression(1.5F) - .withIsStretchClusterEnabled(true) - .withAzureLocation(AzureLocation.EAST_US) - .withAzureOfferCode(AzureOfferCode.MSAZR0003P) - .withCurrency(AzureCurrency.USD) - .withScalingFactor(1.0F) - .withPercentile(Percentile.PERCENTILE95) - .withTimeRange(TimeRange.DAY) - .withPerfDataStartTime(OffsetDateTime.parse("2023-09-25T13:35:56.5671462Z")) - .withPerfDataEndTime(OffsetDateTime.parse("2023-09-26T13:35:56.5671462Z")) - .withDiscountPercentage(0.0F) - .withSizingCriterion(AssessmentSizingCriterion.AS_ON_PREMISES)) - .create(); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsDeleteSamples.java deleted file mode 100644 index 5086915dae9b..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsDeleteSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AvsAssessmentsOperations Delete. - */ -public final class AvsAssessmentsOperationsDeleteSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessmentsOperations_Delete_MaximumSet_Gen.json - */ - /** - * Sample code: AvsAssessmentsOperations_Delete_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void avsAssessmentsOperationsDeleteMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessmentsOperations() - .deleteWithResponse("ayagrawrg", "app18700project", "kuchatur-test", "asm2", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsDownloadUrlSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsDownloadUrlSamples.java deleted file mode 100644 index 1f4d00c1c771..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsDownloadUrlSamples.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; - -/** - * Samples for AvsAssessmentsOperations DownloadUrl. - */ -public final class AvsAssessmentsOperationsDownloadUrlSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessmentsOperations_DownloadUrl_MaximumSet_Gen.json - */ - /** - * Sample code: AvsAssessmentsOperations_DownloadUrl_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void avsAssessmentsOperationsDownloadUrlMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { - manager.avsAssessmentsOperations() - .downloadUrl("ayagrawrg", "app18700project", "kuchatur-test", "asm2", - SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsGetSamples.java deleted file mode 100644 index 0499a4dd114d..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AvsAssessmentsOperations Get. - */ -public final class AvsAssessmentsOperationsGetSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessmentsOperations_Get_MaximumSet_Gen.json - */ - /** - * Sample code: AvsAssessmentsOperations_Get_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void avsAssessmentsOperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessmentsOperations() - .getWithResponse("ayagrawrg", "app18700project", "kuchatur-test", "asm2", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsListByGroupSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsListByGroupSamples.java deleted file mode 100644 index 9a39573d851e..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsListByGroupSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for AvsAssessmentsOperations ListByGroup. - */ -public final class AvsAssessmentsOperationsListByGroupSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * AvsAssessmentsOperations_ListByGroup_MaximumSet_Gen.json - */ - /** - * Sample code: AvsAssessmentsOperations_ListByGroup_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void avsAssessmentsOperationsListByGroupMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.avsAssessmentsOperations() - .listByGroup("ayagrawrg", "app18700project", "kuchatur-test", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsV2OperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsV2OperationsCreateSamples.java new file mode 100644 index 000000000000..20c59ade0d23 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsV2OperationsCreateSamples.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.resourcemanager.migration.assessment.models.AssessmentDetails; +import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentPropertiesV2; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentScenario; +import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentSettings; +import com.azure.resourcemanager.migration.assessment.models.AzureAvsNodeType; +import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; +import com.azure.resourcemanager.migration.assessment.models.AzureOffer; +import com.azure.resourcemanager.migration.assessment.models.BillingSettings; +import com.azure.resourcemanager.migration.assessment.models.EnvironmentType; +import com.azure.resourcemanager.migration.assessment.models.ExternalStorageType; +import com.azure.resourcemanager.migration.assessment.models.FttAndRaidLevel; +import com.azure.resourcemanager.migration.assessment.models.LicensingProgram; +import com.azure.resourcemanager.migration.assessment.models.Percentile; +import com.azure.resourcemanager.migration.assessment.models.PerformanceData; +import com.azure.resourcemanager.migration.assessment.models.SavingsOptions; +import com.azure.resourcemanager.migration.assessment.models.SavingsSettings; +import com.azure.resourcemanager.migration.assessment.models.Scope; +import com.azure.resourcemanager.migration.assessment.models.ScopeType; +import com.azure.resourcemanager.migration.assessment.models.TimeRange; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for AvsAssessmentsV2Operations Create. + */ +public final class AvsAssessmentsV2OperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessmentsV2Operations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: AvsAssessmentsV2Operations_Create_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void avsAssessmentsV2OperationsCreateMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.avsAssessmentsV2Operations() + .define("assessmentName") + .withExistingAssessmentProject("rgavsAssessments", "contosoProject") + .withProperties(new AvsAssessmentPropertiesV2() + .withScope(new Scope().withScopeType(ScopeType.SERVER_GROUP_ID) + .withServerGroupId("fxonspfmzfuiaepr") + .withAzureResourceGraphQuery("ylnfwgptlyzwzkotmunbx")) + .withSettings(new AvsAssessmentSettings().withAzureLocation("actuloeieva") + .withCurrency(AzureCurrency.UNKNOWN) + .withScalingFactor(28.0F) + .withDiscountPercentage(27.0F) + .withSizingCriterion(AssessmentSizingCriterion.PERFORMANCE_BASED) + .withPerformanceData(new PerformanceData().withPercentile(Percentile.fromString("Unknown")) + .withTimeRange(TimeRange.DAY) + .withPerfDataStartTime(OffsetDateTime.parse("2025-02-21T05:36:34.751Z")) + .withPerfDataEndTime(OffsetDateTime.parse("2025-02-21T05:36:34.751Z"))) + .withSavingsSettings(new SavingsSettings().withSavingsOptions(SavingsOptions.NONE) + .withAzureOfferCode(AzureOffer.UNKNOWN)) + .withBillingSettings(new BillingSettings().withLicensingProgram(LicensingProgram.RETAIL) + .withSubscriptionId("xvtuenxmmjuqlhgmvev")) + .withEnvironmentType(EnvironmentType.PRODUCTION) + .withFailuresToTolerateAndRaidLevelList(Arrays.asList(FttAndRaidLevel.UNKNOWN)) + .withVcpuOversubscription(25.0F) + .withNodeTypes(Arrays.asList(AzureAvsNodeType.UNKNOWN)) + .withAvsAssessmentScenario(AvsAssessmentScenario.UNKNOWN) + .withExternalStorageTypes(Arrays.asList(ExternalStorageType.UNKNOWN)) + .withCpuHeadroom(27.0F) + .withIsVcfByolEnabled(true) + .withMemOvercommit(11.0F) + .withDedupeCompression(26.0F) + .withIsStretchClusterEnabled(true)) + .withDetails(new AssessmentDetails()) + .withFallbackMachineAssessmentArmId("tpjvxfcyxsgngqdxyrrfh")) + .create(); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsV2OperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsV2OperationsDeleteSamples.java new file mode 100644 index 000000000000..43759ead6a0c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsV2OperationsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AvsAssessmentsV2Operations Delete. + */ +public final class AvsAssessmentsV2OperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessmentsV2Operations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: AvsAssessmentsV2Operations_Delete_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void avsAssessmentsV2OperationsDeleteMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.avsAssessmentsV2Operations() + .deleteWithResponse("rgavsAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsV2OperationsDownloadUrlSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsV2OperationsDownloadUrlSamples.java new file mode 100644 index 000000000000..cb602f8ed53b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsV2OperationsDownloadUrlSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for AvsAssessmentsV2Operations DownloadUrl. + */ +public final class AvsAssessmentsV2OperationsDownloadUrlSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessmentsV2Operations_DownloadUrl_MaximumSet_Gen.json + */ + /** + * Sample code: Get download URL for the assessment report. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void getDownloadURLForTheAssessmentReport( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { + manager.avsAssessmentsV2Operations() + .downloadUrl("rgavsAssessments", "contosoProject", "assessmentName", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsV2OperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsV2OperationsGetSamples.java new file mode 100644 index 000000000000..e7d526e56578 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsV2OperationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AvsAssessmentsV2Operations Get. + */ +public final class AvsAssessmentsV2OperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessmentsV2Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AvsAssessmentsV2Operations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void avsAssessmentsV2OperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.avsAssessmentsV2Operations() + .getWithResponse("rgavsAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsV2OperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsV2OperationsListByParentSamples.java new file mode 100644 index 000000000000..bd203c612b22 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsV2OperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AvsAssessmentsV2Operations ListByParent. + */ +public final class AvsAssessmentsV2OperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsAssessmentsV2Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AvsAssessmentsV2Operations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void avsAssessmentsV2OperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.avsAssessmentsV2Operations() + .listByParent("rgavsAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsGraphAssessmentOptionsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsGraphAssessmentOptionsOperationsGetSamples.java new file mode 100644 index 000000000000..ec7539e73cb1 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsGraphAssessmentOptionsOperationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AvsGraphAssessmentOptionsOperations Get. + */ +public final class AvsGraphAssessmentOptionsOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AvsGraphAssessmentOptionsOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void avsGraphAssessmentOptionsOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.avsGraphAssessmentOptionsOperations() + .getWithResponse("rgavsAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsGraphAssessmentOptionsOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsGraphAssessmentOptionsOperationsListByParentSamples.java new file mode 100644 index 000000000000..834eb7dd3afd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/AvsGraphAssessmentOptionsOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for AvsGraphAssessmentOptionsOperations ListByParent. + */ +public final class AvsGraphAssessmentOptionsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * AvsGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AvsGraphAssessmentOptionsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void avsGraphAssessmentOptionsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.avsGraphAssessmentOptionsOperations() + .listByParent("rgavsAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseAvsSummaryOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseAvsSummaryOperationsGetSamples.java new file mode 100644 index 000000000000..d813487c97d0 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseAvsSummaryOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for BusinessCaseAvsSummaryOperations Get. + */ +public final class BusinessCaseAvsSummaryOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseAvsSummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: BusinessCaseAvsSummaryOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void businessCaseAvsSummaryOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.businessCaseAvsSummaryOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MySummary", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseAvsSummaryOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseAvsSummaryOperationsListByParentSamples.java new file mode 100644 index 000000000000..c1c71a6321b7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseAvsSummaryOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for BusinessCaseAvsSummaryOperations ListByParent. + */ +public final class BusinessCaseAvsSummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseAvsSummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: BusinessCaseAvsSummaryOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void businessCaseAvsSummaryOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.businessCaseAvsSummaryOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseIaasSummaryOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseIaasSummaryOperationsGetSamples.java new file mode 100644 index 000000000000..ed650c78233b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseIaasSummaryOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for BusinessCaseIaasSummaryOperations Get. + */ +public final class BusinessCaseIaasSummaryOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseIaasSummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: BusinessCaseIaasSummaryOperations_Get_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void businessCaseIaasSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.businessCaseIaasSummaryOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MySummary", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseIaasSummaryOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseIaasSummaryOperationsListByParentSamples.java new file mode 100644 index 000000000000..797c3d5b98c8 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseIaasSummaryOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for BusinessCaseIaasSummaryOperations ListByParent. + */ +public final class BusinessCaseIaasSummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseIaasSummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: BusinessCaseIaasSummaryOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void businessCaseIaasSummaryOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.businessCaseIaasSummaryOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsCompareSummarySamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsCompareSummarySamples.java new file mode 100644 index 000000000000..261a07ed7e14 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsCompareSummarySamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for BusinessCaseOperations CompareSummary. + */ +public final class BusinessCaseOperationsCompareSummarySamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOperations_CompareSummary_MaximumSet_Gen.json + */ + /** + * Sample code: Get Compare summary report for Business case. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void getCompareSummaryReportForBusinessCase( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { + manager.businessCaseOperations() + .compareSummary("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsCreateSamples.java new file mode 100644 index 000000000000..9a9dbca6224b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsCreateSamples.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.resourcemanager.migration.assessment.models.AzureArcManagementSettings; +import com.azure.resourcemanager.migration.assessment.models.AzureArcMonitoringSettings; +import com.azure.resourcemanager.migration.assessment.models.AzureArcSettings; +import com.azure.resourcemanager.migration.assessment.models.AzureArcState; +import com.azure.resourcemanager.migration.assessment.models.AzureSettings; +import com.azure.resourcemanager.migration.assessment.models.AzureSettingsPerYearMigrationCompletionPercentageItem; +import com.azure.resourcemanager.migration.assessment.models.BusinessCaseCurrency; +import com.azure.resourcemanager.migration.assessment.models.BusinessCaseProperties; +import com.azure.resourcemanager.migration.assessment.models.ComputeSettings; +import com.azure.resourcemanager.migration.assessment.models.DiscoverySource; +import com.azure.resourcemanager.migration.assessment.models.FacilitySettings; +import com.azure.resourcemanager.migration.assessment.models.HyperVLicenseType; +import com.azure.resourcemanager.migration.assessment.models.HypervLicense; +import com.azure.resourcemanager.migration.assessment.models.HypervVirtualizationManagementSettings; +import com.azure.resourcemanager.migration.assessment.models.LaborSettings; +import com.azure.resourcemanager.migration.assessment.models.LinuxServerLicensingSettings; +import com.azure.resourcemanager.migration.assessment.models.ManagementSettings; +import com.azure.resourcemanager.migration.assessment.models.MigrationStrategy; +import com.azure.resourcemanager.migration.assessment.models.NetworkSettings; +import com.azure.resourcemanager.migration.assessment.models.OnPremiseSettings; +import com.azure.resourcemanager.migration.assessment.models.OtherManagementCostsSettings; +import com.azure.resourcemanager.migration.assessment.models.SavingsOption; +import com.azure.resourcemanager.migration.assessment.models.SecuritySettings; +import com.azure.resourcemanager.migration.assessment.models.Settings; +import com.azure.resourcemanager.migration.assessment.models.SqlServerLicenseType; +import com.azure.resourcemanager.migration.assessment.models.SqlServerLicensingSettings; +import com.azure.resourcemanager.migration.assessment.models.StorageSettings; +import com.azure.resourcemanager.migration.assessment.models.ThirdPartyManagementSettings; +import com.azure.resourcemanager.migration.assessment.models.VirtualizationSoftwareSettings; +import com.azure.resourcemanager.migration.assessment.models.WindowsServerLicensingSettings; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for BusinessCaseOperations Create. + */ +public final class BusinessCaseOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOperations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: BusinessCaseOperations_Create_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void businessCaseOperationsCreateMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.businessCaseOperations() + .define("MyBusinessCase") + .withExistingAssessmentProject("rgbusinessCases", "MyMigrateProject") + .withProperties(new BusinessCaseProperties().withSettings(new Settings() + .withAzureSettings(new AzureSettings().withTargetLocation("hpocokeckktxpzilk") + .withDiscountPercentage(48.0F) + .withCurrency(BusinessCaseCurrency.UNKNOWN) + .withBusinessCaseType(MigrationStrategy.UNKNOWN) + .withWorkloadDiscoverySource(DiscoverySource.UNKNOWN) + .withPerformanceDataStartTime(OffsetDateTime.parse("2024-11-14T10:27:58.436Z")) + .withPerformanceDataEndTime(OffsetDateTime.parse("2024-11-14T10:27:58.436Z")) + .withComfortFactor(19.0F) + .withPerformanceUtilizationPercentile(93.0F) + .withPerYearMigrationCompletionPercentage(Arrays.asList( + new AzureSettingsPerYearMigrationCompletionPercentageItem().withName("cthxvjhedpsnbddvyghswtgp") + .withValue(13.0F))) + .withInfrastructureGrowthRate(79.0F) + .withWacc(43.0F) + .withNetworkCostPercentage(81.0F) + .withIaasLaborCostPercentage(51.0F) + .withPaasLaborCostPercentage(13.0F) + .withAvsLaborCostPercentage(2.0F) + .withSavingsOption(SavingsOption.UNKNOWN)) + .withOnPremiseSettings(new OnPremiseSettings() + .withComputeSettings(new ComputeSettings().withHyperthreadCoreToMemoryRatio(26f) + .withPrice(8f) + .withComputeHardwareMaintenanceCost(1f) + .withVmOversubscriptionRatio(10f) + .withCpuOversubscriptionRatio(10f) + .withSqlServerLicensing( + Arrays.asList(new SqlServerLicensingSettings().withVersion(SqlServerLicenseType.UNKNOWN) + .withLicenseCost(28f) + .withSoftwareAssuranceCost(27f))) + .withWindowsServerLicensing(new WindowsServerLicensingSettings().withLicenseCost(2f) + .withSoftwareAssuranceCost(6f) + .withLicensesPerCore(21)) + .withRhelLinuxServerLicensing(new LinuxServerLicensingSettings().withLicenseCost(7f)) + .withSuseLinuxServerLicensing(new LinuxServerLicensingSettings().withLicenseCost(7f)) + .withVirtualizationSoftwareSettings( + new VirtualizationSoftwareSettings().withVMwareCloudFoundationLicenseCost(23f))) + .withStorageSettings(new StorageSettings().withCostPerGbPerYear(12f) + .withMaintainanceCostPercentageToAcquisitionCost(5f)) + .withNetworkSettings(new NetworkSettings().withMaintenanceCostPercentage(84f) + .withPhysicalServersPerCabinet(18) + .withAverageCostPerCabinet(27f)) + .withFacilitySettings( + new FacilitySettings().withFacilitiesCostPerKwh(1.0F).withPowerUtilizationEfficiency(25f)) + .withLaborSettings(new LaborSettings().withPhysicalServersPerAdmin(16) + .withVirtualMachinesPerAdmin(18) + .withHourlyAdminCost(22f)) + .withSecuritySettings(new SecuritySettings().withServerSecurityCostPerServerPerYear(6f) + .withSqlServerSecurityCostPerServerPerYear(10f)) + .withManagementSettings( + new ManagementSettings() + .withHypervVirtualizationManagementSettings( + new HypervVirtualizationManagementSettings().withNumberOfPhysicalCoresPerLicense(8) + .withSoftwareAssuranceCost(15f) + .withLicenseAndSupportList(Arrays.asList(new HypervLicense().withLicenseCost(1f) + .withLicenseType(HyperVLicenseType.UNKNOWN)))) + .withThirdPartyManagementSettings( + new ThirdPartyManagementSettings().withLicenseCost(1f).withSupportCost(13f)) + .withOtherManagementCostsSettings( + new OtherManagementCostsSettings().withMonitoringCostPerServerPerYear(2f) + .withPatchingCostPerServerPerYear(28f) + .withDataProtectionCostPerServerPerYear(4f)))) + .withAzureArcSettings(new AzureArcSettings().withAzureArcState(AzureArcState.DISABLED) + .withLaborCostPercentage(46.0F) + .withManagementSettings(new AzureArcManagementSettings().withMonitoringSettings( + new AzureArcMonitoringSettings().withLogsVolumeInGB(17f).withAlertRulesCount(19)))))) + .create(); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsDeleteSamples.java new file mode 100644 index 000000000000..89e43b4b67c0 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for BusinessCaseOperations Delete. + */ +public final class BusinessCaseOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOperations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: BusinessCaseOperations_Delete_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void businessCaseOperationsDeleteMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.businessCaseOperations() + .deleteWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsGetReportDownloadUrlSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsGetReportDownloadUrlSamples.java new file mode 100644 index 000000000000..d194130aec0e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsGetReportDownloadUrlSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for BusinessCaseOperations GetReportDownloadUrl. + */ +public final class BusinessCaseOperationsGetReportDownloadUrlSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOperations_GetReportDownloadUrl_MaximumSet_Gen.json + */ + /** + * Sample code: Get download URL for the business case report. - generated by [MaximumSet] rule. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void getDownloadURLForTheBusinessCaseReportGeneratedByMaximumSetRule( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { + manager.businessCaseOperations() + .getReportDownloadUrl("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsGetSamples.java new file mode 100644 index 000000000000..04f9562be390 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for BusinessCaseOperations Get. + */ +public final class BusinessCaseOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: BusinessCaseOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void businessCaseOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.businessCaseOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsListByParentSamples.java new file mode 100644 index 000000000000..ba88765903ba --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for BusinessCaseOperations ListByParent. + */ +public final class BusinessCaseOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: BusinessCaseOperations_ListByParent_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void businessCaseOperationsListByParentMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.businessCaseOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOverviewSummaryOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOverviewSummaryOperationsGetSamples.java new file mode 100644 index 000000000000..3219ed3969e3 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOverviewSummaryOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for BusinessCaseOverviewSummaryOperations Get. + */ +public final class BusinessCaseOverviewSummaryOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOverviewSummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: BusinessCaseOverviewSummaryOperations_Get_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void businessCaseOverviewSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.businessCaseOverviewSummaryOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MySummary", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOverviewSummaryOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOverviewSummaryOperationsListByParentSamples.java new file mode 100644 index 000000000000..354e87cc0c9b --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCaseOverviewSummaryOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for BusinessCaseOverviewSummaryOperations ListByParent. + */ +public final class BusinessCaseOverviewSummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCaseOverviewSummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: BusinessCaseOverviewSummaryOperations_ListByParent_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void businessCaseOverviewSummaryOperationsListByParentMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.businessCaseOverviewSummaryOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCasePaasSummaryOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCasePaasSummaryOperationsGetSamples.java new file mode 100644 index 000000000000..9698fc573c21 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCasePaasSummaryOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for BusinessCasePaasSummaryOperations Get. + */ +public final class BusinessCasePaasSummaryOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCasePaasSummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: BusinessCasePaasSummaryOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void businessCasePaasSummaryOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.businessCasePaasSummaryOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MySummary", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCasePaasSummaryOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCasePaasSummaryOperationsListByParentSamples.java new file mode 100644 index 000000000000..cc8a5b47610a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/BusinessCasePaasSummaryOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for BusinessCasePaasSummaryOperations ListByParent. + */ +public final class BusinessCasePaasSummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * BusinessCasePaasSummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: BusinessCasePaasSummaryOperations_ListByParent_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void businessCasePaasSummaryOperationsListByParentMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.businessCasePaasSummaryOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentOperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentOperationsCreateSamples.java new file mode 100644 index 000000000000..65ae367d4abc --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentOperationsCreateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.resourcemanager.migration.assessment.models.CompoundAssessmentProperties; +import com.azure.resourcemanager.migration.assessment.models.TargetAssessmentArmIds; + +/** + * Samples for CompoundAssessmentOperations Create. + */ +public final class CompoundAssessmentOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * CompoundAssessmentOperations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: CompoundAssessmentOperations_Create. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void compoundAssessmentOperationsCreate( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.compoundAssessmentOperations() + .define("assessmentName") + .withExistingAssessmentProject("rgwebAppCompoundAssessments", "contosoProject") + .withProperties(new CompoundAssessmentProperties().withTargetAssessmentArmIds(new TargetAssessmentArmIds() + .withAks( + "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/aksAssessments/nameOfAssessment") + .withAzureAppService( + "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/webAppAssessments/nameOfAssessment") + .withAzureAppServiceContainer( + "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/webAppAssessments/nameOfAssessment")) + .withFallbackMachineAssessmentArmId( + "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/assessments/nameOfAssessment")) + .create(); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentOperationsDeleteSamples.java new file mode 100644 index 000000000000..1d4acc5c51ee --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentOperationsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for CompoundAssessmentOperations Delete. + */ +public final class CompoundAssessmentOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * CompoundAssessmentOperations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: CompoundAssessmentOperations_Delete. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void compoundAssessmentOperationsDelete( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.compoundAssessmentOperations() + .deleteWithResponse("rgwebAppCompoundAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentOperationsDownloadUrlSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentOperationsDownloadUrlSamples.java new file mode 100644 index 000000000000..bd0e0b24c31a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentOperationsDownloadUrlSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for CompoundAssessmentOperations DownloadUrl. + */ +public final class CompoundAssessmentOperationsDownloadUrlSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * CompoundAssessmentOperations_DownloadUrl_MaximumSet_Gen.json + */ + /** + * Sample code: CompoundAssessmentOperations_DownloadUrl. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void compoundAssessmentOperationsDownloadUrl( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { + manager.compoundAssessmentOperations() + .downloadUrl("rgwebAppCompoundAssessments", "contosoProject", "assessmentName", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentOperationsGetSamples.java new file mode 100644 index 000000000000..a2929eb55bf7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for CompoundAssessmentOperations Get. + */ +public final class CompoundAssessmentOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * CompoundAssessmentOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: CompoundAssessmentOperations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void compoundAssessmentOperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.compoundAssessmentOperations() + .getWithResponse("rgwebAppCompoundAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentOperationsListByParentSamples.java new file mode 100644 index 000000000000..8ecadb7e62ed --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for CompoundAssessmentOperations ListByParent. + */ +public final class CompoundAssessmentOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * CompoundAssessmentOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: CompoundAssessmentOperations_ListByParent. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void compoundAssessmentOperationsListByParent( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.compoundAssessmentOperations() + .listByParent("rgwebAppCompoundAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentSummaryOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentSummaryOperationsGetSamples.java new file mode 100644 index 000000000000..76c6b6944919 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentSummaryOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for CompoundAssessmentSummaryOperations Get. + */ +public final class CompoundAssessmentSummaryOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * CompoundAssessmentSummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: CompoundAssessmentSummaryOperations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void compoundAssessmentSummaryOperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.compoundAssessmentSummaryOperations() + .getWithResponse("rgwebAppCompoundAssessments", "contosoProject", "assessmentName", "Modernize", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentSummaryOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentSummaryOperationsListByParentSamples.java new file mode 100644 index 000000000000..89f16f3487c1 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/CompoundAssessmentSummaryOperationsListByParentSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for CompoundAssessmentSummaryOperations ListByParent. + */ +public final class CompoundAssessmentSummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * CompoundAssessmentSummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: CompoundAssessmentSummaryOperations_ListByParent. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void compoundAssessmentSummaryOperationsListByParent( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.compoundAssessmentSummaryOperations() + .listByParent("rgwebAppCompoundAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedAvsMachinesOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedAvsMachinesOperationsGetSamples.java new file mode 100644 index 000000000000..1ce9af2ea4ed --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedAvsMachinesOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for EvaluatedAvsMachinesOperations Get. + */ +public final class EvaluatedAvsMachinesOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedAvsMachinesOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedAvsMachinesOperations_Get_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedAvsMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedAvsMachinesOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MyMachine", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedAvsMachinesOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedAvsMachinesOperationsListByParentSamples.java new file mode 100644 index 000000000000..c504dfc2237d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedAvsMachinesOperationsListByParentSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for EvaluatedAvsMachinesOperations ListByParent. + */ +public final class EvaluatedAvsMachinesOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedAvsMachinesOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedAvsMachinesOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedAvsMachinesOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedAvsMachinesOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "fknroh", 18, "kri", 12, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedMachinesOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedMachinesOperationsGetSamples.java new file mode 100644 index 000000000000..82a19aaa9ed7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedMachinesOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for EvaluatedMachinesOperations Get. + */ +public final class EvaluatedMachinesOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedMachinesOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedMachinesOperations_Get_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedMachinesOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MyMachine", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedMachinesOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedMachinesOperationsListByParentSamples.java new file mode 100644 index 000000000000..d902c53c73e1 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedMachinesOperationsListByParentSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for EvaluatedMachinesOperations ListByParent. + */ +public final class EvaluatedMachinesOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedMachinesOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedMachinesOperations_ListByParent_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedMachinesOperationsListByParentMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedMachinesOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "wzky", 24, "eoevgdmtpkbhlgyglvsa", + 6, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedSqlEntitiesOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedSqlEntitiesOperationsGetSamples.java new file mode 100644 index 000000000000..74b467b264f7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedSqlEntitiesOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for EvaluatedSqlEntitiesOperations Get. + */ +public final class EvaluatedSqlEntitiesOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedSqlEntitiesOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedSqlEntitiesOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedSqlEntitiesOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedSqlEntitiesOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MyEntity", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedSqlEntitiesOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedSqlEntitiesOperationsListByParentSamples.java new file mode 100644 index 000000000000..43dd004df091 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedSqlEntitiesOperationsListByParentSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for EvaluatedSqlEntitiesOperations ListByParent. + */ +public final class EvaluatedSqlEntitiesOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedSqlEntitiesOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedSqlEntitiesOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedSqlEntitiesOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedSqlEntitiesOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "luzlkremkujtmqjmc", 13, "bnmyic", + 23, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedWebAppsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedWebAppsOperationsGetSamples.java new file mode 100644 index 000000000000..4cb0902eec96 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedWebAppsOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for EvaluatedWebAppsOperations Get. + */ +public final class EvaluatedWebAppsOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedWebAppsOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedWebAppsOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedWebAppsOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedWebAppsOperations() + .getWithResponse("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "MyWebApp", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedWebAppsOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedWebAppsOperationsListByParentSamples.java new file mode 100644 index 000000000000..47f0b895e9f8 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/EvaluatedWebAppsOperationsListByParentSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for EvaluatedWebAppsOperations ListByParent. + */ +public final class EvaluatedWebAppsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * EvaluatedWebAppsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: EvaluatedWebAppsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void evaluatedWebAppsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.evaluatedWebAppsOperations() + .listByParent("rgbusinessCases", "MyMigrateProject", "MyBusinessCase", "krlcuqeagsjdbbjthvwqqu", 20, + "giprsbjufkenlzmqf", 12, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsCreateSamples.java deleted file mode 100644 index 2988295133a6..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsCreateSamples.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.resourcemanager.migration.assessment.models.GroupProperties; -import com.azure.resourcemanager.migration.assessment.models.GroupType; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; - -/** - * Samples for GroupsOperations Create. - */ -public final class GroupsOperationsCreateSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * GroupsOperations_Create_MaximumSet_Gen.json - */ - /** - * Sample code: GroupsOperations_Create_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void groupsOperationsCreateMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.groupsOperations() - .define("kuchatur-test") - .withExistingAssessmentProject("ayagrawrg", "app18700project") - .withProperties(new GroupProperties().withProvisioningState(ProvisioningState.SUCCEEDED) - .withGroupType(GroupType.DEFAULT)) - .create(); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsDeleteSamples.java deleted file mode 100644 index 690de780135a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsDeleteSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for GroupsOperations Delete. - */ -public final class GroupsOperationsDeleteSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * GroupsOperations_Delete_MaximumSet_Gen.json - */ - /** - * Sample code: GroupsOperations_Delete_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void groupsOperationsDeleteMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.groupsOperations() - .deleteWithResponse("ayagrawrg", "app18700project", "kuchatur-test", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsGetSamples.java deleted file mode 100644 index ade21ccc0f9b..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for GroupsOperations Get. - */ -public final class GroupsOperationsGetSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * GroupsOperations_Get_MaximumSet_Gen.json - */ - /** - * Sample code: GroupsOperations_Get_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void groupsOperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.groupsOperations() - .getWithResponse("ayagrawrg", "app18700project", "kuchatur-test", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsListByAssessmentProjectSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsListByAssessmentProjectSamples.java deleted file mode 100644 index f77f185fdce3..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsListByAssessmentProjectSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for GroupsOperations ListByAssessmentProject. - */ -public final class GroupsOperationsListByAssessmentProjectSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * GroupsOperations_ListByAssessmentProject_MaximumSet_Gen.json - */ - /** - * Sample code: GroupsOperations_ListByAssessmentProject_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void groupsOperationsListByAssessmentProjectMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.groupsOperations() - .listByAssessmentProject("ayagrawrg", "app18700project", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsUpdateMachinesSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsUpdateMachinesSamples.java deleted file mode 100644 index cc0fd90b85ea..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsUpdateMachinesSamples.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.resourcemanager.migration.assessment.models.GroupBodyProperties; -import com.azure.resourcemanager.migration.assessment.models.GroupUpdateOperation; -import com.azure.resourcemanager.migration.assessment.models.UpdateGroupBody; -import java.util.Arrays; - -/** - * Samples for GroupsOperations UpdateMachines. - */ -public final class GroupsOperationsUpdateMachinesSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * GroupsOperations_UpdateMachines_MaximumSet_Gen.json - */ - /** - * Sample code: GroupsOperations_UpdateMachines_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void groupsOperationsUpdateMachinesMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.groupsOperations() - .updateMachines("ayagrawrg", "app18700project", "kuchatur-test", new UpdateGroupBody().withEtag("*") - .withProperties(new GroupBodyProperties().withOperationType(GroupUpdateOperation.ADD) - .withMachines(Arrays.asList( - "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawrg/providers/Microsoft.Migrate/assessmentprojects/app18700project/machines/18895660-c5e5-4247-8cfc-cd24e1fe57f3"))), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentOperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentOperationsCreateSamples.java new file mode 100644 index 000000000000..493e83b728aa --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentOperationsCreateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.resourcemanager.migration.assessment.models.HeterogeneousAssessmentProperties; +import java.util.Arrays; + +/** + * Samples for HeterogeneousAssessmentOperations Create. + */ +public final class HeterogeneousAssessmentOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HeterogeneousAssessmentOperations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: HeterogeneousAssessmentOperations_Create. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void heterogeneousAssessmentOperationsCreate( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.heterogeneousAssessmentOperations() + .define("assessmentName") + .withExistingAssessmentProject("rgheterogeneousAssessments", "contosoProject") + .withProperties( + new HeterogeneousAssessmentProperties().withAssessmentArmIds(Arrays.asList("gartykxgfvqccfs"))) + .create(); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentOperationsDeleteSamples.java new file mode 100644 index 000000000000..55abb9c6b2e2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentOperationsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for HeterogeneousAssessmentOperations Delete. + */ +public final class HeterogeneousAssessmentOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HeterogeneousAssessmentOperations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: HeterogeneousAssessmentOperations_Delete. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void heterogeneousAssessmentOperationsDelete( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.heterogeneousAssessmentOperations() + .deleteWithResponse("rgheterogeneousAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentOperationsGetSamples.java new file mode 100644 index 000000000000..fc5554d676b2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for HeterogeneousAssessmentOperations Get. + */ +public final class HeterogeneousAssessmentOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HeterogeneousAssessmentOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: HeterogeneousAssessmentOperations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void heterogeneousAssessmentOperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.heterogeneousAssessmentOperations() + .getWithResponse("rgheterogeneousAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentOperationsListByParentSamples.java new file mode 100644 index 000000000000..565d9fb171fb --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for HeterogeneousAssessmentOperations ListByParent. + */ +public final class HeterogeneousAssessmentOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HeterogeneousAssessmentOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: HeterogeneousAssessmentOperations_ListByParent. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void heterogeneousAssessmentOperationsListByParent( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.heterogeneousAssessmentOperations() + .listByParent("rgheterogeneousAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentSummaryOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentSummaryOperationsGetSamples.java new file mode 100644 index 000000000000..beb638376707 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentSummaryOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for HeterogeneousAssessmentSummaryOperations Get. + */ +public final class HeterogeneousAssessmentSummaryOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HeterogeneousAssessmentSummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: HeterogeneousAssessmentSummaryOperations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void heterogeneousAssessmentSummaryOperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.heterogeneousAssessmentSummaryOperations() + .getWithResponse("rgheterogeneousAssessments", "contosoProject", "assessmentName", "PaaSPreferred", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentSummaryOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentSummaryOperationsListByParentSamples.java new file mode 100644 index 000000000000..178948fde5d1 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HeterogeneousAssessmentSummaryOperationsListByParentSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for HeterogeneousAssessmentSummaryOperations ListByParent. + */ +public final class HeterogeneousAssessmentSummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HeterogeneousAssessmentSummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: HeterogeneousAssessmentSummaryOperations_ListByParent. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void heterogeneousAssessmentSummaryOperationsListByParent( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.heterogeneousAssessmentSummaryOperations() + .listByParent("rgheterogeneousAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsCreateSamples.java index 6398834156ef..2ff075cb0863 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsCreateSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsCreateSamples.java @@ -7,7 +7,6 @@ import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; import java.time.OffsetDateTime; /** @@ -16,20 +15,20 @@ public final class HypervCollectorsOperationsCreateSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * HypervCollectorsOperations_Create_MaximumSet_Gen.json */ /** - * Sample code: HypervCollectorsOperations_Create_MaximumSet_Gen. + * Sample code: HypervCollectorsOperations_Create. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void hypervCollectorsOperationsCreateMaximumSetGen( + public static void hypervCollectorsOperationsCreate( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.hypervCollectorsOperations() .define("test-697cecollector") .withExistingAssessmentProject("ayagrawRG", "app18700project") - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.SUCCEEDED) + .withProperties(new CollectorPropertiesBaseWithAgent() .withAgentProperties(new CollectorAgentPropertiesBase().withId("12f1d90f-b3fa-4926-8893-e56803a09af0") .withVersion("2.0.1993.19") .withLastHeartbeatUtc(OffsetDateTime.parse("2022-07-07T14:25:35.708325Z")) diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsDeleteSamples.java index 3fcfead6b763..0540c4af373a 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsDeleteSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsDeleteSamples.java @@ -10,15 +10,15 @@ public final class HypervCollectorsOperationsDeleteSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * HypervCollectorsOperations_Delete_MaximumSet_Gen.json */ /** - * Sample code: HypervCollectorsOperations_Delete_MaximumSet_Gen. + * Sample code: HypervCollectorsOperations_Delete. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void hypervCollectorsOperationsDeleteMaximumSetGen( + public static void hypervCollectorsOperationsDelete( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.hypervCollectorsOperations() .deleteWithResponse("ayagrawRG", "app18700project", "test-697cecollector", diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsGetSamples.java index e0c9507885db..147d7f6a902e 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsGetSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsGetSamples.java @@ -10,15 +10,15 @@ public final class HypervCollectorsOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * HypervCollectorsOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: HypervCollectorsOperations_Get_MaximumSet_Gen. + * Sample code: HypervCollectorsOperations_Get. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void hypervCollectorsOperationsGetMaximumSetGen( + public static void hypervCollectorsOperationsGet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.hypervCollectorsOperations() .getWithResponse("ayagrawRG", "app18700project", "test-697cecollector", com.azure.core.util.Context.NONE); diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsListByAssessmentProjectSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsListByAssessmentProjectSamples.java deleted file mode 100644 index 92b1f2b0f21b..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsListByAssessmentProjectSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for HypervCollectorsOperations ListByAssessmentProject. - */ -public final class HypervCollectorsOperationsListByAssessmentProjectSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * HypervCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen.json - */ - /** - * Sample code: HypervCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void hypervCollectorsOperationsListByAssessmentProjectMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.hypervCollectorsOperations() - .listByAssessmentProject("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsListByParentSamples.java new file mode 100644 index 000000000000..7d286249dab6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for HypervCollectorsOperations ListByParent. + */ +public final class HypervCollectorsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * HypervCollectorsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: HypervCollectorsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void hypervCollectorsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.hypervCollectorsOperations() + .listByParent("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsCreateSamples.java index 6d242286869f..1adc4c9cc25a 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsCreateSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsCreateSamples.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.migration.assessment.generated; import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; /** * Samples for ImportCollectorsOperations Create. @@ -13,22 +12,21 @@ public final class ImportCollectorsOperationsCreateSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * ImportCollectorsOperations_Create_MaximumSet_Gen.json */ /** - * Sample code: ImportCollectorsOperations_Create_MaximumSet_Gen. + * Sample code: ImportCollectorsOperations_Create. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void importCollectorsOperationsCreateMaximumSetGen( + public static void importCollectorsOperationsCreate( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.importCollectorsOperations() .define("importCollectore7d5") .withExistingAssessmentProject("ayagrawRG", "app18700project") - .withProperties(new CollectorPropertiesBase().withProvisioningState(ProvisioningState.SUCCEEDED) - .withDiscoverySiteId( - "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourcegroups/ayagrawRG/providers/microsoft.offazure/importsites/actualSEA37d4importSite")) + .withProperties(new CollectorPropertiesBase().withDiscoverySiteId( + "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourcegroups/ayagrawRG/providers/microsoft.offazure/importsites/actualSEA37d4importSite")) .create(); } } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsDeleteSamples.java index f61e11dddef7..258666cf2807 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsDeleteSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsDeleteSamples.java @@ -10,15 +10,15 @@ public final class ImportCollectorsOperationsDeleteSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * ImportCollectorsOperations_Delete_MaximumSet_Gen.json */ /** - * Sample code: ImportCollectorsOperations_Delete_MaximumSet_Gen. + * Sample code: ImportCollectorsOperations_Delete. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void importCollectorsOperationsDeleteMaximumSetGen( + public static void importCollectorsOperationsDelete( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.importCollectorsOperations() .deleteWithResponse("ayagrawRG", "app18700project", "importCollectore7d5", diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsGetSamples.java index 24a69622b3a0..a345a72c1bc3 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsGetSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsGetSamples.java @@ -10,15 +10,15 @@ public final class ImportCollectorsOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * ImportCollectorsOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: ImportCollectorsOperations_Get_MaximumSet_Gen. + * Sample code: ImportCollectorsOperations_Get. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void importCollectorsOperationsGetMaximumSetGen( + public static void importCollectorsOperationsGet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.importCollectorsOperations() .getWithResponse("ayagrawRG", "app18700project", "importCollectore7d5", com.azure.core.util.Context.NONE); diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsListByAssessmentProjectSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsListByAssessmentProjectSamples.java deleted file mode 100644 index ead0b7b930e0..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsListByAssessmentProjectSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for ImportCollectorsOperations ListByAssessmentProject. - */ -public final class ImportCollectorsOperationsListByAssessmentProjectSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * ImportCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen.json - */ - /** - * Sample code: ImportCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void importCollectorsOperationsListByAssessmentProjectMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.importCollectorsOperations() - .listByAssessmentProject("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsListByParentSamples.java new file mode 100644 index 000000000000..d36569ce38f6 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for ImportCollectorsOperations ListByParent. + */ +public final class ImportCollectorsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ImportCollectorsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: ImportCollectorsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void importCollectorsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.importCollectorsOperations() + .listByParent("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportSqlCollectorOperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportSqlCollectorOperationsCreateSamples.java new file mode 100644 index 000000000000..8e0e67c5e030 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportSqlCollectorOperationsCreateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.resourcemanager.migration.assessment.models.ImportSqlCollectorProperties; + +/** + * Samples for ImportSqlCollectorOperations Create. + */ +public final class ImportSqlCollectorOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ImportSqlCollectorOperations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: ImportSqlCollectorOperations_Create_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void importSqlCollectorOperationsCreateMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.importSqlCollectorOperations() + .define("importCollector") + .withExistingAssessmentProject("rgsqlAssessments", "contosoProject") + .withProperties(new ImportSqlCollectorProperties().withDiscoverySiteId( + "/subscriptions/C1DB66AE-BCF9-42FD-ADC2-390E0721C351/resourceGroups/rgsqlAssessments/providers/Microsoft.OffAzure/MasterSites/testproject8566mastersite/SqlSites/testproject8566sqlsites")) + .create(); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportSqlCollectorOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportSqlCollectorOperationsDeleteSamples.java new file mode 100644 index 000000000000..c9a76163d6c2 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportSqlCollectorOperationsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for ImportSqlCollectorOperations Delete. + */ +public final class ImportSqlCollectorOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ImportSqlCollectorOperations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ImportSqlCollectorOperations_Delete_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void importSqlCollectorOperationsDeleteMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.importSqlCollectorOperations() + .deleteWithResponse("rgsqlAssessments", "contosoProject", "importCollector", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportSqlCollectorOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportSqlCollectorOperationsGetSamples.java new file mode 100644 index 000000000000..92751e25c331 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportSqlCollectorOperationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for ImportSqlCollectorOperations Get. + */ +public final class ImportSqlCollectorOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ImportSqlCollectorOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ImportSqlCollectorOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void importSqlCollectorOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.importSqlCollectorOperations() + .getWithResponse("rgsqlAssessments", "contosoProject", "importCollector", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportSqlCollectorOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportSqlCollectorOperationsListByParentSamples.java new file mode 100644 index 000000000000..3ef5df5f5029 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ImportSqlCollectorOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for ImportSqlCollectorOperations ListByParent. + */ +public final class ImportSqlCollectorOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ImportSqlCollectorOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: ImportSqlCollectorOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void importSqlCollectorOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.importSqlCollectorOperations() + .listByParent("rgsqlAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentV2SummaryOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentV2SummaryOperationsGetSamples.java new file mode 100644 index 000000000000..ae1afcb09268 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentV2SummaryOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for MachineAssessmentV2SummaryOperations Get. + */ +public final class MachineAssessmentV2SummaryOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentV2SummaryOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineAssessmentV2SummaryOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.machineAssessmentV2SummaryOperations() + .getWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", "PaaSPreferred", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentV2SummaryOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentV2SummaryOperationsListByParentSamples.java new file mode 100644 index 000000000000..4771dc0589e4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentV2SummaryOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for MachineAssessmentV2SummaryOperations ListByParent. + */ +public final class MachineAssessmentV2SummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineAssessmentV2SummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentV2SummaryOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineAssessmentV2SummaryOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.machineAssessmentV2SummaryOperations() + .listByParent("rgmachineAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentsV2OperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentsV2OperationsCreateSamples.java new file mode 100644 index 000000000000..e7c9c1ee9b4d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentsV2OperationsCreateSamples.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.resourcemanager.migration.assessment.models.AssessmentDetails; +import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; +import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; +import com.azure.resourcemanager.migration.assessment.models.AzureDiskType; +import com.azure.resourcemanager.migration.assessment.models.AzureHybridUseBenefit; +import com.azure.resourcemanager.migration.assessment.models.AzureOffer; +import com.azure.resourcemanager.migration.assessment.models.AzurePricingTier; +import com.azure.resourcemanager.migration.assessment.models.AzureSecurityOfferingType; +import com.azure.resourcemanager.migration.assessment.models.AzureStorageRedundancy; +import com.azure.resourcemanager.migration.assessment.models.AzureVmFamily; +import com.azure.resourcemanager.migration.assessment.models.BillingSettings; +import com.azure.resourcemanager.migration.assessment.models.EnvironmentType; +import com.azure.resourcemanager.migration.assessment.models.LicensingProgram; +import com.azure.resourcemanager.migration.assessment.models.MachineAssessmentSettings; +import com.azure.resourcemanager.migration.assessment.models.MachineAssessmentV2Properties; +import com.azure.resourcemanager.migration.assessment.models.Percentile; +import com.azure.resourcemanager.migration.assessment.models.PerformanceData; +import com.azure.resourcemanager.migration.assessment.models.SavingsOptions; +import com.azure.resourcemanager.migration.assessment.models.SavingsSettings; +import com.azure.resourcemanager.migration.assessment.models.Scope; +import com.azure.resourcemanager.migration.assessment.models.ScopeType; +import com.azure.resourcemanager.migration.assessment.models.TimeRange; +import com.azure.resourcemanager.migration.assessment.models.VmUptime; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for MachineAssessmentsV2Operations Create. + */ +public final class MachineAssessmentsV2OperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineAssessmentsV2Operations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_Create_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineAssessmentsV2OperationsCreateMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager 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.0F) + .withDiscountPercentage(5.0F) + .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))) + .withDetails(new AssessmentDetails())) + .create(); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentsV2OperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentsV2OperationsDeleteSamples.java new file mode 100644 index 000000000000..878a9d766f72 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentsV2OperationsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for MachineAssessmentsV2Operations Delete. + */ +public final class MachineAssessmentsV2OperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineAssessmentsV2Operations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_Delete_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineAssessmentsV2OperationsDeleteMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.machineAssessmentsV2Operations() + .deleteWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentsV2OperationsDownloadUrlSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentsV2OperationsDownloadUrlSamples.java new file mode 100644 index 000000000000..629a46df24aa --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentsV2OperationsDownloadUrlSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for MachineAssessmentsV2Operations DownloadUrl. + */ +public final class MachineAssessmentsV2OperationsDownloadUrlSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineAssessmentsV2Operations_DownloadUrl_MaximumSet_Gen.json + */ + /** + * Sample code: Get download URL for the assessment report. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void getDownloadURLForTheAssessmentReport( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { + manager.machineAssessmentsV2Operations() + .downloadUrl("rgmachineAssessments", "contosoProject", "assessmentName", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentsV2OperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentsV2OperationsGetSamples.java new file mode 100644 index 000000000000..18e4865830bd --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentsV2OperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for MachineAssessmentsV2Operations Get. + */ +public final class MachineAssessmentsV2OperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineAssessmentsV2Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineAssessmentsV2OperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.machineAssessmentsV2Operations() + .getWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentsV2OperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentsV2OperationsListByParentSamples.java new file mode 100644 index 000000000000..f8b308cc073d --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineAssessmentsV2OperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for MachineAssessmentsV2Operations ListByParent. + */ +public final class MachineAssessmentsV2OperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineAssessmentsV2Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineAssessmentsV2OperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.machineAssessmentsV2Operations() + .listByParent("rgmachineAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineGraphAssessmentOptionsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineGraphAssessmentOptionsOperationsGetSamples.java new file mode 100644 index 000000000000..5e4a72768270 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineGraphAssessmentOptionsOperationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for MachineGraphAssessmentOptionsOperations Get. + */ +public final class MachineGraphAssessmentOptionsOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: MachineGraphAssessmentOptionsOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineGraphAssessmentOptionsOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.machineGraphAssessmentOptionsOperations() + .getWithResponse("rgmachineAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineGraphAssessmentOptionsOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineGraphAssessmentOptionsOperationsListByParentSamples.java new file mode 100644 index 000000000000..50d437e29567 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachineGraphAssessmentOptionsOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for MachineGraphAssessmentOptionsOperations ListByParent. + */ +public final class MachineGraphAssessmentOptionsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * MachineGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: MachineGraphAssessmentOptionsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void machineGraphAssessmentOptionsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.machineGraphAssessmentOptionsOperations() + .listByParent("rgmachineAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachinesOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachinesOperationsGetSamples.java deleted file mode 100644 index d5a0ddc37a32..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachinesOperationsGetSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for MachinesOperations Get. - */ -public final class MachinesOperationsGetSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * MachinesOperations_Get_MaximumSet_Gen.json - */ - /** - * Sample code: MachinesOperations_Get_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void machinesOperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.machinesOperations() - .getWithResponse("ayagrawrg", "app18700project", "55082b89-99e2-4c40-b63f-d4f4d6ba961d", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachinesOperationsListByAssessmentProjectSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachinesOperationsListByAssessmentProjectSamples.java deleted file mode 100644 index de7cbf436315..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/MachinesOperationsListByAssessmentProjectSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for MachinesOperations ListByAssessmentProject. - */ -public final class MachinesOperationsListByAssessmentProjectSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * MachinesOperations_ListByAssessmentProject_MaximumSet_Gen.json - */ - /** - * Sample code: MachinesOperations_ListByAssessmentProject_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void machinesOperationsListByAssessmentProjectMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.machinesOperations() - .listByAssessmentProject("ayagrawrg", "app18700project", null, 1, null, 1, - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/OperationsListSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/OperationsListSamples.java index c9c22aaa438e..d3c8707f5c2c 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/OperationsListSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/OperationsListSamples.java @@ -10,16 +10,16 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * Operations_List_MaximumSet_Gen.json */ /** - * Sample code: Operations_List_MaximumSet_Gen. + * Sample code: Operations_List. * * @param manager Entry point to MigrationAssessmentManager. */ public static void - operationsListMaximumSetGen(com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + operationsList(com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsDeleteSamples.java index f6c7190cf92b..e382ea65c09d 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsDeleteSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsDeleteSamples.java @@ -10,15 +10,15 @@ public final class PrivateEndpointConnectionOperationsDeleteSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * PrivateEndpointConnectionOperations_Delete_MaximumSet_Gen.json */ /** - * Sample code: PrivateEndpointConnectionOperations_Delete_MaximumSet_Gen. + * Sample code: PrivateEndpointConnectionOperations_Delete. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void privateEndpointConnectionOperationsDeleteMaximumSetGen( + public static void privateEndpointConnectionOperationsDelete( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.privateEndpointConnectionOperations() .deleteWithResponse("sakanwar", "sakanwar1204project", diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsGetSamples.java index 4571ff08dc0a..5d4b4cecf42a 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsGetSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsGetSamples.java @@ -10,15 +10,15 @@ public final class PrivateEndpointConnectionOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * PrivateEndpointConnectionOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: PrivateEndpointConnectionOperations_Get_MaximumSet_Gen. + * Sample code: PrivateEndpointConnectionOperations_Get. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void privateEndpointConnectionOperationsGetMaximumSetGen( + public static void privateEndpointConnectionOperationsGet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.privateEndpointConnectionOperations() .getWithResponse("sakanwar", "sakanwar1204project", diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsListByAssessmentProjectSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsListByAssessmentProjectSamples.java deleted file mode 100644 index 9458745f3cab..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsListByAssessmentProjectSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for PrivateEndpointConnectionOperations ListByAssessmentProject. - */ -public final class PrivateEndpointConnectionOperationsListByAssessmentProjectSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * PrivateEndpointConnectionOperations_ListByAssessmentProject_MaximumSet_Gen.json - */ - /** - * Sample code: PrivateEndpointConnectionOperations_ListByAssessmentProject_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void privateEndpointConnectionOperationsListByAssessmentProjectMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.privateEndpointConnectionOperations() - .listByAssessmentProject("sakanwar", "sakanwar1204project", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsListByParentSamples.java new file mode 100644 index 000000000000..bb446253e157 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for PrivateEndpointConnectionOperations ListByParent. + */ +public final class PrivateEndpointConnectionOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * PrivateEndpointConnectionOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: PrivateEndpointConnectionOperations_ListByParent. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void privateEndpointConnectionOperationsListByParent( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.privateEndpointConnectionOperations() + .listByParent("sakanwar", "sakanwar1204project", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsUpdateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsUpdateSamples.java index b952d723ddb6..35bca72282a5 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsUpdateSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsUpdateSamples.java @@ -16,15 +16,15 @@ public final class PrivateEndpointConnectionOperationsUpdateSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * PrivateEndpointConnectionOperations_Update_MaximumSet_Gen.json */ /** - * Sample code: PrivateEndpointConnectionOperations_Update_MaximumSet_Gen. + * Sample code: PrivateEndpointConnectionOperations_Update. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void privateEndpointConnectionOperationsUpdateMaximumSetGen( + public static void privateEndpointConnectionOperationsUpdate( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.privateEndpointConnectionOperations() .update("sakanwar", "sakanwar1204project", "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7", diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsGetSamples.java index acb01104b0f5..644865297b51 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsGetSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsGetSamples.java @@ -10,15 +10,15 @@ public final class PrivateLinkResourceOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * PrivateLinkResourceOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: PrivateLinkResourceOperations_Get_MaximumSet_Gen. + * Sample code: PrivateLinkResourceOperations_Get. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void privateLinkResourceOperationsGetMaximumSetGen( + public static void privateLinkResourceOperationsGet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.privateLinkResourceOperations() .getWithResponse("sakanwar", "sakanwar1204project", "Default", com.azure.core.util.Context.NONE); diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsListByAssessmentProjectSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsListByAssessmentProjectSamples.java deleted file mode 100644 index fcb6702c8313..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsListByAssessmentProjectSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for PrivateLinkResourceOperations ListByAssessmentProject. - */ -public final class PrivateLinkResourceOperationsListByAssessmentProjectSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * PrivateLinkResourceOperations_ListByAssessmentProject_MaximumSet_Gen.json - */ - /** - * Sample code: PrivateLinkResourceOperations_ListByAssessmentProject_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void privateLinkResourceOperationsListByAssessmentProjectMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.privateLinkResourceOperations() - .listByAssessmentProject("sakanwar", "sakanwar1204project", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsListByParentSamples.java new file mode 100644 index 000000000000..621d16d7fa13 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for PrivateLinkResourceOperations ListByParent. + */ +public final class PrivateLinkResourceOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * PrivateLinkResourceOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: PrivateLinkResourceOperations_ListByParent. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void privateLinkResourceOperationsListByParent( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.privateLinkResourceOperations() + .listByParent("sakanwar", "sakanwar1204project", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsCreateSamples.java index 6b14563ef370..d44adcaef0d2 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsCreateSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsCreateSamples.java @@ -7,7 +7,6 @@ import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; /** * Samples for ServerCollectorsOperations Create. @@ -15,20 +14,20 @@ public final class ServerCollectorsOperationsCreateSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * ServerCollectorsOperations_Create_MaximumSet_Gen.json */ /** - * Sample code: ServerCollectorsOperations_Create_MaximumSet_Gen. + * Sample code: ServerCollectorsOperations_Create. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void serverCollectorsOperationsCreateMaximumSetGen( + public static void serverCollectorsOperationsCreate( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.serverCollectorsOperations() .define("walter389fcollector") .withExistingAssessmentProject("ayagrawRG", "app18700project") - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.SUCCEEDED) + .withProperties(new CollectorPropertiesBaseWithAgent() .withAgentProperties(new CollectorAgentPropertiesBase().withId("498e4965-bbb1-47c2-8613-345baff9c509") .withSpnDetails(new CollectorAgentSpnPropertiesBase() .withAuthority("https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47") diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsDeleteSamples.java index 414735ef6d1a..25413b94a7e7 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsDeleteSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsDeleteSamples.java @@ -10,15 +10,15 @@ public final class ServerCollectorsOperationsDeleteSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * ServerCollectorsOperations_Delete_MaximumSet_Gen.json */ /** - * Sample code: ServerCollectorsOperations_Delete_MaximumSet_Gen. + * Sample code: ServerCollectorsOperations_Delete. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void serverCollectorsOperationsDeleteMaximumSetGen( + public static void serverCollectorsOperationsDelete( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.serverCollectorsOperations() .deleteWithResponse("ayagrawRG", "app18700project", "walter389fcollector", diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsGetSamples.java index 9efd3cb257c4..cce2a3521a88 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsGetSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsGetSamples.java @@ -10,15 +10,15 @@ public final class ServerCollectorsOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * ServerCollectorsOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: ServerCollectorsOperations_Get_MaximumSet_Gen. + * Sample code: ServerCollectorsOperations_Get. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void serverCollectorsOperationsGetMaximumSetGen( + public static void serverCollectorsOperationsGet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.serverCollectorsOperations() .getWithResponse("ayagrawRG", "app18700project", "walter389fcollector", com.azure.core.util.Context.NONE); diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsListByAssessmentProjectSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsListByAssessmentProjectSamples.java deleted file mode 100644 index 8bb8449e9607..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsListByAssessmentProjectSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for ServerCollectorsOperations ListByAssessmentProject. - */ -public final class ServerCollectorsOperationsListByAssessmentProjectSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * ServerCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen.json - */ - /** - * Sample code: ServerCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void serverCollectorsOperationsListByAssessmentProjectMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.serverCollectorsOperations() - .listByAssessmentProject("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsListByParentSamples.java new file mode 100644 index 000000000000..79e38da33a25 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for ServerCollectorsOperations ListByParent. + */ +public final class ServerCollectorsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * ServerCollectorsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: ServerCollectorsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void serverCollectorsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.serverCollectorsOperations() + .listByParent("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsOperationsGetSamples.java deleted file mode 100644 index 99714088827b..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsOperationsGetSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for SqlAssessmentOptionsOperations Get. - */ -public final class SqlAssessmentOptionsOperationsGetSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentOptionsOperations_Get_MaximumSet_Gen.json - */ - /** - * Sample code: SqlAssessmentOptionsOperations_Get_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void sqlAssessmentOptionsOperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentOptionsOperations() - .getWithResponse("rgmigrate", "fci-test6904project", "default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsOperationsListByAssessmentProjectSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsOperationsListByAssessmentProjectSamples.java deleted file mode 100644 index 9a7c648ac483..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsOperationsListByAssessmentProjectSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for SqlAssessmentOptionsOperations ListByAssessmentProject. - */ -public final class SqlAssessmentOptionsOperationsListByAssessmentProjectSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentOptionsOperations_ListByAssessmentProject_MaximumSet_Gen.json - */ - /** - * Sample code: SqlAssessmentOptionsOperations_ListByAssessmentProject_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void sqlAssessmentOptionsOperationsListByAssessmentProjectMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentOptionsOperations() - .listByAssessmentProject("rgmigrate", "fci-test6904project", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsCreateSamples.java deleted file mode 100644 index 11c9a19412ef..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsCreateSamples.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; -import com.azure.resourcemanager.migration.assessment.models.AsyncCommitModeIntent; -import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.AzureReservedInstance; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlDataBaseType; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlInstanceType; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlPurchaseModel; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlServiceTier; -import com.azure.resourcemanager.migration.assessment.models.AzureVmFamily; -import com.azure.resourcemanager.migration.assessment.models.ComputeTier; -import com.azure.resourcemanager.migration.assessment.models.EntityUptime; -import com.azure.resourcemanager.migration.assessment.models.EnvironmentType; -import com.azure.resourcemanager.migration.assessment.models.MultiSubnetIntent; -import com.azure.resourcemanager.migration.assessment.models.OptimizationLogic; -import com.azure.resourcemanager.migration.assessment.models.OsLicense; -import com.azure.resourcemanager.migration.assessment.models.Percentile; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2Properties; -import com.azure.resourcemanager.migration.assessment.models.SqlDbSettings; -import com.azure.resourcemanager.migration.assessment.models.SqlMiSettings; -import com.azure.resourcemanager.migration.assessment.models.SqlServerLicense; -import com.azure.resourcemanager.migration.assessment.models.SqlVmSettings; -import com.azure.resourcemanager.migration.assessment.models.TimeRange; -import java.util.Arrays; - -/** - * Samples for SqlAssessmentV2Operations Create. - */ -public final class SqlAssessmentV2OperationsCreateSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentV2Operations_Create_MaximumSet_Gen.json - */ - /** - * Sample code: SqlAssessmentV2Operations_Create_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void sqlAssessmentV2OperationsCreateMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentV2Operations() - .define("test_swagger_1") - .withExistingGroup("rgmigrate", "fci-test6904project", "test_fci_hadr") - .withProperties(new SqlAssessmentV2Properties().withOsLicense(OsLicense.UNKNOWN) - .withEnvironmentType(EnvironmentType.PRODUCTION) - .withEntityUptime(new EntityUptime().withDaysPerMonth(30).withHoursPerDay(24)) - .withOptimizationLogic(OptimizationLogic.MINIMIZE_COST) - .withReservedInstanceForVm(AzureReservedInstance.NONE) - .withAzureOfferCodeForVm(AzureOfferCode.MSAZR0003P) - .withAzureSqlManagedInstanceSettings( - new SqlMiSettings().withAzureSqlServiceTier(AzureSqlServiceTier.AUTOMATIC) - .withAzureSqlInstanceType(AzureSqlInstanceType.SINGLE_INSTANCE)) - .withAzureSqlDatabaseSettings(new SqlDbSettings().withAzureSqlServiceTier(AzureSqlServiceTier.AUTOMATIC) - .withAzureSqlDataBaseType(AzureSqlDataBaseType.SINGLE_DATABASE) - .withAzureSqlComputeTier(ComputeTier.AUTOMATIC) - .withAzureSqlPurchaseModel(AzureSqlPurchaseModel.VCORE)) - .withAzureSqlVmSettings( - new SqlVmSettings().withInstanceSeries(Arrays.asList(AzureVmFamily.EADSV5_SERIES))) - .withMultiSubnetIntent(MultiSubnetIntent.DISASTER_RECOVERY) - .withAsyncCommitModeIntent(AsyncCommitModeIntent.DISASTER_RECOVERY) - .withDisasterRecoveryLocation(AzureLocation.EAST_ASIA) - .withEnableHadrAssessment(true) - .withReservedInstance(AzureReservedInstance.NONE) - .withSqlServerLicense(SqlServerLicense.UNKNOWN) - .withAzureLocation("SoutheastAsia") - .withAzureOfferCode(AzureOfferCode.MSAZR0003P) - .withCurrency(AzureCurrency.USD) - .withScalingFactor(1.0F) - .withPercentile(Percentile.PERCENTILE95) - .withTimeRange(TimeRange.DAY) - .withDiscountPercentage(0.0F) - .withSizingCriterion(AssessmentSizingCriterion.PERFORMANCE_BASED)) - .create(); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsDeleteSamples.java deleted file mode 100644 index 66bee781f104..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsDeleteSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for SqlAssessmentV2Operations Delete. - */ -public final class SqlAssessmentV2OperationsDeleteSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentV2Operations_Delete_MaximumSet_Gen.json - */ - /** - * Sample code: SqlAssessmentV2Operations_Delete_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void sqlAssessmentV2OperationsDeleteMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentV2Operations() - .deleteWithResponse("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsDownloadUrlSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsDownloadUrlSamples.java deleted file mode 100644 index 24bd2fd8d879..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsDownloadUrlSamples.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; - -/** - * Samples for SqlAssessmentV2Operations DownloadUrl. - */ -public final class SqlAssessmentV2OperationsDownloadUrlSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentV2Operations_DownloadUrl_MaximumSet_Gen.json - */ - /** - * Sample code: SqlAssessmentV2Operations_DownloadUrl_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void sqlAssessmentV2OperationsDownloadUrlMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { - manager.sqlAssessmentV2Operations() - .downloadUrl("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsGetSamples.java deleted file mode 100644 index 5673e9232691..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsGetSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for SqlAssessmentV2Operations Get. - */ -public final class SqlAssessmentV2OperationsGetSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentV2Operations_Get_MaximumSet_Gen.json - */ - /** - * Sample code: SqlAssessmentV2Operations_Get_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void sqlAssessmentV2OperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentV2Operations() - .getWithResponse("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsListByGroupSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsListByGroupSamples.java deleted file mode 100644 index d7a998cc6f12..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsListByGroupSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for SqlAssessmentV2Operations ListByGroup. - */ -public final class SqlAssessmentV2OperationsListByGroupSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentV2Operations_ListByGroup_MaximumSet_Gen.json - */ - /** - * Sample code: SqlAssessmentV2Operations_ListByGroup_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void sqlAssessmentV2OperationsListByGroupMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentV2Operations() - .listByGroup("rgmigrate", "fci-test6904project", "test_fci_hadr", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryOperationsGetSamples.java deleted file mode 100644 index b8d604d61b2f..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryOperationsGetSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for SqlAssessmentV2SummaryOperations Get. - */ -public final class SqlAssessmentV2SummaryOperationsGetSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json - */ - /** - * Sample code: SqlAssessmentV2SummaryOperations_Get_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void sqlAssessmentV2SummaryOperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentV2SummaryOperations() - .getWithResponse("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", "default", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryOperationsListBySqlAssessmentV2Samples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryOperationsListBySqlAssessmentV2Samples.java deleted file mode 100644 index 187efbd26f86..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryOperationsListBySqlAssessmentV2Samples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for SqlAssessmentV2SummaryOperations ListBySqlAssessmentV2. - */ -public final class SqlAssessmentV2SummaryOperationsListBySqlAssessmentV2Samples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlAssessmentV2SummaryOperations_ListBySqlAssessmentV2_MaximumSet_Gen.json - */ - /** - * Sample code: SqlAssessmentV2SummaryOperations_ListBySqlAssessmentV2_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void sqlAssessmentV2SummaryOperationsListBySqlAssessmentV2MaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlAssessmentV2SummaryOperations() - .listBySqlAssessmentV2("rgmigrate", "fci-test6904project", "test_fci_hadr", "test_swagger_1", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3OperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3OperationsCreateSamples.java new file mode 100644 index 000000000000..f1c1d57cee52 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3OperationsCreateSamples.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.resourcemanager.migration.assessment.models.AssessmentDetails; +import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; +import com.azure.resourcemanager.migration.assessment.models.AsyncCommitModeIntent; +import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; +import com.azure.resourcemanager.migration.assessment.models.AzureLocation; +import com.azure.resourcemanager.migration.assessment.models.AzureOffer; +import com.azure.resourcemanager.migration.assessment.models.AzureSecurityOfferingType; +import com.azure.resourcemanager.migration.assessment.models.AzureSqlDataBaseType; +import com.azure.resourcemanager.migration.assessment.models.AzureSqlInstanceType; +import com.azure.resourcemanager.migration.assessment.models.AzureSqlPurchaseModel; +import com.azure.resourcemanager.migration.assessment.models.AzureSqlServiceTierV3; +import com.azure.resourcemanager.migration.assessment.models.AzureTarget; +import com.azure.resourcemanager.migration.assessment.models.AzureVmFamily; +import com.azure.resourcemanager.migration.assessment.models.BillingSettings; +import com.azure.resourcemanager.migration.assessment.models.ComputeTier; +import com.azure.resourcemanager.migration.assessment.models.EntityUptime; +import com.azure.resourcemanager.migration.assessment.models.EnvironmentType; +import com.azure.resourcemanager.migration.assessment.models.LicensingProgram; +import com.azure.resourcemanager.migration.assessment.models.MultiSubnetIntent; +import com.azure.resourcemanager.migration.assessment.models.OsLicense; +import com.azure.resourcemanager.migration.assessment.models.Percentile; +import com.azure.resourcemanager.migration.assessment.models.PerformanceData; +import com.azure.resourcemanager.migration.assessment.models.SavingsOptions; +import com.azure.resourcemanager.migration.assessment.models.SavingsSettings; +import com.azure.resourcemanager.migration.assessment.models.Scope; +import com.azure.resourcemanager.migration.assessment.models.ScopeType; +import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentSettings; +import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV3Properties; +import com.azure.resourcemanager.migration.assessment.models.SqlDbSettingsV3; +import com.azure.resourcemanager.migration.assessment.models.SqlMiSettingsV3; +import com.azure.resourcemanager.migration.assessment.models.SqlServerLicense; +import com.azure.resourcemanager.migration.assessment.models.SqlVmSettings; +import com.azure.resourcemanager.migration.assessment.models.TimeRange; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for SqlAssessmentV3Operations Create. + */ +public final class SqlAssessmentV3OperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlAssessmentV3Operations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: SqlAssessmentV3Operations_Create_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlAssessmentV3OperationsCreateMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlAssessmentV3Operations() + .define("assessmentName") + .withExistingAssessmentProject("rgsqlAssessments", "contosoProject") + .withProperties(new SqlAssessmentV3Properties() + .withScope(new Scope().withScopeType(ScopeType.SERVER_GROUP_ID) + .withServerGroupId("ppxcjyrxfmpm") + .withAzureResourceGraphQuery("ddqs")) + .withSettings(new SqlAssessmentSettings().withAzureLocation("vtpazagckatiezkiwol") + .withCurrency(AzureCurrency.UNKNOWN) + .withScalingFactor(27.0F) + .withDiscountPercentage(8.0F) + .withSizingCriterion(AssessmentSizingCriterion.PERFORMANCE_BASED) + .withPerformanceData(new PerformanceData().withPercentile(Percentile.fromString("Unknown")) + .withTimeRange(TimeRange.DAY) + .withPerfDataStartTime(OffsetDateTime.parse("2025-02-21T05:15:28.133Z")) + .withPerfDataEndTime(OffsetDateTime.parse("2025-02-21T05:15:28.133Z"))) + .withSavingsSettings(new SavingsSettings().withSavingsOptions(SavingsOptions.NONE) + .withAzureOfferCode(AzureOffer.UNKNOWN)) + .withBillingSettings( + new BillingSettings().withLicensingProgram(LicensingProgram.RETAIL).withSubscriptionId("sp")) + .withEnvironmentType(EnvironmentType.PRODUCTION) + .withOsLicense(OsLicense.UNKNOWN) + .withEntityUptime(new EntityUptime().withDaysPerMonth(2).withHoursPerDay(28)) + .withPreferredTargets(Arrays.asList(AzureTarget.UNKNOWN)) + .withAzureSqlManagedInstanceSettings( + new SqlMiSettingsV3().withAzureSqlServiceTier(AzureSqlServiceTierV3.SQL_SERVICE_UNKNOWN) + .withAzureSqlInstanceType(AzureSqlInstanceType.UNKNOWN)) + .withAzureSqlDatabaseSettings( + new SqlDbSettingsV3().withAzureSqlServiceTier(AzureSqlServiceTierV3.SQL_SERVICE_UNKNOWN) + .withAzureSqlDataBaseType(AzureSqlDataBaseType.UNKNOWN) + .withAzureSqlComputeTier(ComputeTier.UNKNOWN) + .withAzureSqlPurchaseModel(AzureSqlPurchaseModel.UNKNOWN)) + .withAzureSqlVmSettings( + new SqlVmSettings().withInstanceSeries(Arrays.asList(AzureVmFamily.UNKNOWN))) + .withMultiSubnetIntent(MultiSubnetIntent.NONE) + .withAsyncCommitModeIntent(AsyncCommitModeIntent.NONE) + .withIsInternetAccessAvailable(true) + .withDisasterRecoveryLocation(AzureLocation.UNKNOWN) + .withEnableHadrAssessment(true) + .withAzureSecurityOfferingType(AzureSecurityOfferingType.NO) + .withSqlServerLicense(SqlServerLicense.UNKNOWN)) + .withDetails(new AssessmentDetails()) + .withFallbackMachineAssessmentArmId("jfwkifsuigza")) + .create(); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3OperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3OperationsDeleteSamples.java new file mode 100644 index 000000000000..54603e55f45c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3OperationsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for SqlAssessmentV3Operations Delete. + */ +public final class SqlAssessmentV3OperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlAssessmentV3Operations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: SqlAssessmentV3Operations_Delete_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlAssessmentV3OperationsDeleteMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlAssessmentV3Operations() + .deleteWithResponse("rgsqlAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3OperationsDownloadUrlSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3OperationsDownloadUrlSamples.java new file mode 100644 index 000000000000..c3d22272e605 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3OperationsDownloadUrlSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for SqlAssessmentV3Operations DownloadUrl. + */ +public final class SqlAssessmentV3OperationsDownloadUrlSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlAssessmentV3Operations_DownloadUrl_MaximumSet_Gen.json + */ + /** + * Sample code: Get download URL for the assessment report. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void getDownloadURLForTheAssessmentReport( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { + manager.sqlAssessmentV3Operations() + .downloadUrl("rgsqlAssessments", "contosoProject", "assessmentName", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3OperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3OperationsGetSamples.java new file mode 100644 index 000000000000..c7f74be6e30c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3OperationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for SqlAssessmentV3Operations Get. + */ +public final class SqlAssessmentV3OperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlAssessmentV3Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: SqlAssessmentV3Operations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlAssessmentV3OperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlAssessmentV3Operations() + .getWithResponse("rgsqlAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3OperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3OperationsListByParentSamples.java new file mode 100644 index 000000000000..db7abc628d74 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3OperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for SqlAssessmentV3Operations ListByParent. + */ +public final class SqlAssessmentV3OperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlAssessmentV3Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: SqlAssessmentV3Operations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlAssessmentV3OperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlAssessmentV3Operations() + .listByParent("rgsqlAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3SummaryOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3SummaryOperationsGetSamples.java new file mode 100644 index 000000000000..2343ed672b1a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3SummaryOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for SqlAssessmentV3SummaryOperations Get. + */ +public final class SqlAssessmentV3SummaryOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: SqlAssessmentV3SummaryOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlAssessmentV3SummaryOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlAssessmentV3SummaryOperations() + .getWithResponse("rgsqlAssessments", "contosoProject", "assessmentName", "PaaSPreferred", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3SummaryOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3SummaryOperationsListByParentSamples.java new file mode 100644 index 000000000000..e9f4ae6ce93c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV3SummaryOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for SqlAssessmentV3SummaryOperations ListByParent. + */ +public final class SqlAssessmentV3SummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlAssessmentV3SummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: SqlAssessmentV3SummaryOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlAssessmentV3SummaryOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlAssessmentV3SummaryOperations() + .listByParent("rgsqlAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsCreateSamples.java index c226a9dabbdc..098f12391eb8 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsCreateSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsCreateSamples.java @@ -14,15 +14,15 @@ public final class SqlCollectorOperationsCreateSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * SqlCollectorOperations_Create_MaximumSet_Gen.json */ /** - * Sample code: SqlCollectorOperations_Create_MaximumSet_Gen. + * Sample code: SqlCollectorOperations_Create. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void sqlCollectorOperationsCreateMaximumSetGen( + public static void sqlCollectorOperationsCreate( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.sqlCollectorOperations() .define("fci-test0c1esqlsitecollector") diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsDeleteSamples.java index 1a7627fbbb63..6e93c86b8d0f 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsDeleteSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsDeleteSamples.java @@ -10,15 +10,15 @@ public final class SqlCollectorOperationsDeleteSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * SqlCollectorOperations_Delete_MaximumSet_Gen.json */ /** - * Sample code: SqlCollectorOperations_Delete_MaximumSet_Gen. + * Sample code: SqlCollectorOperations_Delete. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void sqlCollectorOperationsDeleteMaximumSetGen( + public static void sqlCollectorOperationsDelete( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.sqlCollectorOperations() .deleteWithResponse("rgmigrate", "fci-test6904project", "fci-test0c1esqlsitecollector", diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsGetSamples.java index b86ea4aa872f..a8c07662b44c 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsGetSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsGetSamples.java @@ -10,16 +10,16 @@ public final class SqlCollectorOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * SqlCollectorOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: SqlCollectorOperations_Get_MaximumSet_Gen. + * Sample code: SqlCollectorOperations_Get. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void sqlCollectorOperationsGetMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + public static void + sqlCollectorOperationsGet(com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.sqlCollectorOperations() .getWithResponse("rgmigrate", "fci-test6904project", "fci-test0c1esqlsitecollector", com.azure.core.util.Context.NONE); diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsListByAssessmentProjectSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsListByAssessmentProjectSamples.java deleted file mode 100644 index 862991feb6df..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsListByAssessmentProjectSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for SqlCollectorOperations ListByAssessmentProject. - */ -public final class SqlCollectorOperationsListByAssessmentProjectSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * SqlCollectorOperations_ListByAssessmentProject_MaximumSet_Gen.json - */ - /** - * Sample code: SqlCollectorOperations_ListByAssessmentProject_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void sqlCollectorOperationsListByAssessmentProjectMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.sqlCollectorOperations() - .listByAssessmentProject("rgmigrate", "fci-test6904project", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsListByParentSamples.java new file mode 100644 index 000000000000..416b7114c0a7 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for SqlCollectorOperations ListByParent. + */ +public final class SqlCollectorOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlCollectorOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: SqlCollectorOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlCollectorOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlCollectorOperations() + .listByParent("rgmigrate", "fci-test6904project", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlGraphAssessmentOptionsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlGraphAssessmentOptionsOperationsGetSamples.java new file mode 100644 index 000000000000..4e6418d18491 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlGraphAssessmentOptionsOperationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for SqlGraphAssessmentOptionsOperations Get. + */ +public final class SqlGraphAssessmentOptionsOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: SqlGraphAssessmentOptionsOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlGraphAssessmentOptionsOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlGraphAssessmentOptionsOperations() + .getWithResponse("rgsqlAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlGraphAssessmentOptionsOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlGraphAssessmentOptionsOperationsListByParentSamples.java new file mode 100644 index 000000000000..fcf778b5e16e --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/SqlGraphAssessmentOptionsOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for SqlGraphAssessmentOptionsOperations ListByParent. + */ +public final class SqlGraphAssessmentOptionsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * SqlGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: SqlGraphAssessmentOptionsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void sqlGraphAssessmentOptionsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.sqlGraphAssessmentOptionsOperations() + .listByParent("rgsqlAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsCreateSamples.java index dfea5c739234..9f8a600f5876 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsCreateSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsCreateSamples.java @@ -7,7 +7,6 @@ import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; import java.time.OffsetDateTime; /** @@ -16,20 +15,20 @@ public final class VmwareCollectorsOperationsCreateSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * VmwareCollectorsOperations_Create_MaximumSet_Gen.json */ /** - * Sample code: VmwareCollectorsOperations_Create_MaximumSet_Gen. + * Sample code: VmwareCollectorsOperations_Create. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void vmwareCollectorsOperationsCreateMaximumSetGen( + public static void vmwareCollectorsOperationsCreate( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.vmwareCollectorsOperations() .define("Vmware2258collector") .withExistingAssessmentProject("ayagrawRG", "app18700project") - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.SUCCEEDED) + .withProperties(new CollectorPropertiesBaseWithAgent() .withAgentProperties(new CollectorAgentPropertiesBase().withId("fe243486-3318-41fa-aaba-c48b5df75308") .withVersion("1.0.8.383") .withLastHeartbeatUtc(OffsetDateTime.parse("2022-03-29T12:10:08.9167289Z")) diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsDeleteSamples.java index 6899e3f9c5ac..724e6d544030 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsDeleteSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsDeleteSamples.java @@ -10,15 +10,15 @@ public final class VmwareCollectorsOperationsDeleteSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * VmwareCollectorsOperations_Delete_MaximumSet_Gen.json */ /** - * Sample code: VmwareCollectorsOperations_Delete_MaximumSet_Gen. + * Sample code: VmwareCollectorsOperations_Delete. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void vmwareCollectorsOperationsDeleteMaximumSetGen( + public static void vmwareCollectorsOperationsDelete( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.vmwareCollectorsOperations() .deleteWithResponse("ayagrawRG", "app18700project", "Vmware2258collector", diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsGetSamples.java index 2adc71019f10..e0ccb31a095a 100644 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsGetSamples.java +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsGetSamples.java @@ -10,15 +10,15 @@ public final class VmwareCollectorsOperationsGetSamples { /* * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ * VmwareCollectorsOperations_Get_MaximumSet_Gen.json */ /** - * Sample code: VmwareCollectorsOperations_Get_MaximumSet_Gen. + * Sample code: VmwareCollectorsOperations_Get. * * @param manager Entry point to MigrationAssessmentManager. */ - public static void vmwareCollectorsOperationsGetMaximumSetGen( + public static void vmwareCollectorsOperationsGet( com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { manager.vmwareCollectorsOperations() .getWithResponse("ayagrawRG", "app18700project", "Vmware2258collector", com.azure.core.util.Context.NONE); diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsListByAssessmentProjectSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsListByAssessmentProjectSamples.java deleted file mode 100644 index 4d34357d7b49..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsListByAssessmentProjectSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -/** - * Samples for VmwareCollectorsOperations ListByAssessmentProject. - */ -public final class VmwareCollectorsOperationsListByAssessmentProjectSamples { - /* - * x-ms-original-file: - * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ - * VmwareCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen.json - */ - /** - * Sample code: VmwareCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen. - * - * @param manager Entry point to MigrationAssessmentManager. - */ - public static void vmwareCollectorsOperationsListByAssessmentProjectMaximumSetGen( - com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { - manager.vmwareCollectorsOperations() - .listByAssessmentProject("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsListByParentSamples.java new file mode 100644 index 000000000000..3bf829a76c74 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for VmwareCollectorsOperations ListByParent. + */ +public final class VmwareCollectorsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * VmwareCollectorsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: VmwareCollectorsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void vmwareCollectorsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.vmwareCollectorsOperations() + .listByParent("ayagrawRG", "app18700project", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3OperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3OperationsCreateSamples.java new file mode 100644 index 000000000000..3cee8c9df4a4 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3OperationsCreateSamples.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.resourcemanager.migration.assessment.models.AppSvcContainerSettings; +import com.azure.resourcemanager.migration.assessment.models.AppSvcNativeSettings; +import com.azure.resourcemanager.migration.assessment.models.AssessmentDetails; +import com.azure.resourcemanager.migration.assessment.models.AssessmentSizingCriterion; +import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; +import com.azure.resourcemanager.migration.assessment.models.AzureOffer; +import com.azure.resourcemanager.migration.assessment.models.AzureSecurityOfferingType; +import com.azure.resourcemanager.migration.assessment.models.BillingSettings; +import com.azure.resourcemanager.migration.assessment.models.EnvironmentType; +import com.azure.resourcemanager.migration.assessment.models.LicensingProgram; +import com.azure.resourcemanager.migration.assessment.models.Percentile; +import com.azure.resourcemanager.migration.assessment.models.PerformanceData; +import com.azure.resourcemanager.migration.assessment.models.SavingsOptions; +import com.azure.resourcemanager.migration.assessment.models.SavingsSettings; +import com.azure.resourcemanager.migration.assessment.models.Scope; +import com.azure.resourcemanager.migration.assessment.models.ScopeType; +import com.azure.resourcemanager.migration.assessment.models.TimeRange; +import com.azure.resourcemanager.migration.assessment.models.WebAppAssessmentSettings; +import com.azure.resourcemanager.migration.assessment.models.WebAppAssessmentV3Properties; +import java.time.OffsetDateTime; + +/** + * Samples for WebAppAssessmentV3Operations Create. + */ +public final class WebAppAssessmentV3OperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppAssessmentV3Operations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppAssessmentV3Operations_Create_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppAssessmentV3OperationsCreateMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.webAppAssessmentV3Operations() + .define("assessmentName") + .withExistingAssessmentProject("rgwebAppAssessments", "contosoProject") + .withProperties(new WebAppAssessmentV3Properties() + .withScope(new Scope().withScopeType(ScopeType.SERVER_GROUP_ID) + .withServerGroupId("sxwigkygd") + .withAzureResourceGraphQuery("mjonozzzflcglhdb")) + .withSettings(new WebAppAssessmentSettings().withAzureLocation("khzvggbrcnpkzrqdtvvyytc") + .withCurrency(AzureCurrency.UNKNOWN) + .withScalingFactor(6.0F) + .withDiscountPercentage(12.0F) + .withSizingCriterion(AssessmentSizingCriterion.PERFORMANCE_BASED) + .withPerformanceData(new PerformanceData().withPercentile(Percentile.fromString("Unknown")) + .withTimeRange(TimeRange.DAY) + .withPerfDataStartTime(OffsetDateTime.parse("2025-02-21T06:18:34.789Z")) + .withPerfDataEndTime(OffsetDateTime.parse("2025-02-21T06:18:34.789Z"))) + .withSavingsSettings(new SavingsSettings().withSavingsOptions(SavingsOptions.NONE) + .withAzureOfferCode(AzureOffer.UNKNOWN)) + .withBillingSettings(new BillingSettings().withLicensingProgram(LicensingProgram.RETAIL) + .withSubscriptionId("lakvxkjeqpajer")) + .withEnvironmentType(EnvironmentType.PRODUCTION) + .withAppSvcNativeSettings(new AppSvcNativeSettings().withIsolationRequired(true)) + .withAppSvcContainerSettings(new AppSvcContainerSettings().withIsolationRequired(true)) + .withAzureSecurityOfferingType(AzureSecurityOfferingType.NO)) + .withDetails(new AssessmentDetails()) + .withFallbackMachineAssessmentArmId("gfjcubgnh")) + .create(); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3OperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3OperationsDeleteSamples.java new file mode 100644 index 000000000000..8faf8e5ac783 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3OperationsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for WebAppAssessmentV3Operations Delete. + */ +public final class WebAppAssessmentV3OperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppAssessmentV3Operations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppAssessmentV3Operations_Delete_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppAssessmentV3OperationsDeleteMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.webAppAssessmentV3Operations() + .deleteWithResponse("rgwebAppAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3OperationsDownloadUrlSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3OperationsDownloadUrlSamples.java new file mode 100644 index 000000000000..21ee1e42ad3c --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3OperationsDownloadUrlSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for WebAppAssessmentV3Operations DownloadUrl. + */ +public final class WebAppAssessmentV3OperationsDownloadUrlSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppAssessmentV3Operations_DownloadUrl_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppAssessmentV3Operations_DownloadUrl_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppAssessmentV3OperationsDownloadUrlMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) throws IOException { + manager.webAppAssessmentV3Operations() + .downloadUrl("rgwebAppAssessments", "contosoProject", "assessmentName", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3OperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3OperationsGetSamples.java new file mode 100644 index 000000000000..e1e6f2bb5e26 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3OperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for WebAppAssessmentV3Operations Get. + */ +public final class WebAppAssessmentV3OperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppAssessmentV3Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppAssessmentV3Operations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppAssessmentV3OperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.webAppAssessmentV3Operations() + .getWithResponse("rgwebAppAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3OperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3OperationsListByParentSamples.java new file mode 100644 index 000000000000..83506817dfcc --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3OperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for WebAppAssessmentV3Operations ListByParent. + */ +public final class WebAppAssessmentV3OperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppAssessmentV3Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppAssessmentV3Operations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppAssessmentV3OperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.webAppAssessmentV3Operations() + .listByParent("rgwebAppAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3SummaryOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3SummaryOperationsGetSamples.java new file mode 100644 index 000000000000..0b5461f820b5 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3SummaryOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for WebAppAssessmentV3SummaryOperations Get. + */ +public final class WebAppAssessmentV3SummaryOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppAssessmentV3SummaryOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppAssessmentV3SummaryOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.webAppAssessmentV3SummaryOperations() + .getWithResponse("rgwebAppAssessments", "contosoProject", "assessmentName", "PaaSPreferred", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3SummaryOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3SummaryOperationsListByParentSamples.java new file mode 100644 index 000000000000..ec13123ced93 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppAssessmentV3SummaryOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for WebAppAssessmentV3SummaryOperations ListByParent. + */ +public final class WebAppAssessmentV3SummaryOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppAssessmentV3SummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppAssessmentV3SummaryOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppAssessmentV3SummaryOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.webAppAssessmentV3SummaryOperations() + .listByParent("rgwebAppAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppCollectorOperationsCreateSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppCollectorOperationsCreateSamples.java new file mode 100644 index 000000000000..7d4ef84acd27 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppCollectorOperationsCreateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; +import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; +import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; +import java.time.OffsetDateTime; + +/** + * Samples for WebAppCollectorOperations Create. + */ +public final class WebAppCollectorOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppCollectorOperations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppCollectorOperations_Create. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppCollectorOperationsCreate( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.webAppCollectorOperations() + .define("collector1") + .withExistingAssessmentProject("rgopenapi", "sumukk-ccy-bcs4557project") + .withProperties(new CollectorPropertiesBaseWithAgent() + .withAgentProperties( + new CollectorAgentPropertiesBase().withId("fed93df5-b787-4e3f-a764-e3d2b9101a59-agent") + .withLastHeartbeatUtc(OffsetDateTime.parse("2023-11-03T05:43:02.078Z")) + .withSpnDetails(new CollectorAgentSpnPropertiesBase() + .withAuthority("https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47") + .withApplicationId("2f70d5e8-7adc-4c64-910a-7031079efc6e") + .withAudience("2f70d5e8-7adc-4c64-910a-7031079efc6e") + .withObjectId("2f70d5e8-7adc-4c64-910a-7031079efc6e") + .withTenantId("2f70d5e8-7adc-4c64-910a-7031079efc6e"))) + .withDiscoverySiteId( + "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sumukk-ccy-bcs/providers/Microsoft.OffAzure/MasterSites/sumukk-ccy-bcs9880mastersite/WebAppSites/sumukk-ccy-bcs9880webappsites")) + .create(); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppCollectorOperationsDeleteSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppCollectorOperationsDeleteSamples.java new file mode 100644 index 000000000000..47fc29831280 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppCollectorOperationsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for WebAppCollectorOperations Delete. + */ +public final class WebAppCollectorOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppCollectorOperations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppCollectorOperations_Delete. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppCollectorOperationsDelete( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.webAppCollectorOperations() + .deleteWithResponse("rgopenapi", "sumukk-ccy-bcs4557project", "collector1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppCollectorOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppCollectorOperationsGetSamples.java new file mode 100644 index 000000000000..f20faafc66d5 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppCollectorOperationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for WebAppCollectorOperations Get. + */ +public final class WebAppCollectorOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppCollectorOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppCollectorOperations_Get. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppCollectorOperationsGet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.webAppCollectorOperations() + .getWithResponse("rgopenapi", "sumukk-ccy-bcs4557project", "collector1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppCollectorOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppCollectorOperationsListByParentSamples.java new file mode 100644 index 000000000000..9e6e53cb488a --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppCollectorOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for WebAppCollectorOperations ListByParent. + */ +public final class WebAppCollectorOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppCollectorOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppCollectorOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppCollectorOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.webAppCollectorOperations() + .listByParent("rgopenapi", "sumukk-ccy-bcs4557project", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppGraphAssessmentOptionsOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppGraphAssessmentOptionsOperationsGetSamples.java new file mode 100644 index 000000000000..9f5e04db2465 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppGraphAssessmentOptionsOperationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for WebAppGraphAssessmentOptionsOperations Get. + */ +public final class WebAppGraphAssessmentOptionsOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppGraphAssessmentOptionsOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppGraphAssessmentOptionsOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.webAppGraphAssessmentOptionsOperations() + .getWithResponse("rgwebAppAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppGraphAssessmentOptionsOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppGraphAssessmentOptionsOperationsListByParentSamples.java new file mode 100644 index 000000000000..51e775a4fb42 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppGraphAssessmentOptionsOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for WebAppGraphAssessmentOptionsOperations ListByParent. + */ +public final class WebAppGraphAssessmentOptionsOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppGraphAssessmentOptionsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppGraphAssessmentOptionsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.webAppGraphAssessmentOptionsOperations() + .listByParent("rgwebAppAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppServicePlansOperationsGetSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppServicePlansOperationsGetSamples.java new file mode 100644 index 000000000000..480a65fc4489 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppServicePlansOperationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for WebAppServicePlansOperations Get. + */ +public final class WebAppServicePlansOperationsGetSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppServicePlansOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppServicePlansOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppServicePlansOperationsGetMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.webAppServicePlansOperations() + .getWithResponse("rgwebAppAssessments", "contosoProject", "assessmentName", "sp1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppServicePlansOperationsListByParentSamples.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppServicePlansOperationsListByParentSamples.java new file mode 100644 index 000000000000..9f23bf3a8f44 --- /dev/null +++ b/sdk/migration/azure-resourcemanager-migration-assessment/src/samples/java/com/azure/resourcemanager/migration/assessment/generated/WebAppServicePlansOperationsListByParentSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migration.assessment.generated; + +/** + * Samples for WebAppServicePlansOperations ListByParent. + */ +public final class WebAppServicePlansOperationsListByParentSamples { + /* + * x-ms-original-file: + * specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-03-03-preview/examples/ + * WebAppServicePlansOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: WebAppServicePlansOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrationAssessmentManager. + */ + public static void webAppServicePlansOperationsListByParentMaximumSet( + com.azure.resourcemanager.migration.assessment.MigrationAssessmentManager manager) { + manager.webAppServicePlansOperations() + .listByParent("rgwebAppAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedDiskDataTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedDiskDataTests.java deleted file mode 100644 index e1ab33884bfc..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedDiskDataTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AssessedDiskData; -import com.azure.resourcemanager.migration.assessment.models.AzureDiskSize; -import com.azure.resourcemanager.migration.assessment.models.AzureDiskSuitabilityDetail; -import com.azure.resourcemanager.migration.assessment.models.AzureDiskSuitabilityExplanation; -import com.azure.resourcemanager.migration.assessment.models.AzureDiskType; -import com.azure.resourcemanager.migration.assessment.models.CloudSuitability; -import org.junit.jupiter.api.Assertions; - -public final class AssessedDiskDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessedDiskData model = BinaryData.fromString( - "{\"suitability\":\"NotSuitable\",\"suitabilityExplanation\":\"NoEaPriceFoundForDiskSize\",\"suitabilityDetail\":\"MegabytesPerSecondOfWriteOutOfRange\",\"recommendedDiskSize\":\"StandardSSD_E1\",\"recommendedDiskType\":\"PremiumV2\",\"recommendedDiskSizeGigabytes\":1924185709,\"recommendDiskThroughputInMbps\":77.596115,\"recommendedDiskIops\":28.821247,\"monthlyStorageCost\":46.197742,\"name\":\"cgx\",\"displayName\":\"csserxht\",\"gigabytesProvisioned\":27.112644,\"megabytesPerSecondOfRead\":51.11168,\"megabytesPerSecondOfWrite\":64.434204,\"numberOfReadOperationsPerSecond\":45.264824,\"numberOfWriteOperationsPerSecond\":3.874898}") - .toObject(AssessedDiskData.class); - Assertions.assertEquals(CloudSuitability.NOT_SUITABLE, model.suitability()); - Assertions.assertEquals(AzureDiskSuitabilityExplanation.NO_EA_PRICE_FOUND_FOR_DISK_SIZE, - model.suitabilityExplanation()); - Assertions.assertEquals(AzureDiskSuitabilityDetail.MEGABYTES_PER_SECOND_OF_WRITE_OUT_OF_RANGE, - model.suitabilityDetail()); - Assertions.assertEquals(AzureDiskSize.STANDARD_SSD_E1, model.recommendedDiskSize()); - Assertions.assertEquals(AzureDiskType.PREMIUM_V2, model.recommendedDiskType()); - Assertions.assertEquals(1924185709, model.recommendedDiskSizeGigabytes()); - Assertions.assertEquals(77.596115F, model.recommendDiskThroughputInMbps()); - Assertions.assertEquals(28.821247F, model.recommendedDiskIops()); - Assertions.assertEquals(46.197742F, model.monthlyStorageCost()); - Assertions.assertEquals("cgx", model.name()); - Assertions.assertEquals("csserxht", model.displayName()); - Assertions.assertEquals(27.112644F, model.gigabytesProvisioned()); - Assertions.assertEquals(51.11168F, model.megabytesPerSecondOfRead()); - Assertions.assertEquals(64.434204F, model.megabytesPerSecondOfWrite()); - Assertions.assertEquals(45.264824F, model.numberOfReadOperationsPerSecond()); - Assertions.assertEquals(3.874898F, model.numberOfWriteOperationsPerSecond()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessedDiskData model = new AssessedDiskData().withSuitability(CloudSuitability.NOT_SUITABLE) - .withSuitabilityExplanation(AzureDiskSuitabilityExplanation.NO_EA_PRICE_FOUND_FOR_DISK_SIZE) - .withSuitabilityDetail(AzureDiskSuitabilityDetail.MEGABYTES_PER_SECOND_OF_WRITE_OUT_OF_RANGE) - .withRecommendedDiskSize(AzureDiskSize.STANDARD_SSD_E1) - .withRecommendedDiskType(AzureDiskType.PREMIUM_V2) - .withRecommendedDiskSizeGigabytes(1924185709) - .withRecommendDiskThroughputInMbps(77.596115F) - .withRecommendedDiskIops(28.821247F) - .withMonthlyStorageCost(46.197742F) - .withName("cgx") - .withDisplayName("csserxht") - .withGigabytesProvisioned(27.112644F) - .withMegabytesPerSecondOfRead(51.11168F) - .withMegabytesPerSecondOfWrite(64.434204F) - .withNumberOfReadOperationsPerSecond(45.264824F) - .withNumberOfWriteOperationsPerSecond(3.874898F); - model = BinaryData.fromObject(model).toObject(AssessedDiskData.class); - Assertions.assertEquals(CloudSuitability.NOT_SUITABLE, model.suitability()); - Assertions.assertEquals(AzureDiskSuitabilityExplanation.NO_EA_PRICE_FOUND_FOR_DISK_SIZE, - model.suitabilityExplanation()); - Assertions.assertEquals(AzureDiskSuitabilityDetail.MEGABYTES_PER_SECOND_OF_WRITE_OUT_OF_RANGE, - model.suitabilityDetail()); - Assertions.assertEquals(AzureDiskSize.STANDARD_SSD_E1, model.recommendedDiskSize()); - Assertions.assertEquals(AzureDiskType.PREMIUM_V2, model.recommendedDiskType()); - Assertions.assertEquals(1924185709, model.recommendedDiskSizeGigabytes()); - Assertions.assertEquals(77.596115F, model.recommendDiskThroughputInMbps()); - Assertions.assertEquals(28.821247F, model.recommendedDiskIops()); - Assertions.assertEquals(46.197742F, model.monthlyStorageCost()); - Assertions.assertEquals("cgx", model.name()); - Assertions.assertEquals("csserxht", model.displayName()); - Assertions.assertEquals(27.112644F, model.gigabytesProvisioned()); - Assertions.assertEquals(51.11168F, model.megabytesPerSecondOfRead()); - Assertions.assertEquals(64.434204F, model.megabytesPerSecondOfWrite()); - Assertions.assertEquals(45.264824F, model.numberOfReadOperationsPerSecond()); - Assertions.assertEquals(3.874898F, model.numberOfWriteOperationsPerSecond()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedDiskTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedDiskTests.java deleted file mode 100644 index 206206e931f7..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedDiskTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AssessedDisk; -import com.azure.resourcemanager.migration.assessment.models.AzureDiskSize; -import com.azure.resourcemanager.migration.assessment.models.AzureDiskSuitabilityDetail; -import com.azure.resourcemanager.migration.assessment.models.AzureDiskSuitabilityExplanation; -import com.azure.resourcemanager.migration.assessment.models.AzureDiskType; -import com.azure.resourcemanager.migration.assessment.models.CloudSuitability; -import org.junit.jupiter.api.Assertions; - -public final class AssessedDiskTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessedDisk model = BinaryData.fromString( - "{\"suitability\":\"Unknown\",\"suitabilityExplanation\":\"NoDiskSizeFoundForSelectedRedundancy\",\"suitabilityDetail\":\"MegabytesPerSecondOfWriteMissing\",\"recommendedDiskSize\":\"Premium_P1\",\"recommendedDiskType\":\"StandardOrPremium\",\"gigabytesForRecommendedDiskSize\":1182920658,\"recommendDiskThroughputInMbps\":6.1038675,\"recommendedDiskIops\":32.54612,\"monthlyStorageCost\":30.48998,\"name\":\"qkacewii\",\"displayName\":\"pubjibw\",\"gigabytesProvisioned\":5.9326353,\"megabytesPerSecondOfRead\":86.60929,\"megabytesPerSecondOfWrite\":90.61733,\"numberOfReadOperationsPerSecond\":31.865799,\"numberOfWriteOperationsPerSecond\":99.55644}") - .toObject(AssessedDisk.class); - Assertions.assertEquals(CloudSuitability.UNKNOWN, model.suitability()); - Assertions.assertEquals(AzureDiskSuitabilityExplanation.NO_DISK_SIZE_FOUND_FOR_SELECTED_REDUNDANCY, - model.suitabilityExplanation()); - Assertions.assertEquals(AzureDiskSuitabilityDetail.MEGABYTES_PER_SECOND_OF_WRITE_MISSING, - model.suitabilityDetail()); - Assertions.assertEquals(AzureDiskSize.PREMIUM_P1, model.recommendedDiskSize()); - Assertions.assertEquals(AzureDiskType.STANDARD_OR_PREMIUM, model.recommendedDiskType()); - Assertions.assertEquals(1182920658, model.gigabytesForRecommendedDiskSize()); - Assertions.assertEquals(6.1038675F, model.recommendDiskThroughputInMbps()); - Assertions.assertEquals(32.54612F, model.recommendedDiskIops()); - Assertions.assertEquals(30.48998F, model.monthlyStorageCost()); - Assertions.assertEquals("qkacewii", model.name()); - Assertions.assertEquals("pubjibw", model.displayName()); - Assertions.assertEquals(5.9326353F, model.gigabytesProvisioned()); - Assertions.assertEquals(86.60929F, model.megabytesPerSecondOfRead()); - Assertions.assertEquals(90.61733F, model.megabytesPerSecondOfWrite()); - Assertions.assertEquals(31.865799F, model.numberOfReadOperationsPerSecond()); - Assertions.assertEquals(99.55644F, model.numberOfWriteOperationsPerSecond()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessedDisk model = new AssessedDisk().withSuitability(CloudSuitability.UNKNOWN) - .withSuitabilityExplanation(AzureDiskSuitabilityExplanation.NO_DISK_SIZE_FOUND_FOR_SELECTED_REDUNDANCY) - .withSuitabilityDetail(AzureDiskSuitabilityDetail.MEGABYTES_PER_SECOND_OF_WRITE_MISSING) - .withRecommendedDiskSize(AzureDiskSize.PREMIUM_P1) - .withRecommendedDiskType(AzureDiskType.STANDARD_OR_PREMIUM) - .withGigabytesForRecommendedDiskSize(1182920658) - .withRecommendDiskThroughputInMbps(6.1038675F) - .withRecommendedDiskIops(32.54612F) - .withMonthlyStorageCost(30.48998F) - .withName("qkacewii") - .withDisplayName("pubjibw") - .withGigabytesProvisioned(5.9326353F) - .withMegabytesPerSecondOfRead(86.60929F) - .withMegabytesPerSecondOfWrite(90.61733F) - .withNumberOfReadOperationsPerSecond(31.865799F) - .withNumberOfWriteOperationsPerSecond(99.55644F); - model = BinaryData.fromObject(model).toObject(AssessedDisk.class); - Assertions.assertEquals(CloudSuitability.UNKNOWN, model.suitability()); - Assertions.assertEquals(AzureDiskSuitabilityExplanation.NO_DISK_SIZE_FOUND_FOR_SELECTED_REDUNDANCY, - model.suitabilityExplanation()); - Assertions.assertEquals(AzureDiskSuitabilityDetail.MEGABYTES_PER_SECOND_OF_WRITE_MISSING, - model.suitabilityDetail()); - Assertions.assertEquals(AzureDiskSize.PREMIUM_P1, model.recommendedDiskSize()); - Assertions.assertEquals(AzureDiskType.STANDARD_OR_PREMIUM, model.recommendedDiskType()); - Assertions.assertEquals(1182920658, model.gigabytesForRecommendedDiskSize()); - Assertions.assertEquals(6.1038675F, model.recommendDiskThroughputInMbps()); - Assertions.assertEquals(32.54612F, model.recommendedDiskIops()); - Assertions.assertEquals(30.48998F, model.monthlyStorageCost()); - Assertions.assertEquals("qkacewii", model.name()); - Assertions.assertEquals("pubjibw", model.displayName()); - Assertions.assertEquals(5.9326353F, model.gigabytesProvisioned()); - Assertions.assertEquals(86.60929F, model.megabytesPerSecondOfRead()); - Assertions.assertEquals(90.61733F, model.megabytesPerSecondOfWrite()); - Assertions.assertEquals(31.865799F, model.numberOfReadOperationsPerSecond()); - Assertions.assertEquals(99.55644F, model.numberOfWriteOperationsPerSecond()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedNetworkAdapterTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedNetworkAdapterTests.java deleted file mode 100644 index ed1764fcbbec..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedNetworkAdapterTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AssessedNetworkAdapter; -import com.azure.resourcemanager.migration.assessment.models.AzureNetworkAdapterSuitabilityDetail; -import com.azure.resourcemanager.migration.assessment.models.AzureNetworkAdapterSuitabilityExplanation; -import com.azure.resourcemanager.migration.assessment.models.CloudSuitability; -import org.junit.jupiter.api.Assertions; - -public final class AssessedNetworkAdapterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessedNetworkAdapter model = BinaryData.fromString( - "{\"suitability\":\"Unknown\",\"suitabilityDetail\":\"MegabytesOfDataRecievedOutOfRange\",\"suitabilityExplanation\":\"Unknown\",\"monthlyBandwidthCosts\":82.95103,\"netGigabytesTransmittedPerMonth\":64.28258,\"displayName\":\"mibzyhwitsmypyyn\",\"macAddress\":\"dpumnzgmw\",\"ipAddresses\":[\"abikns\",\"rgjhxb\",\"dtlwwrlkd\",\"tncvokot\"],\"megabytesPerSecondReceived\":14.993447,\"megabytesPerSecondTransmitted\":25.275595}") - .toObject(AssessedNetworkAdapter.class); - Assertions.assertEquals(CloudSuitability.UNKNOWN, model.suitability()); - Assertions.assertEquals(AzureNetworkAdapterSuitabilityDetail.MEGABYTES_OF_DATA_RECIEVED_OUT_OF_RANGE, - model.suitabilityDetail()); - Assertions.assertEquals(AzureNetworkAdapterSuitabilityExplanation.UNKNOWN, model.suitabilityExplanation()); - Assertions.assertEquals(82.95103F, model.monthlyBandwidthCosts()); - Assertions.assertEquals(64.28258F, model.netGigabytesTransmittedPerMonth()); - Assertions.assertEquals("mibzyhwitsmypyyn", model.displayName()); - Assertions.assertEquals("dpumnzgmw", model.macAddress()); - Assertions.assertEquals(14.993447F, model.megabytesPerSecondReceived()); - Assertions.assertEquals(25.275595F, model.megabytesPerSecondTransmitted()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessedNetworkAdapter model = new AssessedNetworkAdapter().withSuitability(CloudSuitability.UNKNOWN) - .withSuitabilityDetail(AzureNetworkAdapterSuitabilityDetail.MEGABYTES_OF_DATA_RECIEVED_OUT_OF_RANGE) - .withSuitabilityExplanation(AzureNetworkAdapterSuitabilityExplanation.UNKNOWN) - .withMonthlyBandwidthCosts(82.95103F) - .withNetGigabytesTransmittedPerMonth(64.28258F) - .withDisplayName("mibzyhwitsmypyyn") - .withMacAddress("dpumnzgmw") - .withMegabytesPerSecondReceived(14.993447F) - .withMegabytesPerSecondTransmitted(25.275595F); - model = BinaryData.fromObject(model).toObject(AssessedNetworkAdapter.class); - Assertions.assertEquals(CloudSuitability.UNKNOWN, model.suitability()); - Assertions.assertEquals(AzureNetworkAdapterSuitabilityDetail.MEGABYTES_OF_DATA_RECIEVED_OUT_OF_RANGE, - model.suitabilityDetail()); - Assertions.assertEquals(AzureNetworkAdapterSuitabilityExplanation.UNKNOWN, model.suitabilityExplanation()); - Assertions.assertEquals(82.95103F, model.monthlyBandwidthCosts()); - Assertions.assertEquals(64.28258F, model.netGigabytesTransmittedPerMonth()); - Assertions.assertEquals("mibzyhwitsmypyyn", model.displayName()); - Assertions.assertEquals("dpumnzgmw", model.macAddress()); - Assertions.assertEquals(14.993447F, model.megabytesPerSecondReceived()); - Assertions.assertEquals(25.275595F, model.megabytesPerSecondTransmitted()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2InnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2InnerTests.java deleted file mode 100644 index 081767b87ce8..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2InnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlDatabaseV2Inner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV2Properties; - -public final class AssessedSqlDatabaseV2InnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessedSqlDatabaseV2Inner model = BinaryData.fromString( - "{\"properties\":{\"recommendedAzureSqlTargetType\":\"AzureSqlManagedInstance\",\"recommendedSuitability\":\"ConditionallySuitableForSqlMI\",\"bufferCacheSizeInMB\":95.6737,\"productSupportStatus\":{\"currentVersion\":\"emhzrncsdtc\",\"servicePackStatus\":\"siypbs\",\"esuStatus\":\"ytguslf\",\"supportStatus\":\"dcygqukyhejhz\",\"eta\":581237500,\"currentEsuYear\":\"fpel\",\"mainstreamEndDate\":\"2021-01-25T06:01:21Z\",\"extendedSupportEndDate\":\"2021-12-10T20:32:17Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-01-11T13:41:06Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-08-16T07:12:35Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-02-05T20:48:24Z\"},\"azureSqlMISuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"Automatic\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Fsv2_series\",\"storageMaxSizeInMB\":12.180108,\"predictedDataSizeInMB\":5.453616,\"predictedLogSizeInMB\":36.356728,\"cores\":575939452,\"azureSqlTargetType\":\"AzureSqlDatabase\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"Fsv2_series\",\"storageMaxSizeInMB\":62.17856,\"predictedDataSizeInMB\":4.802215,\"predictedLogSizeInMB\":53.193123,\"cores\":1289831716,\"azureSqlTargetType\":\"AzureSqlManagedInstance\"},{\"azureSqlServiceTier\":\"BusinessCritical\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"DC_series\",\"storageMaxSizeInMB\":81.58153,\"predictedDataSizeInMB\":52.03357,\"predictedLogSizeInMB\":65.96141,\"cores\":1900639449,\"azureSqlTargetType\":\"AzureVirtualMachine\"},{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"Automatic\",\"storageMaxSizeInMB\":72.981895,\"predictedDataSizeInMB\":15.099293,\"predictedLogSizeInMB\":58.360874,\"cores\":424916927,\"azureSqlTargetType\":\"Recommended\"}],\"sharedResources\":{\"sharedDataDisks\":[{\"diskType\":\"StandardSSD\",\"diskSize\":\"StandardSSD_E80\",\"diskRedundancy\":\"LRS\",\"storageCost\":37.895233,\"recommendedSizeInGib\":19.479061,\"recommendedThroughputInMbps\":44.50355,\"recommendedIops\":75.07999},{\"diskType\":\"Standard\",\"diskSize\":\"StandardSSD_E3\",\"diskRedundancy\":\"Unknown\",\"storageCost\":94.36649,\"recommendedSizeInGib\":75.4705,\"recommendedThroughputInMbps\":77.55793,\"recommendedIops\":75.26911},{\"diskType\":\"Unknown\",\"diskSize\":\"Standard_S20\",\"diskRedundancy\":\"ZRS\",\"storageCost\":97.41935,\"recommendedSizeInGib\":40.128662,\"recommendedThroughputInMbps\":71.87891,\"recommendedIops\":60.886276}],\"sharedLogDisks\":[{\"diskType\":\"Standard\",\"diskSize\":\"Standard_S10\",\"diskRedundancy\":\"ZRS\",\"storageCost\":39.502205,\"recommendedSizeInGib\":43.626587,\"recommendedThroughputInMbps\":44.605457,\"recommendedIops\":72.386024}],\"sharedTempDbDisks\":[{\"diskType\":\"StandardSSD\",\"diskSize\":\"Standard_S50\",\"diskRedundancy\":\"LRS\",\"storageCost\":74.9261,\"recommendedSizeInGib\":11.313396,\"recommendedThroughputInMbps\":51.734554,\"recommendedIops\":34.290314}],\"numberOfMounts\":1155749150,\"quorumWitness\":{\"quorumWitnessType\":\"Disk\"}},\"monthlyComputeCost\":22.147728,\"monthlyStorageCost\":30.854982,\"costComponents\":[{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":5.4647923,\"description\":\"j\"},{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":76.01796,\"description\":\"zs\"},{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":85.62009,\"description\":\"ystawfsdjpvkvp\"}],\"securitySuitability\":\"Suitable\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"NotApplicable\",\"migrationGuidelines\":[{\"guidelineId\":\"vncjabudurgk\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"jk\",\"reasoningString\":\"fhmouwq\",\"reasoningCategory\":\"zrfze\",\"contextParameters\":[{},{},{}]},{\"reasoningId\":\"izikayuhq\",\"reasoningString\":\"jbsybbqw\",\"reasoningCategory\":\"t\",\"contextParameters\":[{},{}]}],\"migrationTargetPlatform\":\"AzureSqlVirtualMachine\",\"suitability\":\"NotSuitable\",\"migrationIssues\":[{\"issueId\":\"ipaslthaqfxssmwu\",\"issueCategory\":\"Warning\",\"impactedObjects\":[{},{}]},{\"issueId\":\"ezpdrhneu\",\"issueCategory\":\"Warning\",\"impactedObjects\":[{}]},{\"issueId\":\"wyt\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{},{}]},{\"issueId\":\"cgpik\",\"issueCategory\":\"Warning\",\"impactedObjects\":[{},{}]}]},\"azureSqlDBSuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"Automatic\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Fsv2_series\",\"storageMaxSizeInMB\":9.00774,\"predictedDataSizeInMB\":30.19936,\"predictedLogSizeInMB\":35.2318,\"cores\":944928815,\"azureSqlTargetType\":\"Recommended\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Unknown\",\"azureSqlHardwareGeneration\":\"Gen5\",\"storageMaxSizeInMB\":39.849525,\"predictedDataSizeInMB\":48.917915,\"predictedLogSizeInMB\":56.03118,\"cores\":1689158951,\"azureSqlTargetType\":\"AzureSqlManagedInstance\"}],\"sharedResources\":{\"sharedDataDisks\":[{\"diskType\":\"StandardOrPremium\",\"diskSize\":\"Premium_P10\",\"diskRedundancy\":\"Unknown\",\"storageCost\":14.39516,\"recommendedSizeInGib\":11.801916,\"recommendedThroughputInMbps\":96.64042,\"recommendedIops\":73.455444},{\"diskType\":\"PremiumV2\",\"diskSize\":\"StandardSSD_E80\",\"diskRedundancy\":\"LRS\",\"storageCost\":20.986683,\"recommendedSizeInGib\":37.539448,\"recommendedThroughputInMbps\":83.09367,\"recommendedIops\":85.45392}],\"sharedLogDisks\":[{\"diskType\":\"PremiumV2\",\"diskSize\":\"Premium_P60\",\"diskRedundancy\":\"LRS\",\"storageCost\":71.96245,\"recommendedSizeInGib\":71.89114,\"recommendedThroughputInMbps\":66.963486,\"recommendedIops\":16.782505},{\"diskType\":\"Standard\",\"diskSize\":\"Premium_P1\",\"diskRedundancy\":\"LRS\",\"storageCost\":80.275826,\"recommendedSizeInGib\":38.60216,\"recommendedThroughputInMbps\":11.96838,\"recommendedIops\":65.46099},{\"diskType\":\"Standard\",\"diskSize\":\"StandardSSD_E15\",\"diskRedundancy\":\"Unknown\",\"storageCost\":11.107027,\"recommendedSizeInGib\":82.047585,\"recommendedThroughputInMbps\":79.98476,\"recommendedIops\":10.109133},{\"diskType\":\"Premium\",\"diskSize\":\"Premium_P4\",\"diskRedundancy\":\"Unknown\",\"storageCost\":72.32076,\"recommendedSizeInGib\":31.32779,\"recommendedThroughputInMbps\":24.433767,\"recommendedIops\":16.203457}],\"sharedTempDbDisks\":[{\"diskType\":\"Unknown\",\"diskSize\":\"StandardSSD_E70\",\"diskRedundancy\":\"LRS\",\"storageCost\":47.469883,\"recommendedSizeInGib\":92.05685,\"recommendedThroughputInMbps\":15.483612,\"recommendedIops\":44.862534},{\"diskType\":\"PremiumV2\",\"diskSize\":\"Premium_P60\",\"diskRedundancy\":\"ZRS\",\"storageCost\":74.29807,\"recommendedSizeInGib\":89.42535,\"recommendedThroughputInMbps\":37.61905,\"recommendedIops\":66.83891}],\"numberOfMounts\":1490533084,\"quorumWitness\":{\"quorumWitnessType\":\"Disk\"}},\"monthlyComputeCost\":24.22722,\"monthlyStorageCost\":76.98546,\"costComponents\":[{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":12.315064,\"description\":\"hwhbotzingamv\"},{\"name\":\"Unknown\",\"value\":70.89071,\"description\":\"qzudphq\"}],\"securitySuitability\":\"ConditionallySuitable\",\"shouldProvisionReplicas\":false,\"skuReplicationMode\":\"NotApplicable\",\"migrationGuidelines\":[{\"guidelineId\":\"cvtbv\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{}]},{\"guidelineId\":\"nvyq\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{},{},{}]},{\"guidelineId\":\"pcnp\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{}]},{\"guidelineId\":\"sgvvsccyajguq\",\"migrationGuidelineCategory\":\"AvailabilityGroupGuideline\",\"migrationGuidelineContext\":[{},{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"dnkfx\",\"reasoningString\":\"emdwzrmuhapfc\",\"reasoningCategory\":\"psqxq\",\"contextParameters\":[{}]},{\"reasoningId\":\"uoymgccelvezry\",\"reasoningString\":\"lmfeokerq\",\"reasoningCategory\":\"yhko\",\"contextParameters\":[{}]}],\"migrationTargetPlatform\":\"AzureSqlVirtualMachine\",\"suitability\":\"Suitable\",\"migrationIssues\":[{\"issueId\":\"epbqpcrfkbw\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{},{}]},{\"issueId\":\"cdwxlpq\",\"issueCategory\":\"Warning\",\"impactedObjects\":[{},{},{}]},{\"issueId\":\"htjsying\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{},{},{}]}]},\"isDatabaseHighlyAvailable\":true,\"linkedAvailabilityGroupOverview\":{\"availabilityGroupId\":\"tmdvypgikdgs\",\"availabilityGroupName\":\"w\",\"sqlAvailabilityGroupSdsArmId\":\"irryuzhlh\",\"sqlAvailabilityGroupEntityId\":\"oqrvqqaatjin\",\"sqlAvailabilityReplicaId\":\"goupmfiibfg\"},\"machineArmId\":\"ioolvrwxkvtkkgll\",\"assessedSqlInstanceArmId\":\"jygvjayvbl\",\"machineName\":\"vkzuhbxvvyhgso\",\"instanceName\":\"yrqufegxuvwz\",\"databaseName\":\"nhlmctlpdng\",\"databaseSizeInMB\":31.674772,\"compatibilityLevel\":\"CompatLevel120\",\"sqlDatabaseSdsArmId\":\"hrixkwmy\",\"percentageCoresUtilization\":87.95895,\"megabytesPerSecondOfRead\":13.23821,\"megabytesPerSecondOfWrite\":32.000755,\"numberOfReadOperationsPerSecond\":77.848915,\"numberOfWriteOperationsPerSecond\":15.418476,\"confidenceRatingInPercentage\":82.512985,\"sizingCriterion\":\"AsOnPremises\",\"createdTimestamp\":\"2021-09-08T02:56:48Z\",\"updatedTimestamp\":\"2021-07-11T23:25:50Z\"},\"id\":\"dreaxh\",\"name\":\"exdrrvqahqkg\",\"type\":\"tpwijnh\"}") - .toObject(AssessedSqlDatabaseV2Inner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessedSqlDatabaseV2Inner model - = new AssessedSqlDatabaseV2Inner().withProperties(new AssessedSqlDatabaseV2Properties()); - model = BinaryData.fromObject(model).toObject(AssessedSqlDatabaseV2Inner.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2ListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2ListResultTests.java deleted file mode 100644 index 44f53190b295..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2ListResultTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlDatabaseV2Inner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV2ListResult; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV2Properties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AssessedSqlDatabaseV2ListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessedSqlDatabaseV2ListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"recommendedAzureSqlTargetType\":\"AzureVirtualMachine\",\"recommendedSuitability\":\"PotentiallySuitableForVM\",\"bufferCacheSizeInMB\":6.7974987,\"productSupportStatus\":{\"currentVersion\":\"fltkacjv\",\"servicePackStatus\":\"kdlfoa\",\"esuStatus\":\"gkfpaga\",\"supportStatus\":\"pulpqblylsyxk\",\"eta\":648285682,\"currentEsuYear\":\"jervtia\",\"mainstreamEndDate\":\"2020-12-21T17:25:21Z\",\"extendedSupportEndDate\":\"2021-11-07T14:14:59Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-01-31T00:39:07Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-01-08T11:48:06Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-01-27T10:36:07Z\"},\"azureSqlMISuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"HyperScale\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"Unknown\",\"storageMaxSizeInMB\":22.02875,\"predictedDataSizeInMB\":8.355331,\"predictedLogSizeInMB\":98.671165,\"cores\":1110186498,\"azureSqlTargetType\":\"Recommended\"},\"replicaAzureSqlSku\":[{}],\"sharedResources\":{\"sharedDataDisks\":[{},{},{}],\"sharedLogDisks\":[{},{},{},{}],\"sharedTempDbDisks\":[{},{},{},{}],\"numberOfMounts\":2049841705,\"quorumWitness\":{}},\"monthlyComputeCost\":67.076294,\"monthlyStorageCost\":32.550335,\"costComponents\":[{},{},{}],\"securitySuitability\":\"NotSuitable\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"FailoverGroupInstance\",\"migrationGuidelines\":[{}],\"recommendationReasonings\":[{},{},{},{}],\"migrationTargetPlatform\":\"Recommended\",\"suitability\":\"ReadinessUnknown\",\"migrationIssues\":[{},{},{},{}]},\"azureSqlDBSuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Unknown\",\"azureSqlHardwareGeneration\":\"Fsv2_series\",\"storageMaxSizeInMB\":85.23259,\"predictedDataSizeInMB\":9.257221,\"predictedLogSizeInMB\":21.030748,\"cores\":804013471,\"azureSqlTargetType\":\"Unknown\"},\"replicaAzureSqlSku\":[{}],\"sharedResources\":{\"sharedDataDisks\":[{},{},{}],\"sharedLogDisks\":[{}],\"sharedTempDbDisks\":[{},{},{},{}],\"numberOfMounts\":621148688,\"quorumWitness\":{}},\"monthlyComputeCost\":6.8819046,\"monthlyStorageCost\":79.41099,\"costComponents\":[{},{},{},{}],\"securitySuitability\":\"Suitable\",\"shouldProvisionReplicas\":false,\"skuReplicationMode\":\"FailoverGroupInstance\",\"migrationGuidelines\":[{},{},{},{}],\"recommendationReasonings\":[{},{},{},{}],\"migrationTargetPlatform\":\"Recommended\",\"suitability\":\"Unknown\",\"migrationIssues\":[{}]},\"isDatabaseHighlyAvailable\":true,\"linkedAvailabilityGroupOverview\":{\"availabilityGroupId\":\"qdpfuvglsbjjca\",\"availabilityGroupName\":\"xbvtvudu\",\"sqlAvailabilityGroupSdsArmId\":\"cormr\",\"sqlAvailabilityGroupEntityId\":\"qtvcofudflvkgj\",\"sqlAvailabilityReplicaId\":\"gdknnqv\"},\"machineArmId\":\"znqntoru\",\"assessedSqlInstanceArmId\":\"gsahmkycgrauw\",\"machineName\":\"etaebu\",\"instanceName\":\"vdmovsmzlxwabm\",\"databaseName\":\"efkifr\",\"databaseSizeInMB\":87.23322,\"compatibilityLevel\":\"CompatLevel100\",\"sqlDatabaseSdsArmId\":\"jmqlgkfb\",\"percentageCoresUtilization\":29.160828,\"megabytesPerSecondOfRead\":37.295277,\"megabytesPerSecondOfWrite\":3.405124,\"numberOfReadOperationsPerSecond\":59.237026,\"numberOfWriteOperationsPerSecond\":6.8924847,\"confidenceRatingInPercentage\":64.58055,\"sizingCriterion\":\"AsOnPremises\",\"createdTimestamp\":\"2021-03-27T19:20:10Z\",\"updatedTimestamp\":\"2021-04-17T23:49:38Z\"},\"id\":\"df\",\"name\":\"wwa\",\"type\":\"zkoj\"},{\"properties\":{\"recommendedAzureSqlTargetType\":\"AzureSqlVirtualMachine\",\"recommendedSuitability\":\"SuitableForSqlDB\",\"bufferCacheSizeInMB\":85.01792,\"productSupportStatus\":{\"currentVersion\":\"i\",\"servicePackStatus\":\"bxarzgszufoxci\",\"esuStatus\":\"p\",\"supportStatus\":\"oamciodh\",\"eta\":1741139859,\"currentEsuYear\":\"xkhnzbonlwnto\",\"mainstreamEndDate\":\"2021-08-27T05:30:46Z\",\"extendedSupportEndDate\":\"2021-08-27T04:05:42Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-10-07T23:12:54Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-09-24T01:53:24Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-11-17T17:14:48Z\"},\"azureSqlMISuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"Automatic\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Gen5\",\"storageMaxSizeInMB\":15.110135,\"predictedDataSizeInMB\":10.827255,\"predictedLogSizeInMB\":77.007065,\"cores\":125773376,\"azureSqlTargetType\":\"Recommended\"},\"replicaAzureSqlSku\":[{},{}],\"sharedResources\":{\"sharedDataDisks\":[{},{}],\"sharedLogDisks\":[{},{},{},{}],\"sharedTempDbDisks\":[{},{}],\"numberOfMounts\":1422593899,\"quorumWitness\":{}},\"monthlyComputeCost\":7.1297703,\"monthlyStorageCost\":10.837847,\"costComponents\":[{}],\"securitySuitability\":\"ConditionallySuitable\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"NotApplicable\",\"migrationGuidelines\":[{},{},{},{}],\"recommendationReasonings\":[{},{},{},{}],\"migrationTargetPlatform\":\"Unknown\",\"suitability\":\"Unknown\",\"migrationIssues\":[{}]},\"azureSqlDBSuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"Automatic\",\"azureSqlComputeTier\":\"Automatic\",\"azureSqlHardwareGeneration\":\"Unknown\",\"storageMaxSizeInMB\":4.411727,\"predictedDataSizeInMB\":98.1842,\"predictedLogSizeInMB\":28.616787,\"cores\":237488555,\"azureSqlTargetType\":\"Unknown\"},\"replicaAzureSqlSku\":[{}],\"sharedResources\":{\"sharedDataDisks\":[{},{},{},{}],\"sharedLogDisks\":[{}],\"sharedTempDbDisks\":[{},{},{},{}],\"numberOfMounts\":2086518628,\"quorumWitness\":{}},\"monthlyComputeCost\":58.32351,\"monthlyStorageCost\":61.956436,\"costComponents\":[{}],\"securitySuitability\":\"NotSuitable\",\"shouldProvisionReplicas\":false,\"skuReplicationMode\":\"ActiveGeoReplication\",\"migrationGuidelines\":[{}],\"recommendationReasonings\":[{},{},{},{}],\"migrationTargetPlatform\":\"Unknown\",\"suitability\":\"Unknown\",\"migrationIssues\":[{},{},{}]},\"isDatabaseHighlyAvailable\":true,\"linkedAvailabilityGroupOverview\":{\"availabilityGroupId\":\"ogvbbejdcngq\",\"availabilityGroupName\":\"oakufgm\",\"sqlAvailabilityGroupSdsArmId\":\"rwr\",\"sqlAvailabilityGroupEntityId\":\"rtwaenuuzko\",\"sqlAvailabilityReplicaId\":\"minrfdw\"},\"machineArmId\":\"uhhziuiefozbhdm\",\"assessedSqlInstanceArmId\":\"l\",\"machineName\":\"qhoftrmaequiah\",\"instanceName\":\"cslfaoqzpiyylha\",\"databaseName\":\"swhccsphk\",\"databaseSizeInMB\":54.328762,\"compatibilityLevel\":\"CompatLevel80\",\"sqlDatabaseSdsArmId\":\"qscywu\",\"percentageCoresUtilization\":92.82295,\"megabytesPerSecondOfRead\":40.162403,\"megabytesPerSecondOfWrite\":2.1984339,\"numberOfReadOperationsPerSecond\":36.04179,\"numberOfWriteOperationsPerSecond\":13.990349,\"confidenceRatingInPercentage\":92.50669,\"sizingCriterion\":\"PerformanceBased\",\"createdTimestamp\":\"2021-02-18T08:40:02Z\",\"updatedTimestamp\":\"2021-03-17T16:24:18Z\"},\"id\":\"gzd\",\"name\":\"msweypqwdxggicc\",\"type\":\"n\"}],\"nextLink\":\"huexmk\"}") - .toObject(AssessedSqlDatabaseV2ListResult.class); - Assertions.assertEquals("huexmk", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessedSqlDatabaseV2ListResult model = new AssessedSqlDatabaseV2ListResult() - .withValue( - Arrays.asList(new AssessedSqlDatabaseV2Inner().withProperties(new AssessedSqlDatabaseV2Properties()), - new AssessedSqlDatabaseV2Inner().withProperties(new AssessedSqlDatabaseV2Properties()))) - .withNextLink("huexmk"); - model = BinaryData.fromObject(model).toObject(AssessedSqlDatabaseV2ListResult.class); - Assertions.assertEquals("huexmk", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2OperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2OperationsGetWithResponseMockTests.java deleted file mode 100644 index 9719bd15959d..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2OperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV2; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessedSqlDatabaseV2OperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"recommendedAzureSqlTargetType\":\"AzureSqlVirtualMachine\",\"recommendedSuitability\":\"ReadinessUnknown\",\"bufferCacheSizeInMB\":0.8788943,\"productSupportStatus\":{\"currentVersion\":\"iegftc\",\"servicePackStatus\":\"iiftksd\",\"esuStatus\":\"dnkefgm\",\"supportStatus\":\"hcebuvczldbglzo\",\"eta\":1037630035,\"currentEsuYear\":\"aqgzekajclyzgs\",\"mainstreamEndDate\":\"2021-04-21T17:36:16Z\",\"extendedSupportEndDate\":\"2021-04-23T22:59:57Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-11-11T22:10:46Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-04-21T21:06:45Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-05-23T21:13:43Z\"},\"azureSqlMISuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"BusinessCritical\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"Automatic\",\"storageMaxSizeInMB\":68.34222,\"predictedDataSizeInMB\":16.33374,\"predictedLogSizeInMB\":52.67709,\"cores\":903159206,\"azureSqlTargetType\":\"Recommended\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"BusinessCritical\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"Gen5\",\"storageMaxSizeInMB\":38.71055,\"predictedDataSizeInMB\":87.59537,\"predictedLogSizeInMB\":43.163795,\"cores\":1578463604,\"azureSqlTargetType\":\"AzureVirtualMachine\"},{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"Gen5\",\"storageMaxSizeInMB\":74.55601,\"predictedDataSizeInMB\":70.11732,\"predictedLogSizeInMB\":36.583263,\"cores\":516680467,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"}],\"sharedResources\":{\"sharedDataDisks\":[{}],\"sharedLogDisks\":[{},{}],\"sharedTempDbDisks\":[{},{}],\"numberOfMounts\":421959246,\"quorumWitness\":{\"quorumWitnessType\":\"Unknown\"}},\"monthlyComputeCost\":49.53341,\"monthlyStorageCost\":60.52063,\"costComponents\":[{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":35.289574,\"description\":\"j\"},{\"name\":\"Unknown\",\"value\":64.1754,\"description\":\"fyvrtpqpemhzcgk\"},{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":71.210846,\"description\":\"qyhwqwem\"}],\"securitySuitability\":\"ConditionallySuitable\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"ActiveGeoReplication\",\"migrationGuidelines\":[{\"guidelineId\":\"oxinh\",\"migrationGuidelineCategory\":\"Unknown\",\"migrationGuidelineContext\":[{}]},{\"guidelineId\":\"whlpuzjpceezn\",\"migrationGuidelineCategory\":\"Unknown\",\"migrationGuidelineContext\":[{},{},{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"axyxzlbciphm\",\"reasoningString\":\"x\",\"reasoningCategory\":\"qrndktxfvon\",\"contextParameters\":[{}]},{\"reasoningId\":\"gpkrie\",\"reasoningString\":\"gnixxowwzkyfwnw\",\"reasoningCategory\":\"wxeiicrmpepk\",\"contextParameters\":[{},{},{},{}]},{\"reasoningId\":\"xxij\",\"reasoningString\":\"kwsdgkj\",\"reasoningCategory\":\"acwras\",\"contextParameters\":[{},{},{}]}],\"migrationTargetPlatform\":\"Unknown\",\"suitability\":\"NotSuitable\",\"migrationIssues\":[{\"issueId\":\"woqartwy\",\"issueCategory\":\"Warning\",\"impactedObjects\":[{}]},{\"issueId\":\"dvatdavuqm\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{}]},{\"issueId\":\"ob\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{},{},{}]}]},\"azureSqlDBSuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"GeneralPurpose\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"Gen5\",\"storageMaxSizeInMB\":23.274738,\"predictedDataSizeInMB\":26.043839,\"predictedLogSizeInMB\":67.29231,\"cores\":1199715241,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"HyperScale\",\"azureSqlComputeTier\":\"Automatic\",\"azureSqlHardwareGeneration\":\"Fsv2_series\",\"storageMaxSizeInMB\":30.55802,\"predictedDataSizeInMB\":26.492733,\"predictedLogSizeInMB\":71.933975,\"cores\":589477595,\"azureSqlTargetType\":\"Unknown\"}],\"sharedResources\":{\"sharedDataDisks\":[{},{}],\"sharedLogDisks\":[{},{}],\"sharedTempDbDisks\":[{},{}],\"numberOfMounts\":1948229122,\"quorumWitness\":{\"quorumWitnessType\":\"Unknown\"}},\"monthlyComputeCost\":36.676968,\"monthlyStorageCost\":45.845135,\"costComponents\":[{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":10.844618,\"description\":\"nmabed\"},{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":10.511869,\"description\":\"d\"},{\"name\":\"Unknown\",\"value\":99.390724,\"description\":\"cvstclgqrvwerf\"},{\"name\":\"MonthlySecurityCost\",\"value\":44.495235,\"description\":\"bljjehh\"}],\"securitySuitability\":\"ReadinessUnknown\",\"shouldProvisionReplicas\":false,\"skuReplicationMode\":\"NotApplicable\",\"migrationGuidelines\":[{\"guidelineId\":\"rek\",\"migrationGuidelineCategory\":\"General\",\"migrationGuidelineContext\":[{},{}]},{\"guidelineId\":\"fpwpqbyejuwyqwd\",\"migrationGuidelineCategory\":\"AvailabilityGroupGuideline\",\"migrationGuidelineContext\":[{}]},{\"guidelineId\":\"ginz\",\"migrationGuidelineCategory\":\"General\",\"migrationGuidelineContext\":[{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"jcmrnkfm\",\"reasoningString\":\"cqtwmlmhjnqtq\",\"reasoningCategory\":\"hj\",\"contextParameters\":[{},{},{}]},{\"reasoningId\":\"agpokddxe\",\"reasoningString\":\"h\",\"reasoningCategory\":\"guavtptb\",\"contextParameters\":[{},{}]},{\"reasoningId\":\"qynspgbvoffb\",\"reasoningString\":\"w\",\"reasoningCategory\":\"xaexqokmyrljial\",\"contextParameters\":[{},{}]}],\"migrationTargetPlatform\":\"Unknown\",\"suitability\":\"NotSuitable\",\"migrationIssues\":[{\"issueId\":\"cjtrpzu\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{},{},{}]},{\"issueId\":\"xnhsqeaeo\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{}]},{\"issueId\":\"dhuruzytzarog\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{}]},{\"issueId\":\"iywmpinmzvfkn\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{}]}]},\"isDatabaseHighlyAvailable\":true,\"linkedAvailabilityGroupOverview\":{\"availabilityGroupId\":\"sj\",\"availabilityGroupName\":\"ugdybnhrxlel\",\"sqlAvailabilityGroupSdsArmId\":\"hkeizcp\",\"sqlAvailabilityGroupEntityId\":\"tdmiwjekptyca\",\"sqlAvailabilityReplicaId\":\"bjzcqymlcfnzhm\"},\"machineArmId\":\"urlgwqkpmmzps\",\"assessedSqlInstanceArmId\":\"u\",\"machineName\":\"awi\",\"instanceName\":\"momsgvvj\",\"databaseName\":\"vlrlohewjjmajn\",\"databaseSizeInMB\":26.176012,\"compatibilityLevel\":\"CompatLevel100\",\"sqlDatabaseSdsArmId\":\"onswae\",\"percentageCoresUtilization\":12.957537,\"megabytesPerSecondOfRead\":45.745068,\"megabytesPerSecondOfWrite\":96.45278,\"numberOfReadOperationsPerSecond\":65.69365,\"numberOfWriteOperationsPerSecond\":9.40125,\"confidenceRatingInPercentage\":0.98002553,\"sizingCriterion\":\"PerformanceBased\",\"createdTimestamp\":\"2021-08-07T15:49:55Z\",\"updatedTimestamp\":\"2021-05-14T04:39:56Z\"},\"id\":\"pkhx\",\"name\":\"mexznlwkb\",\"type\":\"okxkhupzer\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - AssessedSqlDatabaseV2 response = manager.assessedSqlDatabaseV2Operations() - .getWithResponse("kqv", "qepdx", "ltuubw", "vpjbowcpjqduq", "ixexkydfbwljavhu", - com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2OperationsListBySqlAssessmentV2MockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2OperationsListBySqlAssessmentV2MockTests.java deleted file mode 100644 index f6caf590ccf1..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlDatabaseV2OperationsListBySqlAssessmentV2MockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlDatabaseV2; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessedSqlDatabaseV2OperationsListBySqlAssessmentV2MockTests { - @Test - public void testListBySqlAssessmentV2() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"recommendedAzureSqlTargetType\":\"Recommended\",\"recommendedSuitability\":\"SuitableForSqlDB\",\"bufferCacheSizeInMB\":6.9218874,\"productSupportStatus\":{\"currentVersion\":\"lr\",\"servicePackStatus\":\"gtzjcv\",\"esuStatus\":\"qlapsnsso\",\"supportStatus\":\"xpavid\",\"eta\":435647020,\"currentEsuYear\":\"wffcvvye\",\"mainstreamEndDate\":\"2021-06-23T09:55:10Z\",\"extendedSupportEndDate\":\"2021-09-10T04:22:49Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-09-04T00:09:45Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-08-25T16:18:38Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-03-26T15:54:37Z\"},\"azureSqlMISuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"DC_series\",\"storageMaxSizeInMB\":95.14251,\"predictedDataSizeInMB\":74.27462,\"predictedLogSizeInMB\":34.092625,\"cores\":1838467829,\"azureSqlTargetType\":\"Unknown\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"HyperScale\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Automatic\",\"storageMaxSizeInMB\":87.86046,\"predictedDataSizeInMB\":22.210157,\"predictedLogSizeInMB\":67.66576,\"cores\":782520891,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"}],\"sharedResources\":{\"sharedDataDisks\":[{},{},{}],\"sharedLogDisks\":[{},{},{},{}],\"sharedTempDbDisks\":[{},{},{},{}],\"numberOfMounts\":1625697424,\"quorumWitness\":{\"quorumWitnessType\":\"Cloud\"}},\"monthlyComputeCost\":51.853474,\"monthlyStorageCost\":94.16587,\"costComponents\":[{\"name\":\"MonthlySecurityCost\",\"value\":83.56569,\"description\":\"qhnmhk\"}],\"securitySuitability\":\"ReadinessUnknown\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"NotApplicable\",\"migrationGuidelines\":[{\"guidelineId\":\"qdgcrux\",\"migrationGuidelineCategory\":\"AvailabilityGroupGuideline\",\"migrationGuidelineContext\":[{},{},{}]},{\"guidelineId\":\"m\",\"migrationGuidelineCategory\":\"General\",\"migrationGuidelineContext\":[{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"pazf\",\"reasoningString\":\"jxuvj\",\"reasoningCategory\":\"fdvhaxdvwzae\",\"contextParameters\":[{}]},{\"reasoningId\":\"thd\",\"reasoningString\":\"mvetatlakfq\",\"reasoningCategory\":\"xwgiks\",\"contextParameters\":[{},{}]}],\"migrationTargetPlatform\":\"AzureSqlManagedInstance\",\"suitability\":\"NotSuitable\",\"migrationIssues\":[{\"issueId\":\"gwphchgjtnht\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{},{},{}]}]},\"azureSqlDBSuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"BusinessCritical\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Automatic\",\"storageMaxSizeInMB\":28.095364,\"predictedDataSizeInMB\":67.82644,\"predictedLogSizeInMB\":87.82683,\"cores\":353154350,\"azureSqlTargetType\":\"Recommended\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"M_series\",\"storageMaxSizeInMB\":79.7553,\"predictedDataSizeInMB\":2.1850169,\"predictedLogSizeInMB\":92.61337,\"cores\":968770502,\"azureSqlTargetType\":\"AzureSqlManagedInstance\"}],\"sharedResources\":{\"sharedDataDisks\":[{},{}],\"sharedLogDisks\":[{},{},{},{}],\"sharedTempDbDisks\":[{},{},{},{}],\"numberOfMounts\":1876924185,\"quorumWitness\":{\"quorumWitnessType\":\"Unknown\"}},\"monthlyComputeCost\":71.73476,\"monthlyStorageCost\":94.903854,\"costComponents\":[{\"name\":\"Unknown\",\"value\":26.463287,\"description\":\"mlscgrllccn\"},{\"name\":\"MonthlySecurityCost\",\"value\":74.24044,\"description\":\"azhpabacoml\"},{\"name\":\"Unknown\",\"value\":21.50871,\"description\":\"sxnsrqorcge\"},{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":17.64496,\"description\":\"xeetq\"}],\"securitySuitability\":\"ReadinessUnknown\",\"shouldProvisionReplicas\":false,\"skuReplicationMode\":\"ActiveGeoReplication\",\"migrationGuidelines\":[{\"guidelineId\":\"qjkedwqurc\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{},{},{}]},{\"guidelineId\":\"v\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{}]},{\"guidelineId\":\"zsehqqrsilcchskx\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"ia\",\"reasoningString\":\"vtojrulfuctejr\",\"reasoningCategory\":\"cfjzhxl\",\"contextParameters\":[{}]}],\"migrationTargetPlatform\":\"AzureSqlDatabase\",\"suitability\":\"Unknown\",\"migrationIssues\":[{\"issueId\":\"rjeqmtzzbeqrztr\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{}]},{\"issueId\":\"habsrwrsnrh\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{}]},{\"issueId\":\"kkvyanxk\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{}]}]},\"isDatabaseHighlyAvailable\":false,\"linkedAvailabilityGroupOverview\":{\"availabilityGroupId\":\"v\",\"availabilityGroupName\":\"kqxetqmmliv\",\"sqlAvailabilityGroupSdsArmId\":\"jxnw\",\"sqlAvailabilityGroupEntityId\":\"chp\",\"sqlAvailabilityReplicaId\":\"xlehzlxpgfquwzp\"},\"machineArmId\":\"ibelwcerwkw\",\"assessedSqlInstanceArmId\":\"jxljtxbusq\",\"machineName\":\"xxniuisdzhgbd\",\"instanceName\":\"pagsecnad\",\"databaseName\":\"wqrgxfllmqi\",\"databaseSizeInMB\":31.991226,\"compatibilityLevel\":\"Unknown\",\"sqlDatabaseSdsArmId\":\"lln\",\"percentageCoresUtilization\":20.776356,\"megabytesPerSecondOfRead\":4.9613,\"megabytesPerSecondOfWrite\":24.190844,\"numberOfReadOperationsPerSecond\":48.35083,\"numberOfWriteOperationsPerSecond\":74.788025,\"confidenceRatingInPercentage\":38.305767,\"sizingCriterion\":\"PerformanceBased\",\"createdTimestamp\":\"2021-02-13T02:19:45Z\",\"updatedTimestamp\":\"2021-02-26T07:03:36Z\"},\"id\":\"roqvqpilrgu\",\"name\":\"canlduwzorxs\",\"type\":\"mxaqklxym\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.assessedSqlDatabaseV2Operations() - .listBySqlAssessmentV2("ghsrleinkfscjfn", "jwvuag", "qwtltngvmreupt", "klzmijajw", "l", 1419456371, "s", - 922297419, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceDatabaseSummaryTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceDatabaseSummaryTests.java deleted file mode 100644 index c6d184a5a134..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceDatabaseSummaryTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceDatabaseSummary; -import org.junit.jupiter.api.Assertions; - -public final class AssessedSqlInstanceDatabaseSummaryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessedSqlInstanceDatabaseSummary model = BinaryData.fromString( - "{\"numberOfUserDatabases\":967532883,\"totalDatabaseSizeInMB\":17.572004,\"largestDatabaseSizeInMB\":72.82245,\"totalDiscoveredUserDatabases\":1096953417}") - .toObject(AssessedSqlInstanceDatabaseSummary.class); - Assertions.assertEquals(967532883, model.numberOfUserDatabases()); - Assertions.assertEquals(17.572004F, model.totalDatabaseSizeInMB()); - Assertions.assertEquals(72.82245F, model.largestDatabaseSizeInMB()); - Assertions.assertEquals(1096953417, model.totalDiscoveredUserDatabases()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessedSqlInstanceDatabaseSummary model - = new AssessedSqlInstanceDatabaseSummary().withNumberOfUserDatabases(967532883) - .withTotalDatabaseSizeInMB(17.572004F) - .withLargestDatabaseSizeInMB(72.82245F) - .withTotalDiscoveredUserDatabases(1096953417); - model = BinaryData.fromObject(model).toObject(AssessedSqlInstanceDatabaseSummary.class); - Assertions.assertEquals(967532883, model.numberOfUserDatabases()); - Assertions.assertEquals(17.572004F, model.totalDatabaseSizeInMB()); - Assertions.assertEquals(72.82245F, model.largestDatabaseSizeInMB()); - Assertions.assertEquals(1096953417, model.totalDiscoveredUserDatabases()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceDiskDetailsTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceDiskDetailsTests.java deleted file mode 100644 index fa7936850a0a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceDiskDetailsTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceDiskDetails; -import org.junit.jupiter.api.Assertions; - -public final class AssessedSqlInstanceDiskDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessedSqlInstanceDiskDetails model = BinaryData.fromString( - "{\"diskId\":\"mfg\",\"diskSizeInMB\":46.877174,\"megabytesPerSecondOfRead\":99.32945,\"megabytesPerSecondOfWrite\":90.87945,\"numberOfReadOperationsPerSecond\":1.9399703,\"numberOfWriteOperationsPerSecond\":3.898108}") - .toObject(AssessedSqlInstanceDiskDetails.class); - Assertions.assertEquals("mfg", model.diskId()); - Assertions.assertEquals(46.877174F, model.diskSizeInMB()); - Assertions.assertEquals(99.32945F, model.megabytesPerSecondOfRead()); - Assertions.assertEquals(90.87945F, model.megabytesPerSecondOfWrite()); - Assertions.assertEquals(1.9399703F, model.numberOfReadOperationsPerSecond()); - Assertions.assertEquals(3.898108F, model.numberOfWriteOperationsPerSecond()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessedSqlInstanceDiskDetails model = new AssessedSqlInstanceDiskDetails().withDiskId("mfg") - .withDiskSizeInMB(46.877174F) - .withMegabytesPerSecondOfRead(99.32945F) - .withMegabytesPerSecondOfWrite(90.87945F) - .withNumberOfReadOperationsPerSecond(1.9399703F) - .withNumberOfWriteOperationsPerSecond(3.898108F); - model = BinaryData.fromObject(model).toObject(AssessedSqlInstanceDiskDetails.class); - Assertions.assertEquals("mfg", model.diskId()); - Assertions.assertEquals(46.877174F, model.diskSizeInMB()); - Assertions.assertEquals(99.32945F, model.megabytesPerSecondOfRead()); - Assertions.assertEquals(90.87945F, model.megabytesPerSecondOfWrite()); - Assertions.assertEquals(1.9399703F, model.numberOfReadOperationsPerSecond()); - Assertions.assertEquals(3.898108F, model.numberOfWriteOperationsPerSecond()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceStorageDetailsTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceStorageDetailsTests.java deleted file mode 100644 index a0ea005602fd..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceStorageDetailsTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceStorageDetails; -import org.junit.jupiter.api.Assertions; - -public final class AssessedSqlInstanceStorageDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessedSqlInstanceStorageDetails model = BinaryData.fromString( - "{\"storageType\":\"rkyui\",\"diskSizeInMB\":46.088665,\"megabytesPerSecondOfRead\":27.76271,\"megabytesPerSecondOfWrite\":36.77259,\"numberOfReadOperationsPerSecond\":60.807236,\"numberOfWriteOperationsPerSecond\":35.29606}") - .toObject(AssessedSqlInstanceStorageDetails.class); - Assertions.assertEquals("rkyui", model.storageType()); - Assertions.assertEquals(46.088665F, model.diskSizeInMB()); - Assertions.assertEquals(27.76271F, model.megabytesPerSecondOfRead()); - Assertions.assertEquals(36.77259F, model.megabytesPerSecondOfWrite()); - Assertions.assertEquals(60.807236F, model.numberOfReadOperationsPerSecond()); - Assertions.assertEquals(35.29606F, model.numberOfWriteOperationsPerSecond()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessedSqlInstanceStorageDetails model = new AssessedSqlInstanceStorageDetails().withStorageType("rkyui") - .withDiskSizeInMB(46.088665F) - .withMegabytesPerSecondOfRead(27.76271F) - .withMegabytesPerSecondOfWrite(36.77259F) - .withNumberOfReadOperationsPerSecond(60.807236F) - .withNumberOfWriteOperationsPerSecond(35.29606F); - model = BinaryData.fromObject(model).toObject(AssessedSqlInstanceStorageDetails.class); - Assertions.assertEquals("rkyui", model.storageType()); - Assertions.assertEquals(46.088665F, model.diskSizeInMB()); - Assertions.assertEquals(27.76271F, model.megabytesPerSecondOfRead()); - Assertions.assertEquals(36.77259F, model.megabytesPerSecondOfWrite()); - Assertions.assertEquals(60.807236F, model.numberOfReadOperationsPerSecond()); - Assertions.assertEquals(35.29606F, model.numberOfWriteOperationsPerSecond()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceSummaryTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceSummaryTests.java deleted file mode 100644 index ada957052855..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceSummaryTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceSummary; -import com.azure.resourcemanager.migration.assessment.models.SqlFciState; -import org.junit.jupiter.api.Assertions; - -public final class AssessedSqlInstanceSummaryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessedSqlInstanceSummary model = BinaryData.fromString( - "{\"instanceId\":\"yi\",\"instanceName\":\"sharujtj\",\"sqlInstanceSdsArmId\":\"xfz\",\"sqlInstanceEntityId\":\"qttv\",\"sqlEdition\":\"pqhjpenuygbqeqq\",\"sqlVersion\":\"ewvnqvcdlgu\",\"isClustered\":true,\"isHighAvailabilityEnabled\":false,\"sqlFciState\":\"Active\"}") - .toObject(AssessedSqlInstanceSummary.class); - Assertions.assertEquals("yi", model.instanceId()); - Assertions.assertEquals("sharujtj", model.instanceName()); - Assertions.assertEquals("xfz", model.sqlInstanceSdsArmId()); - Assertions.assertEquals("qttv", model.sqlInstanceEntityId()); - Assertions.assertEquals("pqhjpenuygbqeqq", model.sqlEdition()); - Assertions.assertEquals("ewvnqvcdlgu", model.sqlVersion()); - Assertions.assertEquals(true, model.isClustered()); - Assertions.assertEquals(false, model.isHighAvailabilityEnabled()); - Assertions.assertEquals(SqlFciState.ACTIVE, model.sqlFciState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessedSqlInstanceSummary model = new AssessedSqlInstanceSummary().withInstanceId("yi") - .withInstanceName("sharujtj") - .withSqlInstanceSdsArmId("xfz") - .withSqlInstanceEntityId("qttv") - .withSqlEdition("pqhjpenuygbqeqq") - .withSqlVersion("ewvnqvcdlgu") - .withIsClustered(true) - .withIsHighAvailabilityEnabled(false) - .withSqlFciState(SqlFciState.ACTIVE); - model = BinaryData.fromObject(model).toObject(AssessedSqlInstanceSummary.class); - Assertions.assertEquals("yi", model.instanceId()); - Assertions.assertEquals("sharujtj", model.instanceName()); - Assertions.assertEquals("xfz", model.sqlInstanceSdsArmId()); - Assertions.assertEquals("qttv", model.sqlInstanceEntityId()); - Assertions.assertEquals("pqhjpenuygbqeqq", model.sqlEdition()); - Assertions.assertEquals("ewvnqvcdlgu", model.sqlVersion()); - Assertions.assertEquals(true, model.isClustered()); - Assertions.assertEquals(false, model.isHighAvailabilityEnabled()); - Assertions.assertEquals(SqlFciState.ACTIVE, model.sqlFciState()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV2ListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV2ListResultTests.java deleted file mode 100644 index e09214317189..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV2ListResultTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlInstanceV2Inner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV2ListResult; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV2Properties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AssessedSqlInstanceV2ListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessedSqlInstanceV2ListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"memoryInUseInMB\":9.758597,\"hasScanOccurred\":true,\"recommendedAzureSqlTargetType\":\"AzureVirtualMachine\",\"recommendedSuitability\":\"SuitableForVM\",\"azureSqlMISuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"Automatic\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Unknown\",\"storageMaxSizeInMB\":62.814766,\"predictedDataSizeInMB\":84.55681,\"predictedLogSizeInMB\":43.927773,\"cores\":2100674644,\"azureSqlTargetType\":\"AzureSqlDatabase\"},\"replicaAzureSqlSku\":[{},{}],\"sharedResources\":{\"sharedDataDisks\":[{}],\"sharedLogDisks\":[{},{},{}],\"sharedTempDbDisks\":[{},{},{},{}],\"numberOfMounts\":741141390,\"quorumWitness\":{}},\"monthlyComputeCost\":37.95228,\"monthlyStorageCost\":17.054766,\"costComponents\":[{},{},{}],\"securitySuitability\":\"Unknown\",\"shouldProvisionReplicas\":false,\"skuReplicationMode\":\"NotApplicable\",\"migrationGuidelines\":[{},{}],\"recommendationReasonings\":[{},{}],\"migrationTargetPlatform\":\"AzureSqlManagedInstance\",\"suitability\":\"ReadinessUnknown\",\"migrationIssues\":[{},{},{}]},\"azureSqlDBSuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"BusinessCritical\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"DC_series\",\"storageMaxSizeInMB\":91.03727,\"predictedDataSizeInMB\":55.587914,\"predictedLogSizeInMB\":49.596615,\"cores\":997568890,\"azureSqlTargetType\":\"Unknown\"},\"replicaAzureSqlSku\":[{},{},{}],\"sharedResources\":{\"sharedDataDisks\":[{}],\"sharedLogDisks\":[{}],\"sharedTempDbDisks\":[{}],\"numberOfMounts\":418634069,\"quorumWitness\":{}},\"monthlyComputeCost\":3.8403451,\"monthlyStorageCost\":70.124275,\"costComponents\":[{},{},{},{}],\"securitySuitability\":\"NotSuitable\",\"shouldProvisionReplicas\":false,\"skuReplicationMode\":\"ActiveGeoReplication\",\"migrationGuidelines\":[{},{}],\"recommendationReasonings\":[{}],\"migrationTargetPlatform\":\"AzureVirtualMachine\",\"suitability\":\"Suitable\",\"migrationIssues\":[{},{}]},\"azureSqlVMSuitabilityDetails\":{\"azureSqlSku\":{\"virtualMachineSize\":{},\"dataDiskSizes\":[{}],\"logDiskSizes\":[{}],\"azureSqlTargetType\":\"AzureSqlManagedInstance\"},\"replicaAzureSqlSku\":[{}],\"sharedResources\":{\"sharedDataDisks\":[{},{}],\"sharedLogDisks\":[{}],\"sharedTempDbDisks\":[{},{}],\"numberOfMounts\":1894572195,\"quorumWitness\":{}},\"monthlyComputeCost\":92.74596,\"monthlyStorageCost\":0.8468509,\"costComponents\":[{},{},{}],\"securitySuitability\":\"Unknown\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"FailoverGroupInstance\",\"migrationGuidelines\":[{}],\"recommendationReasonings\":[{},{}],\"migrationTargetPlatform\":\"AzureSqlDatabase\",\"suitability\":\"Unknown\",\"migrationIssues\":[{}]},\"storageTypeBasedDetails\":[{\"storageType\":\"axkgx\",\"diskSizeInMB\":7.87431,\"megabytesPerSecondOfRead\":45.988117,\"megabytesPerSecondOfWrite\":99.56378,\"numberOfReadOperationsPerSecond\":87.37095,\"numberOfWriteOperationsPerSecond\":81.29393},{\"storageType\":\"lu\",\"diskSizeInMB\":43.955265,\"megabytesPerSecondOfRead\":21.977615,\"megabytesPerSecondOfWrite\":95.55131,\"numberOfReadOperationsPerSecond\":23.560375,\"numberOfWriteOperationsPerSecond\":23.65641}],\"productSupportStatus\":{\"currentVersion\":\"thost\",\"servicePackStatus\":\"tstvdxeclzedq\",\"esuStatus\":\"vh\",\"supportStatus\":\"h\",\"eta\":693304246,\"currentEsuYear\":\"qkdlw\",\"mainstreamEndDate\":\"2021-06-02T22:55:20Z\",\"extendedSupportEndDate\":\"2021-04-24T09:11:55Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-11-14T02:43:26Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-01-09T13:22:40Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-05-26T02:30:15Z\"},\"fciMetadata\":{\"state\":\"Inherited\",\"isMultiSubnet\":true,\"fciSharedDiskCount\":2109905275},\"availabilityReplicaSummary\":{\"numberOfSynchronousReadReplicas\":765522642,\"numberOfSynchronousNonReadReplicas\":16168895,\"numberOfAsynchronousReadReplicas\":1857777885,\"numberOfAsynchronousNonReadReplicas\":804071808,\"numberOfPrimaryReplicas\":836535007},\"isClustered\":true,\"isHighAvailabilityEnabled\":true,\"recommendedTargetReasonings\":[{\"reasoningId\":\"rhubskhud\",\"reasoningString\":\"oookkqfq\",\"reasoningCategory\":\"vleo\",\"contextParameters\":[{}]},{\"reasoningId\":\"uiqtqzfavy\",\"reasoningString\":\"qqybarye\",\"reasoningCategory\":\"yjkqabqgzslesjcb\",\"contextParameters\":[{},{},{}]},{\"reasoningId\":\"ntiew\",\"reasoningString\":\"cv\",\"reasoningCategory\":\"uwrbehwagoh\",\"contextParameters\":[{}]},{\"reasoningId\":\"kmr\",\"reasoningString\":\"mvvhmxtdrjfuta\",\"reasoningCategory\":\"ebjvewzcjzn\",\"contextParameters\":[{},{},{},{}]}],\"machineArmId\":\"mguaadraufa\",\"machineName\":\"kahzo\",\"instanceName\":\"jjziuxxpsh\",\"sqlInstanceSdsArmId\":\"e\",\"sqlEdition\":\"lfg\",\"sqlVersion\":\"qubkw\",\"numberOfCoresAllocated\":702643575,\"percentageCoresUtilization\":17.831444,\"logicalDisks\":[{\"diskId\":\"tujbazpju\",\"diskSizeInMB\":65.31831,\"megabytesPerSecondOfRead\":25.543505,\"megabytesPerSecondOfWrite\":69.86077,\"numberOfReadOperationsPerSecond\":86.60149,\"numberOfWriteOperationsPerSecond\":18.283283},{\"diskId\":\"mduvw\",\"diskSizeInMB\":39.49926,\"megabytesPerSecondOfRead\":71.83409,\"megabytesPerSecondOfWrite\":66.04359,\"numberOfReadOperationsPerSecond\":27.807796,\"numberOfWriteOperationsPerSecond\":26.512533}],\"databaseSummary\":{\"numberOfUserDatabases\":181907688,\"totalDatabaseSizeInMB\":34.69194,\"largestDatabaseSizeInMB\":23.62407,\"totalDiscoveredUserDatabases\":1044665061},\"confidenceRatingInPercentage\":36.441113,\"sizingCriterion\":\"PerformanceBased\",\"createdTimestamp\":\"2021-05-29T06:21:05Z\",\"updatedTimestamp\":\"2021-05-09T12:03:02Z\"},\"id\":\"gibbdaxc\",\"name\":\"nfo\",\"type\":\"auorsukokw\"},{\"properties\":{\"memoryInUseInMB\":19.009077,\"hasScanOccurred\":true,\"recommendedAzureSqlTargetType\":\"Recommended\",\"recommendedSuitability\":\"ConditionallySuitableForSqlDB\",\"azureSqlMISuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"BusinessCritical\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"Automatic\",\"storageMaxSizeInMB\":75.409386,\"predictedDataSizeInMB\":1.0991573,\"predictedLogSizeInMB\":16.2947,\"cores\":1290354736,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"},\"replicaAzureSqlSku\":[{},{}],\"sharedResources\":{\"sharedDataDisks\":[{},{}],\"sharedLogDisks\":[{},{},{}],\"sharedTempDbDisks\":[{},{}],\"numberOfMounts\":2013507582,\"quorumWitness\":{}},\"monthlyComputeCost\":11.9415045,\"monthlyStorageCost\":90.519005,\"costComponents\":[{},{}],\"securitySuitability\":\"Unknown\",\"shouldProvisionReplicas\":false,\"skuReplicationMode\":\"FailoverGroupInstance\",\"migrationGuidelines\":[{},{}],\"recommendationReasonings\":[{},{},{},{}],\"migrationTargetPlatform\":\"Unknown\",\"suitability\":\"ReadinessUnknown\",\"migrationIssues\":[{}]},\"azureSqlDBSuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Gen5\",\"storageMaxSizeInMB\":12.222469,\"predictedDataSizeInMB\":1.7481148,\"predictedLogSizeInMB\":53.11064,\"cores\":1357028156,\"azureSqlTargetType\":\"AzureSqlDatabase\"},\"replicaAzureSqlSku\":[{},{},{}],\"sharedResources\":{\"sharedDataDisks\":[{},{},{}],\"sharedLogDisks\":[{}],\"sharedTempDbDisks\":[{},{},{},{}],\"numberOfMounts\":315622888,\"quorumWitness\":{}},\"monthlyComputeCost\":92.20822,\"monthlyStorageCost\":32.07748,\"costComponents\":[{},{},{}],\"securitySuitability\":\"Suitable\",\"shouldProvisionReplicas\":false,\"skuReplicationMode\":\"ActiveGeoReplication\",\"migrationGuidelines\":[{},{}],\"recommendationReasonings\":[{},{}],\"migrationTargetPlatform\":\"Unknown\",\"suitability\":\"Suitable\",\"migrationIssues\":[{}]},\"azureSqlVMSuitabilityDetails\":{\"azureSqlSku\":{\"virtualMachineSize\":{},\"dataDiskSizes\":[{}],\"logDiskSizes\":[{},{},{}],\"azureSqlTargetType\":\"Recommended\"},\"replicaAzureSqlSku\":[{},{}],\"sharedResources\":{\"sharedDataDisks\":[{}],\"sharedLogDisks\":[{},{},{}],\"sharedTempDbDisks\":[{},{}],\"numberOfMounts\":64895608,\"quorumWitness\":{}},\"monthlyComputeCost\":45.34594,\"monthlyStorageCost\":46.00898,\"costComponents\":[{},{}],\"securitySuitability\":\"ReadinessUnknown\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"FailoverGroupInstance\",\"migrationGuidelines\":[{},{}],\"recommendationReasonings\":[{},{},{},{}],\"migrationTargetPlatform\":\"AzureSqlDatabase\",\"suitability\":\"Unknown\",\"migrationIssues\":[{},{},{},{}]},\"storageTypeBasedDetails\":[{\"storageType\":\"szqujizdvoq\",\"diskSizeInMB\":88.05086,\"megabytesPerSecondOfRead\":9.872651,\"megabytesPerSecondOfWrite\":7.6423407,\"numberOfReadOperationsPerSecond\":69.872574,\"numberOfWriteOperationsPerSecond\":30.12582},{\"storageType\":\"avu\",\"diskSizeInMB\":54.3682,\"megabytesPerSecondOfRead\":38.259933,\"megabytesPerSecondOfWrite\":12.625467,\"numberOfReadOperationsPerSecond\":90.963974,\"numberOfWriteOperationsPerSecond\":33.112614}],\"productSupportStatus\":{\"currentVersion\":\"sbpimlq\",\"servicePackStatus\":\"jxkcgxxlxsff\",\"esuStatus\":\"vizqzdwl\",\"supportStatus\":\"lyoupfgfbkju\",\"eta\":1006951199,\"currentEsuYear\":\"gkfmins\",\"mainstreamEndDate\":\"2021-04-25T05:32:28Z\",\"extendedSupportEndDate\":\"2021-04-01T08:47:57Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-05-24T09:09:21Z\",\"extendedSecurityUpdateYear2EndDate\":\"2020-12-29T13:16:58Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-03-02T23:21:27Z\"},\"fciMetadata\":{\"state\":\"Online\",\"isMultiSubnet\":true,\"fciSharedDiskCount\":1086150789},\"availabilityReplicaSummary\":{\"numberOfSynchronousReadReplicas\":2006118206,\"numberOfSynchronousNonReadReplicas\":118535522,\"numberOfAsynchronousReadReplicas\":1217445631,\"numberOfAsynchronousNonReadReplicas\":563035925,\"numberOfPrimaryReplicas\":1089045976},\"isClustered\":false,\"isHighAvailabilityEnabled\":false,\"recommendedTargetReasonings\":[{\"reasoningId\":\"q\",\"reasoningString\":\"rnxrxcpj\",\"reasoningCategory\":\"savokqdzf\",\"contextParameters\":[{}]},{\"reasoningId\":\"vjlfrqtt\",\"reasoningString\":\"jlkatnwxy\",\"reasoningCategory\":\"pidkqqfkuvscxkdm\",\"contextParameters\":[{},{},{},{}]},{\"reasoningId\":\"vibrxkpmloazuruo\",\"reasoningString\":\"goorbteo\",\"reasoningCategory\":\"fhjxakvvjgs\",\"contextParameters\":[{}]}],\"machineArmId\":\"il\",\"machineName\":\"wwtkg\",\"instanceName\":\"nye\",\"sqlInstanceSdsArmId\":\"b\",\"sqlEdition\":\"vudtjuewbcihx\",\"sqlVersion\":\"whcjyxcc\",\"numberOfCoresAllocated\":970870399,\"percentageCoresUtilization\":60.170685,\"logicalDisks\":[{\"diskId\":\"kudzpxgwj\",\"diskSizeInMB\":16.411697,\"megabytesPerSecondOfRead\":53.891308,\"megabytesPerSecondOfWrite\":64.56741,\"numberOfReadOperationsPerSecond\":98.82529,\"numberOfWriteOperationsPerSecond\":73.92511},{\"diskId\":\"fkyrk\",\"diskSizeInMB\":6.8435373,\"megabytesPerSecondOfRead\":56.479233,\"megabytesPerSecondOfWrite\":15.116018,\"numberOfReadOperationsPerSecond\":37.10237,\"numberOfWriteOperationsPerSecond\":26.578474}],\"databaseSummary\":{\"numberOfUserDatabases\":1662791957,\"totalDatabaseSizeInMB\":94.966415,\"largestDatabaseSizeInMB\":80.58958,\"totalDiscoveredUserDatabases\":1666235741},\"confidenceRatingInPercentage\":14.321136,\"sizingCriterion\":\"PerformanceBased\",\"createdTimestamp\":\"2021-08-25T16:30:07Z\",\"updatedTimestamp\":\"2021-02-08T23:25:54Z\"},\"id\":\"gfnmntfpmvmemfnc\",\"name\":\"dwvvba\",\"type\":\"xlllchp\"},{\"properties\":{\"memoryInUseInMB\":77.99745,\"hasScanOccurred\":true,\"recommendedAzureSqlTargetType\":\"AzureSqlVirtualMachine\",\"recommendedSuitability\":\"SuitableForSqlDB\",\"azureSqlMISuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"HyperScale\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"M_series\",\"storageMaxSizeInMB\":34.633957,\"predictedDataSizeInMB\":78.143,\"predictedLogSizeInMB\":54.562737,\"cores\":1165309637,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"},\"replicaAzureSqlSku\":[{},{}],\"sharedResources\":{\"sharedDataDisks\":[{},{}],\"sharedLogDisks\":[{},{},{},{}],\"sharedTempDbDisks\":[{}],\"numberOfMounts\":631107682,\"quorumWitness\":{}},\"monthlyComputeCost\":77.97097,\"monthlyStorageCost\":48.8412,\"costComponents\":[{},{},{}],\"securitySuitability\":\"Unknown\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"ActiveGeoReplication\",\"migrationGuidelines\":[{},{},{},{}],\"recommendationReasonings\":[{},{},{},{}],\"migrationTargetPlatform\":\"AzureSqlDatabase\",\"suitability\":\"ReadinessUnknown\",\"migrationIssues\":[{},{}]},\"azureSqlDBSuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"Automatic\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Fsv2_series\",\"storageMaxSizeInMB\":43.476677,\"predictedDataSizeInMB\":48.135914,\"predictedLogSizeInMB\":7.1958246,\"cores\":1351999302,\"azureSqlTargetType\":\"AzureVirtualMachine\"},\"replicaAzureSqlSku\":[{},{}],\"sharedResources\":{\"sharedDataDisks\":[{}],\"sharedLogDisks\":[{}],\"sharedTempDbDisks\":[{},{},{},{}],\"numberOfMounts\":1360898265,\"quorumWitness\":{}},\"monthlyComputeCost\":1.5846968,\"monthlyStorageCost\":72.977165,\"costComponents\":[{}],\"securitySuitability\":\"Unknown\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"FailoverGroupInstance\",\"migrationGuidelines\":[{},{},{}],\"recommendationReasonings\":[{},{},{},{}],\"migrationTargetPlatform\":\"AzureSqlDatabase\",\"suitability\":\"ConditionallySuitable\",\"migrationIssues\":[{},{}]},\"azureSqlVMSuitabilityDetails\":{\"azureSqlSku\":{\"virtualMachineSize\":{},\"dataDiskSizes\":[{},{},{},{}],\"logDiskSizes\":[{},{},{},{}],\"azureSqlTargetType\":\"AzureVirtualMachine\"},\"replicaAzureSqlSku\":[{},{},{}],\"sharedResources\":{\"sharedDataDisks\":[{},{},{},{}],\"sharedLogDisks\":[{},{}],\"sharedTempDbDisks\":[{}],\"numberOfMounts\":1622388222,\"quorumWitness\":{}},\"monthlyComputeCost\":65.579056,\"monthlyStorageCost\":74.3787,\"costComponents\":[{},{}],\"securitySuitability\":\"ReadinessUnknown\",\"shouldProvisionReplicas\":false,\"skuReplicationMode\":\"NotApplicable\",\"migrationGuidelines\":[{}],\"recommendationReasonings\":[{},{}],\"migrationTargetPlatform\":\"AzureSqlVirtualMachine\",\"suitability\":\"Unknown\",\"migrationIssues\":[{},{}]},\"storageTypeBasedDetails\":[{\"storageType\":\"fqzhv\",\"diskSizeInMB\":36.793434,\"megabytesPerSecondOfRead\":13.861406,\"megabytesPerSecondOfWrite\":42.81506,\"numberOfReadOperationsPerSecond\":93.550156,\"numberOfWriteOperationsPerSecond\":43.901634},{\"storageType\":\"kjpvdwxf\",\"diskSizeInMB\":99.00972,\"megabytesPerSecondOfRead\":48.665874,\"megabytesPerSecondOfWrite\":14.327431,\"numberOfReadOperationsPerSecond\":45.895924,\"numberOfWriteOperationsPerSecond\":83.45672},{\"storageType\":\"sxjrk\",\"diskSizeInMB\":49.111115,\"megabytesPerSecondOfRead\":40.838493,\"megabytesPerSecondOfWrite\":17.515266,\"numberOfReadOperationsPerSecond\":28.952526,\"numberOfWriteOperationsPerSecond\":72.90136}],\"productSupportStatus\":{\"currentVersion\":\"q\",\"servicePackStatus\":\"vldspa\",\"esuStatus\":\"jbkkdmflvestmjl\",\"supportStatus\":\"ril\",\"eta\":1058689711,\"currentEsuYear\":\"eewchpxlktw\",\"mainstreamEndDate\":\"2021-12-02T10:26:58Z\",\"extendedSupportEndDate\":\"2021-02-16T10:40:04Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-05-28T01:28:42Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-01-26T13:39:55Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-06-28T05:31:47Z\"},\"fciMetadata\":{\"state\":\"Online\",\"isMultiSubnet\":false,\"fciSharedDiskCount\":743111845},\"availabilityReplicaSummary\":{\"numberOfSynchronousReadReplicas\":1077847462,\"numberOfSynchronousNonReadReplicas\":400720959,\"numberOfAsynchronousReadReplicas\":1558169297,\"numberOfAsynchronousNonReadReplicas\":1002446412,\"numberOfPrimaryReplicas\":950056847},\"isClustered\":false,\"isHighAvailabilityEnabled\":true,\"recommendedTargetReasonings\":[{\"reasoningId\":\"zrrjvpgly\",\"reasoningString\":\"gkrvqeevto\",\"reasoningCategory\":\"r\",\"contextParameters\":[{}]}],\"machineArmId\":\"wytpzdmovz\",\"machineName\":\"va\",\"instanceName\":\"zqadf\",\"sqlInstanceSdsArmId\":\"z\",\"sqlEdition\":\"iglaecx\",\"sqlVersion\":\"t\",\"numberOfCoresAllocated\":1510056241,\"percentageCoresUtilization\":16.003609,\"logicalDisks\":[{\"diskId\":\"lqtmldgxob\",\"diskSizeInMB\":38.34113,\"megabytesPerSecondOfRead\":47.5388,\"megabytesPerSecondOfWrite\":13.118106,\"numberOfReadOperationsPerSecond\":74.10391,\"numberOfWriteOperationsPerSecond\":25.982613},{\"diskId\":\"zriykhy\",\"diskSizeInMB\":85.29825,\"megabytesPerSecondOfRead\":14.867121,\"megabytesPerSecondOfWrite\":3.6425412,\"numberOfReadOperationsPerSecond\":85.78786,\"numberOfWriteOperationsPerSecond\":50.352837},{\"diskId\":\"jlmxhomdynhd\",\"diskSizeInMB\":14.867181,\"megabytesPerSecondOfRead\":65.220894,\"megabytesPerSecondOfWrite\":96.30957,\"numberOfReadOperationsPerSecond\":44.797707,\"numberOfWriteOperationsPerSecond\":71.97788}],\"databaseSummary\":{\"numberOfUserDatabases\":171373878,\"totalDatabaseSizeInMB\":9.2906,\"largestDatabaseSizeInMB\":4.538435,\"totalDiscoveredUserDatabases\":1799745167},\"confidenceRatingInPercentage\":10.202331,\"sizingCriterion\":\"AsOnPremises\",\"createdTimestamp\":\"2021-05-07T02:49:48Z\",\"updatedTimestamp\":\"2021-01-19T00:29:52Z\"},\"id\":\"aiqyuvvfo\",\"name\":\"kphhq\",\"type\":\"ikvylauya\"}],\"nextLink\":\"uwmncs\"}") - .toObject(AssessedSqlInstanceV2ListResult.class); - Assertions.assertEquals("uwmncs", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessedSqlInstanceV2ListResult model = new AssessedSqlInstanceV2ListResult() - .withValue( - Arrays.asList(new AssessedSqlInstanceV2Inner().withProperties(new AssessedSqlInstanceV2Properties()), - new AssessedSqlInstanceV2Inner().withProperties(new AssessedSqlInstanceV2Properties()), - new AssessedSqlInstanceV2Inner().withProperties(new AssessedSqlInstanceV2Properties()))) - .withNextLink("uwmncs"); - model = BinaryData.fromObject(model).toObject(AssessedSqlInstanceV2ListResult.class); - Assertions.assertEquals("uwmncs", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV2OperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV2OperationsGetWithResponseMockTests.java deleted file mode 100644 index 2e03de8967ec..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV2OperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV2; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessedSqlInstanceV2OperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"memoryInUseInMB\":19.453466,\"hasScanOccurred\":false,\"recommendedAzureSqlTargetType\":\"AzureSqlVirtualMachine\",\"recommendedSuitability\":\"NotSuitable\",\"azureSqlMISuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"Automatic\",\"azureSqlComputeTier\":\"Automatic\",\"azureSqlHardwareGeneration\":\"Unknown\",\"storageMaxSizeInMB\":45.947193,\"predictedDataSizeInMB\":52.061802,\"predictedLogSizeInMB\":64.5819,\"cores\":1310159626,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"BusinessCritical\",\"azureSqlComputeTier\":\"Automatic\",\"azureSqlHardwareGeneration\":\"M_series\",\"storageMaxSizeInMB\":67.216576,\"predictedDataSizeInMB\":4.7587276,\"predictedLogSizeInMB\":65.09306,\"cores\":237480750,\"azureSqlTargetType\":\"Unknown\"},{\"azureSqlServiceTier\":\"GeneralPurpose\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Unknown\",\"storageMaxSizeInMB\":97.77749,\"predictedDataSizeInMB\":2.8196573,\"predictedLogSizeInMB\":65.7672,\"cores\":213893896,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"},{\"azureSqlServiceTier\":\"BusinessCritical\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"Gen5\",\"storageMaxSizeInMB\":94.609795,\"predictedDataSizeInMB\":18.32378,\"predictedLogSizeInMB\":17.042362,\"cores\":479855612,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"},{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"Unknown\",\"storageMaxSizeInMB\":43.615593,\"predictedDataSizeInMB\":93.414345,\"predictedLogSizeInMB\":74.58498,\"cores\":397490106,\"azureSqlTargetType\":\"AzureVirtualMachine\"}],\"sharedResources\":{\"sharedDataDisks\":[{},{},{}],\"sharedLogDisks\":[{}],\"sharedTempDbDisks\":[{},{},{}],\"numberOfMounts\":1331477699,\"quorumWitness\":{\"quorumWitnessType\":\"Cloud\"}},\"monthlyComputeCost\":6.4360976,\"monthlyStorageCost\":23.65986,\"costComponents\":[{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":12.912739,\"description\":\"pu\"},{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":34.745342,\"description\":\"jljmphfkyezol\"}],\"securitySuitability\":\"NotSuitable\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"ActiveGeoReplication\",\"migrationGuidelines\":[{\"guidelineId\":\"ccn\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{}]},{\"guidelineId\":\"bui\",\"migrationGuidelineCategory\":\"AvailabilityGroupGuideline\",\"migrationGuidelineContext\":[{},{}]},{\"guidelineId\":\"ecaatsdohzniuc\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{},{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"injdllwktlepo\",\"reasoningString\":\"vvqxua\",\"reasoningCategory\":\"cqwulynkgfcfd\",\"contextParameters\":[{},{},{},{}]},{\"reasoningId\":\"i\",\"reasoningString\":\"xtclhuulriqbyok\",\"reasoningCategory\":\"gbzsxebrslt\",\"contextParameters\":[{},{},{},{}]},{\"reasoningId\":\"cdjwsu\",\"reasoningString\":\"r\",\"reasoningCategory\":\"agttpufpb\",\"contextParameters\":[{},{},{}]}],\"migrationTargetPlatform\":\"AzureVirtualMachine\",\"suitability\":\"ConditionallySuitable\",\"migrationIssues\":[{\"issueId\":\"bfwxiplkys\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{}]},{\"issueId\":\"rxslwhdmcv\",\"issueCategory\":\"Warning\",\"impactedObjects\":[{},{},{},{}]},{\"issueId\":\"hfvhuwzbxpcqz\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{}]}]},\"azureSqlDBSuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"BusinessCritical\",\"azureSqlComputeTier\":\"Unknown\",\"azureSqlHardwareGeneration\":\"DC_series\",\"storageMaxSizeInMB\":42.872566,\"predictedDataSizeInMB\":79.52465,\"predictedLogSizeInMB\":8.235895,\"cores\":1723467853,\"azureSqlTargetType\":\"AzureVirtualMachine\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"BusinessCritical\",\"azureSqlComputeTier\":\"Automatic\",\"azureSqlHardwareGeneration\":\"Gen5\",\"storageMaxSizeInMB\":50.997044,\"predictedDataSizeInMB\":65.91321,\"predictedLogSizeInMB\":34.034336,\"cores\":271586436,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"}],\"sharedResources\":{\"sharedDataDisks\":[{}],\"sharedLogDisks\":[{}],\"sharedTempDbDisks\":[{},{},{},{}],\"numberOfMounts\":101688613,\"quorumWitness\":{\"quorumWitnessType\":\"Cloud\"}},\"monthlyComputeCost\":39.085915,\"monthlyStorageCost\":56.776505,\"costComponents\":[{\"name\":\"Unknown\",\"value\":61.30045,\"description\":\"ejeg\"},{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":35.092632,\"description\":\"wrjmwv\"}],\"securitySuitability\":\"Suitable\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"FailoverGroupInstance\",\"migrationGuidelines\":[{\"guidelineId\":\"wgxql\",\"migrationGuidelineCategory\":\"Unknown\",\"migrationGuidelineContext\":[{},{},{}]},{\"guidelineId\":\"gxieqfkyfhi\",\"migrationGuidelineCategory\":\"AvailabilityGroupGuideline\",\"migrationGuidelineContext\":[{}]},{\"guidelineId\":\"pbyynvskpajbm\",\"migrationGuidelineCategory\":\"General\",\"migrationGuidelineContext\":[{}]},{\"guidelineId\":\"mj\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"qmtxapeqiscrp\",\"reasoningString\":\"gftrqrejdaahuqim\",\"reasoningCategory\":\"ahlfxlmuifmuadj\",\"contextParameters\":[{}]}],\"migrationTargetPlatform\":\"AzureSqlManagedInstance\",\"suitability\":\"ConditionallySuitable\",\"migrationIssues\":[{\"issueId\":\"shjgczetybnxg\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{}]},{\"issueId\":\"tjchfjvmy\",\"issueCategory\":\"Warning\",\"impactedObjects\":[{},{},{},{}]},{\"issueId\":\"cu\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{}]},{\"issueId\":\"wc\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{},{},{}]}]},\"azureSqlVMSuitabilityDetails\":{\"azureSqlSku\":{\"virtualMachineSize\":{\"azureVmFamily\":\"Lsv2_series\",\"cores\":104057558,\"azureSkuName\":\"Standard_M8ms\",\"availableCores\":123145419,\"maxNetworkInterfaces\":711165961},\"dataDiskSizes\":[{},{},{},{}],\"logDiskSizes\":[{},{}],\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"},\"replicaAzureSqlSku\":[{\"virtualMachineSize\":{},\"dataDiskSizes\":[{},{},{},{}],\"logDiskSizes\":[{},{}],\"azureSqlTargetType\":\"Recommended\"},{\"virtualMachineSize\":{},\"dataDiskSizes\":[{}],\"logDiskSizes\":[{},{}],\"azureSqlTargetType\":\"AzureSqlDatabase\"},{\"virtualMachineSize\":{},\"dataDiskSizes\":[{},{}],\"logDiskSizes\":[{},{}],\"azureSqlTargetType\":\"AzureSqlManagedInstance\"},{\"virtualMachineSize\":{},\"dataDiskSizes\":[{},{}],\"logDiskSizes\":[{},{},{}],\"azureSqlTargetType\":\"Unknown\"}],\"sharedResources\":{\"sharedDataDisks\":[{}],\"sharedLogDisks\":[{}],\"sharedTempDbDisks\":[{}],\"numberOfMounts\":214582888,\"quorumWitness\":{\"quorumWitnessType\":\"Cloud\"}},\"monthlyComputeCost\":56.19525,\"monthlyStorageCost\":79.92231,\"costComponents\":[{\"name\":\"MonthlySecurityCost\",\"value\":86.46576,\"description\":\"ntwhymxymulwiv\"},{\"name\":\"Unknown\",\"value\":17.481882,\"description\":\"lsycoyb\"}],\"securitySuitability\":\"Unknown\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"FailoverGroupInstance\",\"migrationGuidelines\":[{\"guidelineId\":\"cywhj\",\"migrationGuidelineCategory\":\"General\",\"migrationGuidelineContext\":[{},{},{}]},{\"guidelineId\":\"oh\",\"migrationGuidelineCategory\":\"General\",\"migrationGuidelineContext\":[{},{},{}]},{\"guidelineId\":\"pukiymjzpwdlvwt\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{},{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"nhqnampp\",\"reasoningString\":\"tassaekewna\",\"reasoningCategory\":\"ajbk\",\"contextParameters\":[{},{},{}]},{\"reasoningId\":\"yizyddcvxodk\",\"reasoningString\":\"fsxxby\",\"reasoningCategory\":\"sqlv\",\"contextParameters\":[{},{},{},{}]},{\"reasoningId\":\"wgoljtzx\",\"reasoningString\":\"xsdobygoogxqapjx\",\"reasoningCategory\":\"zyjfuc\",\"contextParameters\":[{},{}]}],\"migrationTargetPlatform\":\"AzureVirtualMachine\",\"suitability\":\"NotSuitable\",\"migrationIssues\":[{\"issueId\":\"vibfasgmatrnzpd\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{}]}]},\"storageTypeBasedDetails\":[{\"storageType\":\"jktzboimyfpq\",\"diskSizeInMB\":73.76388,\"megabytesPerSecondOfRead\":88.76066,\"megabytesPerSecondOfWrite\":40.329243,\"numberOfReadOperationsPerSecond\":46.28459,\"numberOfWriteOperationsPerSecond\":71.138016}],\"productSupportStatus\":{\"currentVersion\":\"pctf\",\"servicePackStatus\":\"kffffgkuh\",\"esuStatus\":\"whvuldbkk\",\"supportStatus\":\"jkjigawgaz\",\"eta\":1272427334,\"currentEsuYear\":\"ifhujjsbcm\",\"mainstreamEndDate\":\"2021-08-31T07:34:01Z\",\"extendedSupportEndDate\":\"2021-11-05T17:50:30Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-01-17T05:07:29Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-04-15T18:23:21Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-05-31T02:30:19Z\"},\"fciMetadata\":{\"state\":\"Unknown\",\"isMultiSubnet\":false,\"fciSharedDiskCount\":22789876},\"availabilityReplicaSummary\":{\"numberOfSynchronousReadReplicas\":1841605546,\"numberOfSynchronousNonReadReplicas\":521127313,\"numberOfAsynchronousReadReplicas\":356055012,\"numberOfAsynchronousNonReadReplicas\":1899652732,\"numberOfPrimaryReplicas\":825740305},\"isClustered\":true,\"isHighAvailabilityEnabled\":true,\"recommendedTargetReasonings\":[{\"reasoningId\":\"oialahfxwccokdx\",\"reasoningString\":\"kmkcz\",\"reasoningCategory\":\"uhhoqeqshavlj\",\"contextParameters\":[{},{}]},{\"reasoningId\":\"rqolnthbb\",\"reasoningString\":\"gzukw\",\"reasoningCategory\":\"nzkjthfceyjn\",\"contextParameters\":[{},{},{}]},{\"reasoningId\":\"fuyf\",\"reasoningString\":\"pfiddhl\",\"reasoningCategory\":\"fz\",\"contextParameters\":[{},{}]},{\"reasoningId\":\"mq\",\"reasoningString\":\"uiocuselqkrsazr\",\"reasoningCategory\":\"uddq\",\"contextParameters\":[{},{}]}],\"machineArmId\":\"fisjmrkk\",\"machineName\":\"wdmdlgyqixokwt\",\"instanceName\":\"whvagnqfq\",\"sqlInstanceSdsArmId\":\"lcvmyolcaymjch\",\"sqlEdition\":\"snvlaqd\",\"sqlVersion\":\"yzawatu\",\"numberOfCoresAllocated\":805735300,\"percentageCoresUtilization\":56.507713,\"logicalDisks\":[{\"diskId\":\"othymgobl\",\"diskSizeInMB\":51.443768,\"megabytesPerSecondOfRead\":35.20525,\"megabytesPerSecondOfWrite\":78.35538,\"numberOfReadOperationsPerSecond\":32.124214,\"numberOfWriteOperationsPerSecond\":10.101181},{\"diskId\":\"eakhtmhobcya\",\"diskSizeInMB\":65.80291,\"megabytesPerSecondOfRead\":27.580101,\"megabytesPerSecondOfWrite\":29.441761,\"numberOfReadOperationsPerSecond\":99.774185,\"numberOfWriteOperationsPerSecond\":50.755436},{\"diskId\":\"ogxkfnaoa\",\"diskSizeInMB\":64.4314,\"megabytesPerSecondOfRead\":95.15503,\"megabytesPerSecondOfWrite\":52.549206,\"numberOfReadOperationsPerSecond\":52.02517,\"numberOfWriteOperationsPerSecond\":2.8191447}],\"databaseSummary\":{\"numberOfUserDatabases\":1466940432,\"totalDatabaseSizeInMB\":79.28132,\"largestDatabaseSizeInMB\":82.22219,\"totalDiscoveredUserDatabases\":1456079584},\"confidenceRatingInPercentage\":25.972563,\"sizingCriterion\":\"PerformanceBased\",\"createdTimestamp\":\"2021-06-09T18:25:31Z\",\"updatedTimestamp\":\"2021-02-17T03:07:14Z\"},\"id\":\"hajpxecxqnwhsc\",\"name\":\"zawmvgxsmp\",\"type\":\"npwirfljf\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - AssessedSqlInstanceV2 response = manager.assessedSqlInstanceV2Operations() - .getWithResponse("hazyntacihnco", "mip", "mliqmvlb", "i", "eaqgrvgpomxpupd", - com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV2OperationsListBySqlAssessmentV2MockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV2OperationsListBySqlAssessmentV2MockTests.java deleted file mode 100644 index 3e2d1cf88664..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlInstanceV2OperationsListBySqlAssessmentV2MockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlInstanceV2; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessedSqlInstanceV2OperationsListBySqlAssessmentV2MockTests { - @Test - public void testListBySqlAssessmentV2() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"memoryInUseInMB\":33.808918,\"hasScanOccurred\":false,\"recommendedAzureSqlTargetType\":\"AzureVirtualMachine\",\"recommendedSuitability\":\"SuitableForSqlMI\",\"azureSqlMISuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"GeneralPurpose\",\"azureSqlComputeTier\":\"Automatic\",\"azureSqlHardwareGeneration\":\"Fsv2_series\",\"storageMaxSizeInMB\":13.264579,\"predictedDataSizeInMB\":63.21829,\"predictedLogSizeInMB\":6.2892556,\"cores\":997777760,\"azureSqlTargetType\":\"AzureVirtualMachine\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Unknown\",\"azureSqlHardwareGeneration\":\"Gen5\",\"storageMaxSizeInMB\":94.98802,\"predictedDataSizeInMB\":7.5854063,\"predictedLogSizeInMB\":31.403267,\"cores\":1914755995,\"azureSqlTargetType\":\"AzureSqlDatabase\"},{\"azureSqlServiceTier\":\"Automatic\",\"azureSqlComputeTier\":\"Unknown\",\"azureSqlHardwareGeneration\":\"Unknown\",\"storageMaxSizeInMB\":74.13537,\"predictedDataSizeInMB\":83.00802,\"predictedLogSizeInMB\":10.367346,\"cores\":281693558,\"azureSqlTargetType\":\"Unknown\"}],\"sharedResources\":{\"sharedDataDisks\":[{}],\"sharedLogDisks\":[{},{},{}],\"sharedTempDbDisks\":[{},{},{},{}],\"numberOfMounts\":631913462,\"quorumWitness\":{\"quorumWitnessType\":\"Cloud\"}},\"monthlyComputeCost\":60.338818,\"monthlyStorageCost\":78.85587,\"costComponents\":[{\"name\":\"Unknown\",\"value\":74.62461,\"description\":\"frjeizikgqaboohx\"},{\"name\":\"Unknown\",\"value\":35.841705,\"description\":\"qsxrmdvewu\"}],\"securitySuitability\":\"ReadinessUnknown\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"FailoverGroupInstance\",\"migrationGuidelines\":[{\"guidelineId\":\"ejkbvhhdaurgho\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{}]},{\"guidelineId\":\"k\",\"migrationGuidelineCategory\":\"General\",\"migrationGuidelineContext\":[{},{},{},{}]},{\"guidelineId\":\"ezlqxrkdknkobek\",\"migrationGuidelineCategory\":\"Unknown\",\"migrationGuidelineContext\":[{}]},{\"guidelineId\":\"m\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"gwcd\",\"reasoningString\":\"sez\",\"reasoningCategory\":\"xke\",\"contextParameters\":[{},{},{},{}]},{\"reasoningId\":\"aabmdlqjb\",\"reasoningString\":\"pfixlhupmo\",\"reasoningCategory\":\"hzbdnpxpkcd\",\"contextParameters\":[{},{}]},{\"reasoningId\":\"xelyicghflr\",\"reasoningString\":\"ssjyghsfx\",\"reasoningCategory\":\"bh\",\"contextParameters\":[{},{}]},{\"reasoningId\":\"mqfmefgvqcpd\",\"reasoningString\":\"gquxweysland\",\"reasoningCategory\":\"cdjhunhg\",\"contextParameters\":[{},{},{}]}],\"migrationTargetPlatform\":\"AzureSqlDatabase\",\"suitability\":\"ConditionallySuitable\",\"migrationIssues\":[{\"issueId\":\"uoxsot\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{},{},{}]},{\"issueId\":\"eobfsxstcyilbvzm\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{}]},{\"issueId\":\"quzexokjxebjvbz\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{},{}]},{\"issueId\":\"mvoglj\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{}]}]},\"azureSqlDBSuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"GeneralPurpose\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"Fsv2_series\",\"storageMaxSizeInMB\":33.00345,\"predictedDataSizeInMB\":30.276209,\"predictedLogSizeInMB\":21.576887,\"cores\":1389972866,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Unknown\",\"storageMaxSizeInMB\":57.369076,\"predictedDataSizeInMB\":81.87431,\"predictedLogSizeInMB\":83.95499,\"cores\":566172372,\"azureSqlTargetType\":\"Recommended\"},{\"azureSqlServiceTier\":\"BusinessCritical\",\"azureSqlComputeTier\":\"Unknown\",\"azureSqlHardwareGeneration\":\"Gen5\",\"storageMaxSizeInMB\":78.953186,\"predictedDataSizeInMB\":87.84802,\"predictedLogSizeInMB\":19.716978,\"cores\":206631041,\"azureSqlTargetType\":\"Recommended\"},{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"Gen5\",\"storageMaxSizeInMB\":30.602943,\"predictedDataSizeInMB\":16.692627,\"predictedLogSizeInMB\":39.051582,\"cores\":1674868569,\"azureSqlTargetType\":\"AzureSqlDatabase\"},{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Automatic\",\"azureSqlHardwareGeneration\":\"Gen5\",\"storageMaxSizeInMB\":27.860897,\"predictedDataSizeInMB\":7.6609254,\"predictedLogSizeInMB\":48.291744,\"cores\":724295825,\"azureSqlTargetType\":\"AzureVirtualMachine\"}],\"sharedResources\":{\"sharedDataDisks\":[{}],\"sharedLogDisks\":[{}],\"sharedTempDbDisks\":[{},{},{},{}],\"numberOfMounts\":1257889233,\"quorumWitness\":{\"quorumWitnessType\":\"Unknown\"}},\"monthlyComputeCost\":55.536007,\"monthlyStorageCost\":55.264236,\"costComponents\":[{\"name\":\"MonthlySecurityCost\",\"value\":22.828722,\"description\":\"pywyjlnld\"},{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":9.84984,\"description\":\"iiaocqib\"},{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":62.204887,\"description\":\"ebiphryvcjwqwoq\"},{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":29.57796,\"description\":\"dhzybsp\"}],\"securitySuitability\":\"Unknown\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"ActiveGeoReplication\",\"migrationGuidelines\":[{\"guidelineId\":\"agvwukhs\",\"migrationGuidelineCategory\":\"Unknown\",\"migrationGuidelineContext\":[{},{},{}]},{\"guidelineId\":\"fmz\",\"migrationGuidelineCategory\":\"Unknown\",\"migrationGuidelineContext\":[{},{},{},{}]},{\"guidelineId\":\"hnijmriprlkdneyt\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{},{},{}]},{\"guidelineId\":\"v\",\"migrationGuidelineCategory\":\"General\",\"migrationGuidelineContext\":[{},{},{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"ltw\",\"reasoningString\":\"lu\",\"reasoningCategory\":\"nbpvzlq\",\"contextParameters\":[{},{}]},{\"reasoningId\":\"y\",\"reasoningString\":\"jckhmocgj\",\"reasoningCategory\":\"gouarhwvixqq\",\"contextParameters\":[{}]},{\"reasoningId\":\"kybsj\",\"reasoningString\":\"lrvtz\",\"reasoningCategory\":\"rbctbhpjhxpcvrd\",\"contextParameters\":[{},{},{},{}]}],\"migrationTargetPlatform\":\"Unknown\",\"suitability\":\"Suitable\",\"migrationIssues\":[{\"issueId\":\"dynzjahwr\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{},{}]}]},\"azureSqlVMSuitabilityDetails\":{\"azureSqlSku\":{\"virtualMachineSize\":{\"azureVmFamily\":\"Fs_series\",\"cores\":1279251745,\"azureSkuName\":\"Standard_E2s_v4\",\"availableCores\":111361676,\"maxNetworkInterfaces\":1303757705},\"dataDiskSizes\":[{},{}],\"logDiskSizes\":[{},{},{},{}],\"azureSqlTargetType\":\"Unknown\"},\"replicaAzureSqlSku\":[{\"virtualMachineSize\":{},\"dataDiskSizes\":[{}],\"logDiskSizes\":[{},{},{},{}],\"azureSqlTargetType\":\"AzureVirtualMachine\"},{\"virtualMachineSize\":{},\"dataDiskSizes\":[{},{},{}],\"logDiskSizes\":[{},{}],\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"},{\"virtualMachineSize\":{},\"dataDiskSizes\":[{}],\"logDiskSizes\":[{},{}],\"azureSqlTargetType\":\"AzureSqlDatabase\"},{\"virtualMachineSize\":{},\"dataDiskSizes\":[{}],\"logDiskSizes\":[{}],\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"}],\"sharedResources\":{\"sharedDataDisks\":[{},{}],\"sharedLogDisks\":[{},{},{}],\"sharedTempDbDisks\":[{},{}],\"numberOfMounts\":251648854,\"quorumWitness\":{\"quorumWitnessType\":\"Cloud\"}},\"monthlyComputeCost\":82.192,\"monthlyStorageCost\":92.815796,\"costComponents\":[{\"name\":\"MonthlySecurityCost\",\"value\":69.84208,\"description\":\"cko\"},{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":27.702517,\"description\":\"spftesubzpv\"},{\"name\":\"MonthlySecurityCost\",\"value\":16.102236,\"description\":\"tcovqseusrfjb\"}],\"securitySuitability\":\"NotSuitable\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"NotApplicable\",\"migrationGuidelines\":[{\"guidelineId\":\"muoswkjmdih\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{},{},{}]},{\"guidelineId\":\"lwhbwzjnu\",\"migrationGuidelineCategory\":\"AvailabilityGroupGuideline\",\"migrationGuidelineContext\":[{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"gnnbzrtf\",\"reasoningString\":\"dzuubjtvgjsxm\",\"reasoningCategory\":\"jjvavdpww\",\"contextParameters\":[{}]}],\"migrationTargetPlatform\":\"AzureVirtualMachine\",\"suitability\":\"ConditionallySuitable\",\"migrationIssues\":[{\"issueId\":\"ffofwan\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{},{},{}]},{\"issueId\":\"uwazcgwdfriwg\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{},{}]}]},\"storageTypeBasedDetails\":[{\"storageType\":\"scvgl\",\"diskSizeInMB\":4.1600227,\"megabytesPerSecondOfRead\":40.736492,\"megabytesPerSecondOfWrite\":56.071045,\"numberOfReadOperationsPerSecond\":94.1541,\"numberOfWriteOperationsPerSecond\":81.04214}],\"productSupportStatus\":{\"currentVersion\":\"k\",\"servicePackStatus\":\"xprwpxs\",\"esuStatus\":\"hu\",\"supportStatus\":\"lcsklt\",\"eta\":964103530,\"currentEsuYear\":\"ggg\",\"mainstreamEndDate\":\"2021-01-18T11:27:05Z\",\"extendedSupportEndDate\":\"2021-03-14T03:41:27Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-05-28T15:32:03Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-03-27T21:52:24Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-08-12T22:14Z\"},\"fciMetadata\":{\"state\":\"Pending\",\"isMultiSubnet\":true,\"fciSharedDiskCount\":1216756136},\"availabilityReplicaSummary\":{\"numberOfSynchronousReadReplicas\":1106035745,\"numberOfSynchronousNonReadReplicas\":2114805426,\"numberOfAsynchronousReadReplicas\":1200969454,\"numberOfAsynchronousNonReadReplicas\":866635783,\"numberOfPrimaryReplicas\":1139207418},\"isClustered\":false,\"isHighAvailabilityEnabled\":true,\"recommendedTargetReasonings\":[{\"reasoningId\":\"fbodetresrgvts\",\"reasoningString\":\"vftwaiv\",\"reasoningCategory\":\"qkevzgj\",\"contextParameters\":[{}]},{\"reasoningId\":\"hxmpdxxz\",\"reasoningString\":\"wwzjwotnxlkfhglh\",\"reasoningCategory\":\"oxqwecrsnhpcse\",\"contextParameters\":[{},{},{},{}]},{\"reasoningId\":\"vppqi\",\"reasoningString\":\"kklvzrlrmlccmet\",\"reasoningCategory\":\"czivfqbqna\",\"contextParameters\":[{}]}],\"machineArmId\":\"enz\",\"machineName\":\"euscplhyv\",\"instanceName\":\"xlyzkxit\",\"sqlInstanceSdsArmId\":\"hezsvkolrupjovm\",\"sqlEdition\":\"sayebra\",\"sqlVersion\":\"zlpzbtzuyky\",\"numberOfCoresAllocated\":770520105,\"percentageCoresUtilization\":45.060116,\"logicalDisks\":[{\"diskId\":\"pfnocm\",\"diskSizeInMB\":68.22835,\"megabytesPerSecondOfRead\":7.444686,\"megabytesPerSecondOfWrite\":94.60865,\"numberOfReadOperationsPerSecond\":17.045683,\"numberOfWriteOperationsPerSecond\":98.33398},{\"diskId\":\"wyqejgaao\",\"diskSizeInMB\":94.436035,\"megabytesPerSecondOfRead\":71.84324,\"megabytesPerSecondOfWrite\":94.4489,\"numberOfReadOperationsPerSecond\":60.43468,\"numberOfWriteOperationsPerSecond\":92.890724}],\"databaseSummary\":{\"numberOfUserDatabases\":2076485508,\"totalDatabaseSizeInMB\":71.95924,\"largestDatabaseSizeInMB\":57.79177,\"totalDiscoveredUserDatabases\":2115508099},\"confidenceRatingInPercentage\":6.8730474,\"sizingCriterion\":\"AsOnPremises\",\"createdTimestamp\":\"2021-06-13T17:39:06Z\",\"updatedTimestamp\":\"2021-07-12T06:05:15Z\"},\"id\":\"cqvhoejgoiutgwrm\",\"name\":\"a\",\"type\":\"p\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.assessedSqlInstanceV2Operations() - .listBySqlAssessmentV2("fgjblcd", "myfc", "mftzgyy", "y", "lugekdfqnhtt", 500622504, "owrczfjjnnuxxr", - 1309033644, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachineListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachineListResultTests.java deleted file mode 100644 index d9957b7f9efa..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachineListResultTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlMachineInner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachineListResult; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachineProperties; -import com.azure.resourcemanager.migration.assessment.models.CostComponent; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AssessedSqlMachineListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessedSqlMachineListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"biosGuid\":\"fxeeebtijvacvbm\",\"fqdn\":\"bqqxlaj\",\"sqlInstances\":[{\"instanceId\":\"acevehjkuyx\",\"instanceName\":\"fgaoq\",\"sqlInstanceSdsArmId\":\"faey\",\"sqlInstanceEntityId\":\"nm\",\"sqlEdition\":\"vxirpghriypo\",\"sqlVersion\":\"yhlqhykprlpyznu\",\"isClustered\":true,\"isHighAvailabilityEnabled\":true,\"sqlFciState\":\"Unknown\"},{\"instanceId\":\"iitdfuxt\",\"instanceName\":\"siibmiybnnustgn\",\"sqlInstanceSdsArmId\":\"hnmgixhcm\",\"sqlInstanceEntityId\":\"mqfoudorh\",\"sqlEdition\":\"yyprotwyp\",\"sqlVersion\":\"d\",\"isClustered\":false,\"isHighAvailabilityEnabled\":true,\"sqlFciState\":\"NotApplicable\"},{\"instanceId\":\"jkavl\",\"instanceName\":\"rb\",\"sqlInstanceSdsArmId\":\"tp\",\"sqlInstanceEntityId\":\"tzfjltf\",\"sqlEdition\":\"zcyjtot\",\"sqlVersion\":\"opv\",\"isClustered\":true,\"isHighAvailabilityEnabled\":false,\"sqlFciState\":\"Passive\"}],\"suitabilityDetail\":\"RecommendedSizeHasLessNetworkAdapters\",\"suitabilityExplanation\":\"NoVmSizeForStandardPricingTier\",\"recommendedVmSize\":\"Standard_D4a_v4\",\"recommendedVmFamily\":\"Ev3_series\",\"productSupportStatus\":{\"currentVersion\":\"thmkyib\",\"servicePackStatus\":\"sihsgqcwdhohsd\",\"esuStatus\":\"cdzsu\",\"supportStatus\":\"ohdxbzlmcmu\",\"eta\":879403543,\"currentEsuYear\":\"hdbevwqqxeyskon\",\"mainstreamEndDate\":\"2021-02-12T17:13:55Z\",\"extendedSupportEndDate\":\"2021-07-17T19:35:55Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-04-21T10:40:59Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-05-07T03:06:31Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-05-29T05:06:31Z\"},\"recommendedVmSizeNumberOfCores\":579813186,\"recommendedVmSizeMegabytesOfMemory\":30.244493,\"monthlyComputeCost\":18.97896,\"disks\":{\"zmqpnodawopqhewj\":{\"suitability\":\"NotSuitable\",\"suitabilityExplanation\":\"Unknown\",\"suitabilityDetail\":\"DiskGigabytesProvisionedMissing\",\"recommendedDiskSize\":\"StandardSSD_E70\",\"recommendedDiskType\":\"StandardOrPremium\",\"recommendedDiskSizeGigabytes\":1858033886,\"recommendDiskThroughputInMbps\":33.499878,\"recommendedDiskIops\":39.537643,\"monthlyStorageCost\":90.73885,\"name\":\"ezrxcczurtleipqx\",\"displayName\":\"wvz\",\"gigabytesProvisioned\":17.816608,\"megabytesPerSecondOfRead\":60.011448,\"megabytesPerSecondOfWrite\":48.05835,\"numberOfReadOperationsPerSecond\":4.7126713,\"numberOfWriteOperationsPerSecond\":70.94812}},\"networkAdapters\":{\"lbkpb\":{\"suitability\":\"ConditionallySuitable\",\"suitabilityDetail\":\"MegabytesOfDataTransmittedOutOfRange\",\"suitabilityExplanation\":\"Unknown\",\"monthlyBandwidthCosts\":88.63707,\"netGigabytesTransmittedPerMonth\":16.294712,\"name\":\"dlat\",\"displayName\":\"mzlbiojlvfhrb\",\"macAddress\":\"neqvcwwyyurmo\",\"ipAddresses\":[\"prprsnmokay\"],\"megabytesPerSecondReceived\":95.21919,\"megabytesPerSecondTransmitted\":12.67882},\"apjwogqqnobpudcd\":{\"suitability\":\"NotSuitable\",\"suitabilityDetail\":\"None\",\"suitabilityExplanation\":\"NotApplicable\",\"monthlyBandwidthCosts\":1.7720342,\"netGigabytesTransmittedPerMonth\":9.317743,\"name\":\"echndbnwieholew\",\"displayName\":\"iuubwefqsf\",\"macAddress\":\"aqtferr\",\"ipAddresses\":[\"x\"],\"megabytesPerSecondReceived\":78.82658,\"megabytesPerSecondTransmitted\":16.184013},\"yfu\":{\"suitability\":\"Suitable\",\"suitabilityDetail\":\"None\",\"suitabilityExplanation\":\"NotApplicable\",\"monthlyBandwidthCosts\":46.80928,\"netGigabytesTransmittedPerMonth\":95.067,\"name\":\"asqbucljgkyex\",\"displayName\":\"guyaip\",\"macAddress\":\"sdaultxij\",\"ipAddresses\":[\"fqwazlnqnmcjn\",\"zqdqxt\"],\"megabytesPerSecondReceived\":84.08586,\"megabytesPerSecondTransmitted\":91.10522},\"bp\":{\"suitability\":\"Unknown\",\"suitabilityDetail\":\"MegabytesOfDataRecievedMissing\",\"suitabilityExplanation\":\"NotApplicable\",\"monthlyBandwidthCosts\":72.10318,\"netGigabytesTransmittedPerMonth\":51.849754,\"name\":\"jqg\",\"displayName\":\"fh\",\"macAddress\":\"rqryxynqn\",\"ipAddresses\":[\"p\",\"ovw\",\"zn\",\"tgoe\"],\"megabytesPerSecondReceived\":26.714617,\"megabytesPerSecondTransmitted\":46.57859}},\"monthlyBandwidthCost\":11.20854,\"monthlyStorageCost\":47.728634,\"costComponents\":[{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":94.41636,\"description\":\"rigjkskyrioov\"},{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":95.8368,\"description\":\"aabzmif\"},{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":73.946815,\"description\":\"maxriz\"},{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":86.51203,\"description\":\"pxl\"}],\"securitySuitability\":\"NotSuitable\",\"migrationGuidelines\":[{\"guidelineId\":\"xieixynllxec\",\"migrationGuidelineCategory\":\"AvailabilityGroupGuideline\",\"migrationGuidelineContext\":[{},{},{}]},{\"guidelineId\":\"hslhca\",\"migrationGuidelineCategory\":\"Unknown\",\"migrationGuidelineContext\":[{}]},{\"guidelineId\":\"dwfmvigorqjb\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{}]},{\"guidelineId\":\"glka\",\"migrationGuidelineCategory\":\"AvailabilityGroupGuideline\",\"migrationGuidelineContext\":[{},{},{},{}]}],\"bootType\":\"EFI\",\"operatingSystemType\":\"eickpz\",\"operatingSystemName\":\"p\",\"operatingSystemVersion\":\"mxelnwcltyjed\",\"operatingSystemArchitecture\":\"X64\",\"createdTimestamp\":\"2021-11-12T19:58:50Z\",\"updatedTimestamp\":\"2021-02-24T02:10:51Z\",\"displayName\":\"qscazuawxtz\",\"type\":\"AvsAssessedMachine\",\"description\":\"mwabzxrvxc\",\"datacenterMachineArmId\":\"hsphaivmxyas\",\"datacenterManagementServerArmId\":\"vgsgzwywakoihkn\",\"datacenterManagementServerName\":\"jblmljhlnymz\",\"megabytesOfMemory\":85.03406,\"numberOfCores\":494637597,\"confidenceRatingInPercentage\":40.960278,\"percentageCoresUtilization\":18.226921,\"percentageMemoryUtilization\":81.135086,\"suitability\":\"ReadinessUnknown\",\"sizingCriterion\":\"PerformanceBased\"},\"id\":\"vwf\",\"name\":\"tayx\",\"type\":\"nsup\"},{\"properties\":{\"biosGuid\":\"lzqnhcvs\",\"fqdn\":\"tnzoibgsxgnxfy\",\"sqlInstances\":[{\"instanceId\":\"p\",\"instanceName\":\"xwdofdb\",\"sqlInstanceSdsArmId\":\"qxeiiqbimhtmwwi\",\"sqlInstanceEntityId\":\"ehfqpofvwbc\",\"sqlEdition\":\"embnkbw\",\"sqlVersion\":\"vxkdivqihebwtswb\",\"isClustered\":true,\"isHighAvailabilityEnabled\":false,\"sqlFciState\":\"Active\"},{\"instanceId\":\"agegiz\",\"instanceName\":\"jfelisdjubggbqig\",\"sqlInstanceSdsArmId\":\"kbsazgak\",\"sqlInstanceEntityId\":\"cyrcmjdmspo\",\"sqlEdition\":\"pv\",\"sqlVersion\":\"rylniofrzg\",\"isClustered\":false,\"isHighAvailabilityEnabled\":false,\"sqlFciState\":\"Unknown\"},{\"instanceId\":\"kvnlvxbcuiiznkt\",\"instanceName\":\"ansnvp\",\"sqlInstanceSdsArmId\":\"bmikost\",\"sqlInstanceEntityId\":\"bkiw\",\"sqlEdition\":\"qnyophzfyls\",\"sqlVersion\":\"rpfbcunezz\",\"isClustered\":true,\"isHighAvailabilityEnabled\":true,\"sqlFciState\":\"Unknown\"}],\"suitabilityDetail\":\"CannotReportStorageCost\",\"suitabilityExplanation\":\"NoVmSizeForBasicPricingTier\",\"recommendedVmSize\":\"Standard_M416s_v2\",\"recommendedVmFamily\":\"F_series\",\"productSupportStatus\":{\"currentVersion\":\"npsihclaf\",\"servicePackStatus\":\"aylp\",\"esuStatus\":\"sqqw\",\"supportStatus\":\"cmwqkchcxwa\",\"eta\":307394034,\"currentEsuYear\":\"zjkjexfdeqv\",\"mainstreamEndDate\":\"2021-10-11T15:41:07Z\",\"extendedSupportEndDate\":\"2020-12-20T15:35:44Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-09-09T16:59:46Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-10-24T00:31:56Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-05-08T15:06:42Z\"},\"recommendedVmSizeNumberOfCores\":127913719,\"recommendedVmSizeMegabytesOfMemory\":71.40286,\"monthlyComputeCost\":36.90302,\"disks\":{\"zjgehkfkim\":{\"suitability\":\"ReadinessUnknown\",\"suitabilityExplanation\":\"NoSuitableDiskSizeForThroughput\",\"suitabilityDetail\":\"MegabytesPerSecondOfReadOutOfRange\",\"recommendedDiskSize\":\"Premium_P20\",\"recommendedDiskType\":\"StandardOrPremium\",\"recommendedDiskSizeGigabytes\":1849178398,\"recommendDiskThroughputInMbps\":19.441557,\"recommendedDiskIops\":45.75102,\"monthlyStorageCost\":37.261547,\"name\":\"gaao\",\"displayName\":\"ttaqutdew\",\"gigabytesProvisioned\":33.730103,\"megabytesPerSecondOfRead\":51.00159,\"megabytesPerSecondOfWrite\":69.260704,\"numberOfReadOperationsPerSecond\":53.282524,\"numberOfWriteOperationsPerSecond\":60.865467},\"o\":{\"suitability\":\"Suitable\",\"suitabilityExplanation\":\"NoEaPriceFoundForDiskSize\",\"suitabilityDetail\":\"MegabytesPerSecondOfWriteOutOfRange\",\"recommendedDiskSize\":\"Standard_S4\",\"recommendedDiskType\":\"Standard\",\"recommendedDiskSizeGigabytes\":1426347910,\"recommendDiskThroughputInMbps\":67.66341,\"recommendedDiskIops\":65.54477,\"monthlyStorageCost\":68.6272,\"name\":\"ixmonstshiyxg\",\"displayName\":\"lfcldu\",\"gigabytesProvisioned\":92.06999,\"megabytesPerSecondOfRead\":15.541893,\"megabytesPerSecondOfWrite\":18.709505,\"numberOfReadOperationsPerSecond\":17.68028,\"numberOfWriteOperationsPerSecond\":95.38093},\"bsmswziqgf\":{\"suitability\":\"ConditionallySuitable\",\"suitabilityExplanation\":\"DiskSizeGreaterThanSupported\",\"suitabilityDetail\":\"DiskGigabytesProvisionedMissing\",\"recommendedDiskSize\":\"StandardSSD_E10\",\"recommendedDiskType\":\"Ultra\",\"recommendedDiskSizeGigabytes\":1117030946,\"recommendDiskThroughputInMbps\":80.3862,\"recommendedDiskIops\":94.08675,\"monthlyStorageCost\":83.48194,\"name\":\"gshejjtbxqmulux\",\"displayName\":\"qzvnersbycucr\",\"gigabytesProvisioned\":73.3862,\"megabytesPerSecondOfRead\":31.644154,\"megabytesPerSecondOfWrite\":9.675158,\"numberOfReadOperationsPerSecond\":59.315407,\"numberOfWriteOperationsPerSecond\":30.78078}},\"networkAdapters\":{\"wvefloccsrmoz\":{\"suitability\":\"ConditionallySuitable\",\"suitabilityDetail\":\"MegabytesOfDataTransmittedOutOfRange\",\"suitabilityExplanation\":\"Unknown\",\"monthlyBandwidthCosts\":57.039474,\"netGigabytesTransmittedPerMonth\":79.71306,\"name\":\"znvfbycjsxjww\",\"displayName\":\"z\",\"macAddress\":\"mwmxqhndvnoamld\",\"ipAddresses\":[\"aohdjh\",\"flzokxco\",\"pelnjetag\",\"tsxoatftgz\"],\"megabytesPerSecondReceived\":83.193085,\"megabytesPerSecondTransmitted\":86.567474},\"znth\":{\"suitability\":\"NotSuitable\",\"suitabilityDetail\":\"None\",\"suitabilityExplanation\":\"Unknown\",\"monthlyBandwidthCosts\":14.893383,\"netGigabytesTransmittedPerMonth\":7.6503515,\"name\":\"ky\",\"displayName\":\"xcjxgrytfmpcy\",\"macAddress\":\"lrmcaykg\",\"ipAddresses\":[\"xu\",\"t\",\"ksxwpnd\"],\"megabytesPerSecondReceived\":71.74752,\"megabytesPerSecondTransmitted\":49.58568}},\"monthlyBandwidthCost\":33.53333,\"monthlyStorageCost\":55.912632,\"costComponents\":[{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":84.35982,\"description\":\"voamktcqiosmg\"},{\"name\":\"Unknown\",\"value\":18.612463,\"description\":\"qdlyrtl\"},{\"name\":\"Unknown\",\"value\":69.58039,\"description\":\"tz\"}],\"securitySuitability\":\"Unknown\",\"migrationGuidelines\":[{\"guidelineId\":\"mznnbsoqeqalarvl\",\"migrationGuidelineCategory\":\"Unknown\",\"migrationGuidelineContext\":[{},{}]}],\"bootType\":\"EFI\",\"operatingSystemType\":\"ebwlnbmhyreeudzq\",\"operatingSystemName\":\"bpdqmjxlyy\",\"operatingSystemVersion\":\"lgouwtlmjj\",\"operatingSystemArchitecture\":\"X64\",\"createdTimestamp\":\"2021-10-10T19:20:29Z\",\"updatedTimestamp\":\"2021-02-11T22:31:47Z\",\"displayName\":\"axkjeytunlbfjk\",\"type\":\"Unknown\",\"description\":\"nkqbhsyrq\",\"datacenterMachineArmId\":\"jqhden\",\"datacenterManagementServerArmId\":\"ulkpakd\",\"datacenterManagementServerName\":\"fmjnnawtqa\",\"megabytesOfMemory\":82.25649,\"numberOfCores\":1193273500,\"confidenceRatingInPercentage\":5.6159616,\"percentageCoresUtilization\":83.88325,\"percentageMemoryUtilization\":64.996155,\"suitability\":\"NotSuitable\",\"sizingCriterion\":\"PerformanceBased\"},\"id\":\"dhlisngwflqqmpi\",\"name\":\"ruwnpqxpx\",\"type\":\"wfcngjsaas\"}],\"nextLink\":\"xtmkzjvkviir\"}") - .toObject(AssessedSqlMachineListResult.class); - Assertions.assertEquals(94.41636F, model.value().get(0).properties().costComponents().get(0).value()); - Assertions.assertEquals("rigjkskyrioov", - model.value().get(0).properties().costComponents().get(0).description()); - Assertions.assertEquals("xtmkzjvkviir", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessedSqlMachineListResult model - = new AssessedSqlMachineListResult() - .withValue(Arrays.asList( - new AssessedSqlMachineInner().withProperties(new AssessedSqlMachineProperties().withCostComponents( - Arrays.asList(new CostComponent().withValue(94.41636F).withDescription("rigjkskyrioov"), - new CostComponent().withValue(95.8368F).withDescription("aabzmif"), - new CostComponent().withValue(73.946815F).withDescription("maxriz"), - new CostComponent().withValue(86.51203F).withDescription("pxl")))), - new AssessedSqlMachineInner().withProperties(new AssessedSqlMachineProperties().withCostComponents( - Arrays.asList(new CostComponent().withValue(84.35982F).withDescription("voamktcqiosmg"), - new CostComponent().withValue(18.612463F).withDescription("qdlyrtl"), - new CostComponent().withValue(69.58039F).withDescription("tz")))))) - .withNextLink("xtmkzjvkviir"); - model = BinaryData.fromObject(model).toObject(AssessedSqlMachineListResult.class); - Assertions.assertEquals(94.41636F, model.value().get(0).properties().costComponents().get(0).value()); - Assertions.assertEquals("rigjkskyrioov", - model.value().get(0).properties().costComponents().get(0).description()); - Assertions.assertEquals("xtmkzjvkviir", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesOperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesOperationsGetWithResponseMockTests.java deleted file mode 100644 index bbdfed93f089..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachine; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessedSqlMachinesOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"biosGuid\":\"impkjblorns\",\"fqdn\":\"qhudsmusuaawj\",\"sqlInstances\":[{\"instanceId\":\"jnfczmnniixy\",\"instanceName\":\"qban\",\"sqlInstanceSdsArmId\":\"jtgirnb\",\"sqlInstanceEntityId\":\"gm\",\"sqlEdition\":\"orgmynltwmpftm\",\"sqlVersion\":\"e\",\"isClustered\":false,\"isHighAvailabilityEnabled\":true,\"sqlFciState\":\"Unknown\"},{\"instanceId\":\"etamfddrvlkpzwb\",\"instanceName\":\"recchdidrmu\",\"sqlInstanceSdsArmId\":\"ahmjedbiu\",\"sqlInstanceEntityId\":\"khhwmj\",\"sqlEdition\":\"bweunxc\",\"sqlVersion\":\"rihufoihppiybxv\",\"isClustered\":true,\"isHighAvailabilityEnabled\":false,\"sqlFciState\":\"Unknown\"}],\"suitabilityDetail\":\"CannotReportBandwidthCosts\",\"suitabilityExplanation\":\"WindowsServerVersionConditionallySupported\",\"recommendedVmSize\":\"Standard_M8_4ms\",\"recommendedVmFamily\":\"Ddsv5_series\",\"productSupportStatus\":{\"currentVersion\":\"vkunhdim\",\"servicePackStatus\":\"ktirzka\",\"esuStatus\":\"pucdocf\",\"supportStatus\":\"lwgofm\",\"eta\":1996838839,\"currentEsuYear\":\"jlvzklk\",\"mainstreamEndDate\":\"2021-05-28T13:53:53Z\",\"extendedSupportEndDate\":\"2021-01-21T09:29:50Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-09-07T03:18:30Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-08-04T05:52:07Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-04-25T02:02Z\"},\"recommendedVmSizeNumberOfCores\":1054083047,\"recommendedVmSizeMegabytesOfMemory\":21.55339,\"monthlyComputeCost\":51.470005,\"disks\":{\"raxq\":{\"suitability\":\"ReadinessUnknown\",\"suitabilityExplanation\":\"DiskSizeGreaterThanSupported\",\"suitabilityDetail\":\"DiskGigabytesProvisionedMissing\",\"recommendedDiskSize\":\"Ultra\",\"recommendedDiskType\":\"Ultra\",\"recommendedDiskSizeGigabytes\":425882032,\"recommendDiskThroughputInMbps\":39.469727,\"recommendedDiskIops\":74.69294,\"monthlyStorageCost\":63.4106,\"name\":\"cdiykkc\",\"displayName\":\"nujvqynvavi\",\"gigabytesProvisioned\":44.86011,\"megabytesPerSecondOfRead\":33.159374,\"megabytesPerSecondOfWrite\":66.49689,\"numberOfReadOperationsPerSecond\":82.77711,\"numberOfWriteOperationsPerSecond\":79.22218}},\"networkAdapters\":{\"stsinvag\":{\"suitability\":\"NotSuitable\",\"suitabilityDetail\":\"None\",\"suitabilityExplanation\":\"NotApplicable\",\"monthlyBandwidthCosts\":87.74508,\"netGigabytesTransmittedPerMonth\":22.928202,\"name\":\"pv\",\"displayName\":\"dbwen\",\"macAddress\":\"nafhxrzfr\",\"ipAddresses\":[\"tiucwv\",\"qllukhkrcqxg\",\"bvzarmq\"],\"megabytesPerSecondReceived\":11.978602,\"megabytesPerSecondTransmitted\":17.930443},\"kheubanlx\":{\"suitability\":\"ConditionallySuitable\",\"suitabilityDetail\":\"MegabytesOfDataRecievedOutOfRange\",\"suitabilityExplanation\":\"Unknown\",\"monthlyBandwidthCosts\":35.926144,\"netGigabytesTransmittedPerMonth\":37.834274,\"name\":\"cehqw\",\"displayName\":\"txnmxgnmguz\",\"macAddress\":\"wvor\",\"ipAddresses\":[\"kjnbkbdhlltqstq\",\"qsygxiynec\"],\"megabytesPerSecondReceived\":12.935913,\"megabytesPerSecondTransmitted\":99.16029},\"e\":{\"suitability\":\"ReadinessUnknown\",\"suitabilityDetail\":\"MegabytesOfDataTransmittedMissing\",\"suitabilityExplanation\":\"NotApplicable\",\"monthlyBandwidthCosts\":86.49183,\"netGigabytesTransmittedPerMonth\":50.56507,\"name\":\"lzklaslgacizux\",\"displayName\":\"arwp\",\"macAddress\":\"saudoejtighsx\",\"ipAddresses\":[\"tnkqbala\",\"ovu\"],\"megabytesPerSecondReceived\":85.89372,\"megabytesPerSecondTransmitted\":68.44179}},\"monthlyBandwidthCost\":58.254917,\"monthlyStorageCost\":35.27037,\"costComponents\":[{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":99.090454,\"description\":\"bcngkegxc\"}],\"securitySuitability\":\"NotSuitable\",\"migrationGuidelines\":[{\"guidelineId\":\"etwilyrzoxpd\",\"migrationGuidelineCategory\":\"Unknown\",\"migrationGuidelineContext\":[{}]},{\"guidelineId\":\"lqownkiua\",\"migrationGuidelineCategory\":\"Unknown\",\"migrationGuidelineContext\":[{},{}]}],\"bootType\":\"Unknown\",\"operatingSystemType\":\"xjjmztnlmsoodtm\",\"operatingSystemName\":\"cdhdyswcrpt\",\"operatingSystemVersion\":\"ajczxvl\",\"operatingSystemArchitecture\":\"Unknown\",\"createdTimestamp\":\"2021-02-10T22:21:42Z\",\"updatedTimestamp\":\"2021-05-07T20:09:53Z\",\"displayName\":\"zrpywlptyuqh\",\"type\":\"Unknown\",\"description\":\"skykpfuofix\",\"datacenterMachineArmId\":\"pcfykkpy\",\"datacenterManagementServerArmId\":\"pawmpjprdp\",\"datacenterManagementServerName\":\"pcfpcfj\",\"megabytesOfMemory\":75.83426,\"numberOfCores\":1335357423,\"confidenceRatingInPercentage\":28.798502,\"percentageCoresUtilization\":32.203842,\"percentageMemoryUtilization\":15.144819,\"suitability\":\"ReadinessUnknown\",\"sizingCriterion\":\"AsOnPremises\"},\"id\":\"mnnidmdia\",\"name\":\"pzxkzrntmkct\",\"type\":\"huosgwqpsqaz\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - AssessedSqlMachine response = manager.assessedSqlMachinesOperations() - .getWithResponse("njhx", "h", "hmgpczqulpt", "bvcpxtzhi", "q", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(99.090454F, response.properties().costComponents().get(0).value()); - Assertions.assertEquals("bcngkegxc", response.properties().costComponents().get(0).description()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesOperationsListBySqlAssessmentV2MockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesOperationsListBySqlAssessmentV2MockTests.java deleted file mode 100644 index 17f614552585..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlMachinesOperationsListBySqlAssessmentV2MockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlMachine; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessedSqlMachinesOperationsListBySqlAssessmentV2MockTests { - @Test - public void testListBySqlAssessmentV2() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"biosGuid\":\"yotnplfacqo\",\"fqdn\":\"qrqxwetjt\",\"sqlInstances\":[{\"instanceId\":\"tfdoadtx\",\"instanceName\":\"ge\",\"sqlInstanceSdsArmId\":\"adkm\",\"sqlInstanceEntityId\":\"gssz\",\"sqlEdition\":\"ctkbbxuha\",\"sqlVersion\":\"sirncclabvoy\",\"isClustered\":false,\"isHighAvailabilityEnabled\":false,\"sqlFciState\":\"Active\"},{\"instanceId\":\"bmyqjog\",\"instanceName\":\"saidjan\",\"sqlInstanceSdsArmId\":\"movdxxurn\",\"sqlInstanceEntityId\":\"jmoilunwe\",\"sqlEdition\":\"deel\",\"sqlVersion\":\"lkyozdsfzj\",\"isClustered\":false,\"isHighAvailabilityEnabled\":false,\"sqlFciState\":\"Passive\"},{\"instanceId\":\"slejtvxj\",\"instanceName\":\"vgjbfio\",\"sqlInstanceSdsArmId\":\"njodfcbjqqwmtq\",\"sqlInstanceEntityId\":\"oxsazuxejgwe\",\"sqlEdition\":\"wnf\",\"sqlVersion\":\"zzaczsinqbdn\",\"isClustered\":false,\"isHighAvailabilityEnabled\":false,\"sqlFciState\":\"Passive\"},{\"instanceId\":\"vrmkjmyitrchwu\",\"instanceName\":\"xeeihtpmno\",\"sqlInstanceSdsArmId\":\"hqlfmsib\",\"sqlInstanceEntityId\":\"yrfgxkyd\",\"sqlEdition\":\"yp\",\"sqlVersion\":\"qvmtywhlakx\",\"isClustered\":true,\"isHighAvailabilityEnabled\":false,\"sqlFciState\":\"Passive\"}],\"suitabilityDetail\":\"CannotReportBandwidthCosts\",\"suitabilityExplanation\":\"InternalErrorOccurredDuringNetworkEvaluation\",\"recommendedVmSize\":\"Standard_E20_v5\",\"recommendedVmFamily\":\"GS_series\",\"productSupportStatus\":{\"currentVersion\":\"rzgeuqxbpiatw\",\"servicePackStatus\":\"ujegqdtadra\",\"esuStatus\":\"ddhjkr\",\"supportStatus\":\"izyh\",\"eta\":562700229,\"currentEsuYear\":\"nqskt\",\"mainstreamEndDate\":\"2021-08-10T15:27:16Z\",\"extendedSupportEndDate\":\"2021-09-08T02:54:35Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-04-24T12:20:45Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-09-18T07:56:18Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-05-03T05:55:58Z\"},\"recommendedVmSizeNumberOfCores\":1205167221,\"recommendedVmSizeMegabytesOfMemory\":15.604812,\"monthlyComputeCost\":40.004826,\"disks\":{\"uvbdujgcwxvec\":{\"suitability\":\"NotSuitable\",\"suitabilityExplanation\":\"NoDiskSizeFoundInSelectedLocation\",\"suitabilityDetail\":\"DiskGigabytesProvisionedOutOfRange\",\"recommendedDiskSize\":\"StandardSSD_E3\",\"recommendedDiskType\":\"Unknown\",\"recommendedDiskSizeGigabytes\":2134981177,\"recommendDiskThroughputInMbps\":19.407808,\"recommendedDiskIops\":75.00775,\"monthlyStorageCost\":97.72125,\"name\":\"klciichgjsysm\",\"displayName\":\"o\",\"gigabytesProvisioned\":99.37963,\"megabytesPerSecondOfRead\":1.3408244,\"megabytesPerSecondOfWrite\":87.72186,\"numberOfReadOperationsPerSecond\":17.827404,\"numberOfWriteOperationsPerSecond\":83.63925}},\"networkAdapters\":{\"wuntobuiz\":{\"suitability\":\"Suitable\",\"suitabilityDetail\":\"MegabytesOfDataRecievedOutOfRange\",\"suitabilityExplanation\":\"Unknown\",\"monthlyBandwidthCosts\":85.95127,\"netGigabytesTransmittedPerMonth\":72.71101,\"name\":\"bgiark\",\"displayName\":\"kpgdqxwabzrwiq\",\"macAddress\":\"ha\",\"ipAddresses\":[\"dosqkptjqg\",\"ifmmainwh\",\"d\"],\"megabytesPerSecondReceived\":56.87188,\"megabytesPerSecondTransmitted\":41.46951},\"ikyypz\":{\"suitability\":\"ConditionallySuitable\",\"suitabilityDetail\":\"MegabytesOfDataRecievedOutOfRange\",\"suitabilityExplanation\":\"InternalErrorOccurred\",\"monthlyBandwidthCosts\":63.58878,\"netGigabytesTransmittedPerMonth\":38.958977,\"name\":\"f\",\"displayName\":\"klblaxp\",\"macAddress\":\"jwdabalfd\",\"ipAddresses\":[\"lz\",\"ytlbtlqhopxouvm\"],\"megabytesPerSecondReceived\":82.69837,\"megabytesPerSecondTransmitted\":98.499886},\"cq\":{\"suitability\":\"ConditionallySuitable\",\"suitabilityDetail\":\"MegabytesOfDataTransmittedOutOfRange\",\"suitabilityExplanation\":\"Unknown\",\"monthlyBandwidthCosts\":87.71719,\"netGigabytesTransmittedPerMonth\":74.619354,\"name\":\"bpoks\",\"displayName\":\"nm\",\"macAddress\":\"gpterdiu\",\"ipAddresses\":[\"rkskwztsdetjy\"],\"megabytesPerSecondReceived\":86.00711,\"megabytesPerSecondTransmitted\":35.51214}},\"monthlyBandwidthCost\":86.84527,\"monthlyStorageCost\":12.033564,\"costComponents\":[{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":37.48664,\"description\":\"ybz\"},{\"name\":\"Unknown\",\"value\":55.582367,\"description\":\"ptvdxxheigm\"}],\"securitySuitability\":\"Unknown\",\"migrationGuidelines\":[{\"guidelineId\":\"hjhjvm\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{}]}],\"bootType\":\"Unknown\",\"operatingSystemType\":\"b\",\"operatingSystemName\":\"d\",\"operatingSystemVersion\":\"bgymqt\",\"operatingSystemArchitecture\":\"X64\",\"createdTimestamp\":\"2021-11-09T12:10:09Z\",\"updatedTimestamp\":\"2021-08-04T15:49:36Z\",\"displayName\":\"rjnbsconxavipne\",\"type\":\"SqlAssessedMachine\",\"description\":\"jizqfsg\",\"datacenterMachineArmId\":\"dxze\",\"datacenterManagementServerArmId\":\"q\",\"datacenterManagementServerName\":\"fb\",\"megabytesOfMemory\":12.2989235,\"numberOfCores\":206526961,\"confidenceRatingInPercentage\":41.858093,\"percentageCoresUtilization\":84.57474,\"percentageMemoryUtilization\":48.314285,\"suitability\":\"Unknown\",\"sizingCriterion\":\"PerformanceBased\"},\"id\":\"ypi\",\"name\":\"dbkp\",\"type\":\"jtaqhsmqazpdg\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.assessedSqlMachinesOperations() - .listBySqlAssessmentV2("wxqouoxudnmc", "aprhknqiijgencdg", "oqueqihkkyowltj", "uwhldxwhieproqks", - "fxmcvprstvk", 1258845736, "b", 540536815, com.azure.core.util.Context.NONE); - - Assertions.assertEquals(37.48664F, response.iterator().next().properties().costComponents().get(0).value()); - Assertions.assertEquals("ybz", response.iterator().next().properties().costComponents().get(0).description()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityInnerTests.java deleted file mode 100644 index 1fafa7b1e58a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityInnerTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlRecommendedEntityInner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlRecommendedEntityProperties; -import org.junit.jupiter.api.Assertions; - -public final class AssessedSqlRecommendedEntityInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessedSqlRecommendedEntityInner model = BinaryData.fromString( - "{\"properties\":{\"machineName\":\"xv\",\"instanceName\":\"asbcrymodizrx\",\"productSupportStatus\":{\"currentVersion\":\"bdxnaz\",\"servicePackStatus\":\"kml\",\"esuStatus\":\"evfxzopjhbzxlioh\",\"supportStatus\":\"dd\",\"eta\":255752990,\"currentEsuYear\":\"qbawpcbbnzqcykn\",\"mainstreamEndDate\":\"2021-11-02T01:12:01Z\",\"extendedSupportEndDate\":\"2021-03-06T20:54:18Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-07-22T15:12:48Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-04-01T15:17:48Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-01-01T11:04:25Z\"},\"dbCount\":513283107,\"discoveredDBCount\":902972363,\"hasScanOccurred\":false,\"recommendedAzureSqlTargetType\":\"Unknown\",\"recommendedSuitability\":\"SuitableForVM\",\"azureSqlMISuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"GeneralPurpose\",\"azureSqlComputeTier\":\"Automatic\",\"azureSqlHardwareGeneration\":\"Automatic\",\"storageMaxSizeInMB\":84.29777,\"predictedDataSizeInMB\":99.771095,\"predictedLogSizeInMB\":68.32871,\"cores\":150860449,\"azureSqlTargetType\":\"Recommended\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Automatic\",\"azureSqlHardwareGeneration\":\"Fsv2_series\",\"storageMaxSizeInMB\":79.18247,\"predictedDataSizeInMB\":46.459866,\"predictedLogSizeInMB\":10.004192,\"cores\":1601507048,\"azureSqlTargetType\":\"AzureSqlDatabase\"}],\"sharedResources\":{\"sharedDataDisks\":[{\"diskType\":\"PremiumV2\",\"diskSize\":\"Premium_P4\",\"diskRedundancy\":\"ZRS\",\"storageCost\":48.45098,\"recommendedSizeInGib\":62.555546,\"recommendedThroughputInMbps\":60.62409,\"recommendedIops\":86.50556},{\"diskType\":\"StandardSSD\",\"diskSize\":\"StandardSSD_E70\",\"diskRedundancy\":\"ZRS\",\"storageCost\":45.55057,\"recommendedSizeInGib\":98.22722,\"recommendedThroughputInMbps\":21.468824,\"recommendedIops\":37.586384},{\"diskType\":\"Ultra\",\"diskSize\":\"StandardSSD_E15\",\"diskRedundancy\":\"ZRS\",\"storageCost\":29.759396,\"recommendedSizeInGib\":61.058266,\"recommendedThroughputInMbps\":50.74714,\"recommendedIops\":78.82254}],\"sharedLogDisks\":[{\"diskType\":\"Standard\",\"diskSize\":\"StandardSSD_E50\",\"diskRedundancy\":\"ZRS\",\"storageCost\":24.992699,\"recommendedSizeInGib\":72.44504,\"recommendedThroughputInMbps\":45.95412,\"recommendedIops\":33.126175},{\"diskType\":\"Standard\",\"diskSize\":\"Premium_P50\",\"diskRedundancy\":\"LRS\",\"storageCost\":92.74943,\"recommendedSizeInGib\":71.27231,\"recommendedThroughputInMbps\":78.67329,\"recommendedIops\":77.75007},{\"diskType\":\"StandardOrPremium\",\"diskSize\":\"Standard_S40\",\"diskRedundancy\":\"LRS\",\"storageCost\":31.623632,\"recommendedSizeInGib\":57.0972,\"recommendedThroughputInMbps\":85.50122,\"recommendedIops\":29.51042},{\"diskType\":\"Standard\",\"diskSize\":\"Premium_P6\",\"diskRedundancy\":\"Unknown\",\"storageCost\":70.73475,\"recommendedSizeInGib\":24.424625,\"recommendedThroughputInMbps\":32.324684,\"recommendedIops\":41.786087}],\"sharedTempDbDisks\":[{\"diskType\":\"Standard\",\"diskSize\":\"Unknown\",\"diskRedundancy\":\"Unknown\",\"storageCost\":98.77709,\"recommendedSizeInGib\":75.847404,\"recommendedThroughputInMbps\":1.5102804,\"recommendedIops\":60.186977}],\"numberOfMounts\":1831822639,\"quorumWitness\":{\"quorumWitnessType\":\"Unknown\"}},\"monthlyComputeCost\":93.88989,\"monthlyStorageCost\":19.872547,\"costComponents\":[{\"name\":\"MonthlySecurityCost\",\"value\":27.317005,\"description\":\"bh\"},{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":76.805244,\"description\":\"qi\"},{\"name\":\"MonthlySecurityCost\",\"value\":97.28748,\"description\":\"udfbsfarf\"}],\"securitySuitability\":\"Unknown\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"FailoverGroupInstance\",\"migrationGuidelines\":[{\"guidelineId\":\"pvwgfstmhqykizmd\",\"migrationGuidelineCategory\":\"Unknown\",\"migrationGuidelineContext\":[{},{}]},{\"guidelineId\":\"cluqvo\",\"migrationGuidelineCategory\":\"AvailabilityGroupGuideline\",\"migrationGuidelineContext\":[{},{},{},{}]},{\"guidelineId\":\"mr\",\"migrationGuidelineCategory\":\"AvailabilityGroupGuideline\",\"migrationGuidelineContext\":[{}]},{\"guidelineId\":\"wpbmzgwesydsxwef\",\"migrationGuidelineCategory\":\"Unknown\",\"migrationGuidelineContext\":[{},{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"wndyqleallk\",\"reasoningString\":\"tkhlowkxxpvbr\",\"reasoningCategory\":\"jmzsyzfh\",\"contextParameters\":[{},{},{},{}]},{\"reasoningId\":\"ikcyyc\",\"reasoningString\":\"nsjlpjrtws\",\"reasoningCategory\":\"vv\",\"contextParameters\":[{}]},{\"reasoningId\":\"hvtrrmhwrbfdpyf\",\"reasoningString\":\"bhvjglr\",\"reasoningCategory\":\"uyzlw\",\"contextParameters\":[{},{},{},{}]},{\"reasoningId\":\"mhoocl\",\"reasoningString\":\"n\",\"reasoningCategory\":\"memczjkmmyk\",\"contextParameters\":[{},{}]}],\"migrationTargetPlatform\":\"AzureSqlManagedInstance\",\"suitability\":\"ReadinessUnknown\",\"migrationIssues\":[{\"issueId\":\"rryejylmbkzudnig\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{},{},{}]},{\"issueId\":\"jewlpxuzzjg\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{}]},{\"issueId\":\"hqo\",\"issueCategory\":\"Warning\",\"impactedObjects\":[{},{},{}]},{\"issueId\":\"akydiwfbrkwpz\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{}]}]},\"azureSqlDBSuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"Automatic\",\"azureSqlComputeTier\":\"Unknown\",\"azureSqlHardwareGeneration\":\"Gen5\",\"storageMaxSizeInMB\":22.325277,\"predictedDataSizeInMB\":14.166528,\"predictedLogSizeInMB\":67.56118,\"cores\":1379010451,\"azureSqlTargetType\":\"AzureVirtualMachine\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"GeneralPurpose\",\"azureSqlComputeTier\":\"Automatic\",\"azureSqlHardwareGeneration\":\"Unknown\",\"storageMaxSizeInMB\":65.314285,\"predictedDataSizeInMB\":51.28268,\"predictedLogSizeInMB\":74.63233,\"cores\":540172830,\"azureSqlTargetType\":\"AzureVirtualMachine\"},{\"azureSqlServiceTier\":\"GeneralPurpose\",\"azureSqlComputeTier\":\"Automatic\",\"azureSqlHardwareGeneration\":\"Automatic\",\"storageMaxSizeInMB\":67.47476,\"predictedDataSizeInMB\":67.87149,\"predictedLogSizeInMB\":49.267586,\"cores\":1074910228,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"},{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Unknown\",\"azureSqlHardwareGeneration\":\"Gen5\",\"storageMaxSizeInMB\":59.47985,\"predictedDataSizeInMB\":84.183266,\"predictedLogSizeInMB\":83.88658,\"cores\":1967896838,\"azureSqlTargetType\":\"AzureSqlManagedInstance\"}],\"sharedResources\":{\"sharedDataDisks\":[{\"diskType\":\"StandardSSD\",\"diskSize\":\"Premium_P6\",\"diskRedundancy\":\"Unknown\",\"storageCost\":29.923105,\"recommendedSizeInGib\":68.79162,\"recommendedThroughputInMbps\":42.975296,\"recommendedIops\":5.588526},{\"diskType\":\"Standard\",\"diskSize\":\"Standard_S80\",\"diskRedundancy\":\"ZRS\",\"storageCost\":34.000515,\"recommendedSizeInGib\":73.243675,\"recommendedThroughputInMbps\":62.01772,\"recommendedIops\":50.97294}],\"sharedLogDisks\":[{\"diskType\":\"PremiumV2\",\"diskSize\":\"Premium_P30\",\"diskRedundancy\":\"Unknown\",\"storageCost\":34.706463,\"recommendedSizeInGib\":37.694584,\"recommendedThroughputInMbps\":22.453255,\"recommendedIops\":18.89614}],\"sharedTempDbDisks\":[{\"diskType\":\"Standard\",\"diskSize\":\"Premium_P15\",\"diskRedundancy\":\"ZRS\",\"storageCost\":99.97765,\"recommendedSizeInGib\":21.16068,\"recommendedThroughputInMbps\":0.6466925,\"recommendedIops\":15.830064},{\"diskType\":\"StandardSSD\",\"diskSize\":\"Premium_P1\",\"diskRedundancy\":\"LRS\",\"storageCost\":64.1839,\"recommendedSizeInGib\":94.96739,\"recommendedThroughputInMbps\":68.434845,\"recommendedIops\":28.949053}],\"numberOfMounts\":491651275,\"quorumWitness\":{\"quorumWitnessType\":\"Cloud\"}},\"monthlyComputeCost\":80.78199,\"monthlyStorageCost\":63.010185,\"costComponents\":[{\"name\":\"MonthlySecurityCost\",\"value\":88.73604,\"description\":\"c\"},{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":72.14276,\"description\":\"eovvtzej\"},{\"name\":\"MonthlySecurityCost\",\"value\":7.799661,\"description\":\"tikyj\"}],\"securitySuitability\":\"Suitable\",\"shouldProvisionReplicas\":false,\"skuReplicationMode\":\"ActiveGeoReplication\",\"migrationGuidelines\":[{\"guidelineId\":\"rzvh\",\"migrationGuidelineCategory\":\"General\",\"migrationGuidelineContext\":[{},{},{},{}]},{\"guidelineId\":\"tgvgzp\",\"migrationGuidelineCategory\":\"General\",\"migrationGuidelineContext\":[{},{},{},{}]},{\"guidelineId\":\"awjmjsmw\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"zz\",\"reasoningString\":\"jafi\",\"reasoningCategory\":\"hguynuchlgmltxdw\",\"contextParameters\":[{},{}]},{\"reasoningId\":\"us\",\"reasoningString\":\"vlnsnnjz\",\"reasoningCategory\":\"afolpymwamxqzrag\",\"contextParameters\":[{},{}]},{\"reasoningId\":\"htvdula\",\"reasoningString\":\"lejchcsr\",\"reasoningCategory\":\"knmzlanrupdwvnp\",\"contextParameters\":[{},{},{},{}]},{\"reasoningId\":\"q\",\"reasoningString\":\"jhmqrhvthla\",\"reasoningCategory\":\"dcxsmlz\",\"contextParameters\":[{},{},{}]}],\"migrationTargetPlatform\":\"Recommended\",\"suitability\":\"ReadinessUnknown\",\"migrationIssues\":[{\"issueId\":\"ydlhqvln\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{}]}]},\"azureSqlVMSuitabilityDetails\":{\"azureSqlSku\":{\"virtualMachineSize\":{\"azureVmFamily\":\"Dv3_series\",\"cores\":224237712,\"azureSkuName\":\"Standard_A2\",\"availableCores\":339285731,\"maxNetworkInterfaces\":1799844298},\"dataDiskSizes\":[{\"diskType\":\"StandardSSD\",\"diskSize\":\"Premium_P30\",\"diskRedundancy\":\"LRS\",\"storageCost\":76.17075,\"recommendedSizeInGib\":49.107258,\"recommendedThroughputInMbps\":84.63951,\"recommendedIops\":39.722282},{\"diskType\":\"PremiumV2\",\"diskSize\":\"Premium_P40\",\"diskRedundancy\":\"Unknown\",\"storageCost\":9.709257,\"recommendedSizeInGib\":62.74608,\"recommendedThroughputInMbps\":44.4742,\"recommendedIops\":88.8744}],\"logDiskSizes\":[{\"diskType\":\"Ultra\",\"diskSize\":\"Premium_P1\",\"diskRedundancy\":\"Unknown\",\"storageCost\":60.33164,\"recommendedSizeInGib\":44.452847,\"recommendedThroughputInMbps\":8.862007,\"recommendedIops\":68.489395},{\"diskType\":\"Ultra\",\"diskSize\":\"Premium_P2\",\"diskRedundancy\":\"ZRS\",\"storageCost\":92.985374,\"recommendedSizeInGib\":74.32026,\"recommendedThroughputInMbps\":98.59011,\"recommendedIops\":31.529743}],\"azureSqlTargetType\":\"AzureSqlManagedInstance\"},\"replicaAzureSqlSku\":[{\"virtualMachineSize\":{\"azureVmFamily\":\"Unknown\",\"cores\":1312612071,\"azureSkuName\":\"Standard_E8ads_v5\",\"availableCores\":1256156886,\"maxNetworkInterfaces\":1553395151},\"dataDiskSizes\":[{},{}],\"logDiskSizes\":[{},{},{},{}],\"azureSqlTargetType\":\"AzureSqlManagedInstance\"},{\"virtualMachineSize\":{\"azureVmFamily\":\"Ddv4_series\",\"cores\":1822893044,\"azureSkuName\":\"Standard_DS1\",\"availableCores\":581418473,\"maxNetworkInterfaces\":2063610896},\"dataDiskSizes\":[{},{},{}],\"logDiskSizes\":[{},{}],\"azureSqlTargetType\":\"Unknown\"},{\"virtualMachineSize\":{\"azureVmFamily\":\"M_series\",\"cores\":1686230726,\"azureSkuName\":\"Standard_M64ls\",\"availableCores\":667658590,\"maxNetworkInterfaces\":1657438735},\"dataDiskSizes\":[{},{},{},{}],\"logDiskSizes\":[{}],\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"}],\"sharedResources\":{\"sharedDataDisks\":[{\"diskType\":\"Standard\",\"diskSize\":\"Standard_S50\",\"diskRedundancy\":\"Unknown\",\"storageCost\":37.06757,\"recommendedSizeInGib\":37.920105,\"recommendedThroughputInMbps\":30.722845,\"recommendedIops\":12.901717},{\"diskType\":\"Unknown\",\"diskSize\":\"StandardSSD_E1\",\"diskRedundancy\":\"ZRS\",\"storageCost\":54.761898,\"recommendedSizeInGib\":9.566725,\"recommendedThroughputInMbps\":80.95274,\"recommendedIops\":73.064575}],\"sharedLogDisks\":[{\"diskType\":\"PremiumV2\",\"diskSize\":\"Premium_P40\",\"diskRedundancy\":\"LRS\",\"storageCost\":83.58084,\"recommendedSizeInGib\":98.88538,\"recommendedThroughputInMbps\":71.063446,\"recommendedIops\":67.13245},{\"diskType\":\"Premium\",\"diskSize\":\"Premium_P4\",\"diskRedundancy\":\"ZRS\",\"storageCost\":59.358376,\"recommendedSizeInGib\":72.6253,\"recommendedThroughputInMbps\":81.42051,\"recommendedIops\":17.64272}],\"sharedTempDbDisks\":[{\"diskType\":\"PremiumV2\",\"diskSize\":\"Premium_P30\",\"diskRedundancy\":\"ZRS\",\"storageCost\":46.628986,\"recommendedSizeInGib\":9.73481,\"recommendedThroughputInMbps\":61.396862,\"recommendedIops\":0.5134404}],\"numberOfMounts\":824374091,\"quorumWitness\":{\"quorumWitnessType\":\"Unknown\"}},\"monthlyComputeCost\":79.17579,\"monthlyStorageCost\":87.84745,\"costComponents\":[{\"name\":\"MonthlySecurityCost\",\"value\":35.51975,\"description\":\"hxogjggsvoujkxi\"},{\"name\":\"MonthlySecurityCost\",\"value\":94.60625,\"description\":\"kmdyomkxfbvfbh\"}],\"securitySuitability\":\"ConditionallySuitable\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"NotApplicable\",\"migrationGuidelines\":[{\"guidelineId\":\"deimawzov\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{},{},{}]},{\"guidelineId\":\"ikjcjcazt\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"xwc\",\"reasoningString\":\"likytwvczcswka\",\"reasoningCategory\":\"ejyfdvlvhbwrnfx\",\"contextParameters\":[{},{}]},{\"reasoningId\":\"pqthehnmnaoya\",\"reasoningString\":\"coeqswankltytm\",\"reasoningCategory\":\"roznnhdrlktgj\",\"contextParameters\":[{},{},{}]},{\"reasoningId\":\"uxhemlwywaeeczg\",\"reasoningString\":\"ukklelss\",\"reasoningCategory\":\"lycsxz\",\"contextParameters\":[{}]}],\"migrationTargetPlatform\":\"AzureSqlDatabase\",\"suitability\":\"ConditionallySuitable\",\"migrationIssues\":[{\"issueId\":\"sqplpvmjcd\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{}]},{\"issueId\":\"yvteowxvgpiudeu\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{}]},{\"issueId\":\"c\",\"issueCategory\":\"Warning\",\"impactedObjects\":[{},{}]},{\"issueId\":\"fykhvuhxepmru\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{}]}]},\"assessedSqlEntityArmId\":\"obns\",\"isClustered\":true,\"isHighAvailabilityEnabled\":true,\"sqlEdition\":\"tymkmvguihywart\",\"sqlVersion\":\"phkixkykxdssjpe\",\"sizingCriterion\":\"PerformanceBased\"},\"id\":\"fxhikkflrmymyi\",\"name\":\"cqlh\",\"type\":\"isws\"}") - .toObject(AssessedSqlRecommendedEntityInner.class); - Assertions.assertEquals("obns", model.properties().assessedSqlEntityArmId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessedSqlRecommendedEntityInner model = new AssessedSqlRecommendedEntityInner() - .withProperties(new AssessedSqlRecommendedEntityProperties().withAssessedSqlEntityArmId("obns")); - model = BinaryData.fromObject(model).toObject(AssessedSqlRecommendedEntityInner.class); - Assertions.assertEquals("obns", model.properties().assessedSqlEntityArmId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityListResultTests.java deleted file mode 100644 index df2c1ee77f1b..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityListResultTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessedSqlRecommendedEntityInner; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlRecommendedEntityListResult; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlRecommendedEntityProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AssessedSqlRecommendedEntityListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessedSqlRecommendedEntityListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"machineName\":\"gm\",\"instanceName\":\"wahzjmucftbyr\",\"productSupportStatus\":{\"currentVersion\":\"ohkpigqfu\",\"servicePackStatus\":\"ckzmkwklsnox\",\"esuStatus\":\"mqeq\",\"supportStatus\":\"h\",\"eta\":652323587,\"currentEsuYear\":\"gwydyy\",\"mainstreamEndDate\":\"2021-07-30T21:21:05Z\",\"extendedSupportEndDate\":\"2021-07-27T13:55:01Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-06-04T03:09:29Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-03-04T03:34:09Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-02-24T07:07:12Z\"},\"dbCount\":1465661889,\"discoveredDBCount\":935843013,\"hasScanOccurred\":true,\"recommendedAzureSqlTargetType\":\"AzureVirtualMachine\",\"recommendedSuitability\":\"PotentiallySuitableForVM\",\"azureSqlMISuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"M_series\",\"storageMaxSizeInMB\":85.834076,\"predictedDataSizeInMB\":65.096924,\"predictedLogSizeInMB\":89.39814,\"cores\":45100221,\"azureSqlTargetType\":\"AzureVirtualMachine\"},\"replicaAzureSqlSku\":[{},{}],\"sharedResources\":{\"sharedDataDisks\":[{},{}],\"sharedLogDisks\":[{},{}],\"sharedTempDbDisks\":[{},{},{},{}],\"numberOfMounts\":783631695,\"quorumWitness\":{}},\"monthlyComputeCost\":81.85477,\"monthlyStorageCost\":29.225004,\"costComponents\":[{},{},{}],\"securitySuitability\":\"NotSuitable\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"NotApplicable\",\"migrationGuidelines\":[{},{}],\"recommendationReasonings\":[{},{},{},{}],\"migrationTargetPlatform\":\"Recommended\",\"suitability\":\"ReadinessUnknown\",\"migrationIssues\":[{},{},{}]},\"azureSqlDBSuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"BusinessCritical\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Fsv2_series\",\"storageMaxSizeInMB\":20.945662,\"predictedDataSizeInMB\":75.05848,\"predictedLogSizeInMB\":85.42869,\"cores\":2123752302,\"azureSqlTargetType\":\"Unknown\"},\"replicaAzureSqlSku\":[{},{},{},{}],\"sharedResources\":{\"sharedDataDisks\":[{},{},{},{}],\"sharedLogDisks\":[{}],\"sharedTempDbDisks\":[{}],\"numberOfMounts\":188519413,\"quorumWitness\":{}},\"monthlyComputeCost\":77.997154,\"monthlyStorageCost\":3.6737323,\"costComponents\":[{},{}],\"securitySuitability\":\"ReadinessUnknown\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"FailoverGroupInstance\",\"migrationGuidelines\":[{}],\"recommendationReasonings\":[{},{},{}],\"migrationTargetPlatform\":\"Recommended\",\"suitability\":\"Suitable\",\"migrationIssues\":[{},{},{},{}]},\"azureSqlVMSuitabilityDetails\":{\"azureSqlSku\":{\"virtualMachineSize\":{},\"dataDiskSizes\":[{}],\"logDiskSizes\":[{},{},{},{}],\"azureSqlTargetType\":\"Unknown\"},\"replicaAzureSqlSku\":[{}],\"sharedResources\":{\"sharedDataDisks\":[{}],\"sharedLogDisks\":[{}],\"sharedTempDbDisks\":[{},{},{}],\"numberOfMounts\":1265182150,\"quorumWitness\":{}},\"monthlyComputeCost\":5.7943583,\"monthlyStorageCost\":45.729744,\"costComponents\":[{},{},{}],\"securitySuitability\":\"ConditionallySuitable\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"ActiveGeoReplication\",\"migrationGuidelines\":[{},{}],\"recommendationReasonings\":[{}],\"migrationTargetPlatform\":\"AzureVirtualMachine\",\"suitability\":\"NotSuitable\",\"migrationIssues\":[{},{}]},\"assessedSqlEntityArmId\":\"ewuninvud\",\"isClustered\":false,\"isHighAvailabilityEnabled\":true,\"sqlEdition\":\"tvq\",\"sqlVersion\":\"rqctmxxdtdd\",\"sizingCriterion\":\"AsOnPremises\"},\"id\":\"uytxzvtznapxban\",\"name\":\"o\",\"type\":\"voxczytpr\"}],\"nextLink\":\"wvroevytlyokrrr\"}") - .toObject(AssessedSqlRecommendedEntityListResult.class); - Assertions.assertEquals("ewuninvud", model.value().get(0).properties().assessedSqlEntityArmId()); - Assertions.assertEquals("wvroevytlyokrrr", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessedSqlRecommendedEntityListResult model = new AssessedSqlRecommendedEntityListResult() - .withValue(Arrays.asList(new AssessedSqlRecommendedEntityInner() - .withProperties(new AssessedSqlRecommendedEntityProperties().withAssessedSqlEntityArmId("ewuninvud")))) - .withNextLink("wvroevytlyokrrr"); - model = BinaryData.fromObject(model).toObject(AssessedSqlRecommendedEntityListResult.class); - Assertions.assertEquals("ewuninvud", model.value().get(0).properties().assessedSqlEntityArmId()); - Assertions.assertEquals("wvroevytlyokrrr", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityOperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityOperationsGetWithResponseMockTests.java deleted file mode 100644 index 7d4194913062..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlRecommendedEntity; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessedSqlRecommendedEntityOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"machineName\":\"d\",\"instanceName\":\"fhtwmmkfqb\",\"productSupportStatus\":{\"currentVersion\":\"ulwwtrjmeqkvyhz\",\"servicePackStatus\":\"poyu\",\"esuStatus\":\"uensn\",\"supportStatus\":\"jphmpoejnglpws\",\"eta\":709381303,\"currentEsuYear\":\"jsumxpezcoio\",\"mainstreamEndDate\":\"2021-02-11T21:12:39Z\",\"extendedSupportEndDate\":\"2021-04-29T14:56:08Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-09-14T09:51:16Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-09-05T21:06:38Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-11-22T22:48:31Z\"},\"dbCount\":1676856163,\"discoveredDBCount\":222653921,\"hasScanOccurred\":false,\"recommendedAzureSqlTargetType\":\"AzureSqlManagedInstance\",\"recommendedSuitability\":\"Unknown\",\"azureSqlMISuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"BusinessCritical\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"Fsv2_series\",\"storageMaxSizeInMB\":9.771246,\"predictedDataSizeInMB\":62.806965,\"predictedLogSizeInMB\":76.82925,\"cores\":266458582,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Unknown\",\"azureSqlHardwareGeneration\":\"DC_series\",\"storageMaxSizeInMB\":50.425297,\"predictedDataSizeInMB\":56.37652,\"predictedLogSizeInMB\":48.299534,\"cores\":1638013744,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"},{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Unknown\",\"azureSqlHardwareGeneration\":\"Automatic\",\"storageMaxSizeInMB\":82.06618,\"predictedDataSizeInMB\":0.20298958,\"predictedLogSizeInMB\":99.19687,\"cores\":1518729432,\"azureSqlTargetType\":\"AzureVirtualMachine\"},{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"DC_series\",\"storageMaxSizeInMB\":89.95035,\"predictedDataSizeInMB\":27.503252,\"predictedLogSizeInMB\":84.888824,\"cores\":1476415299,\"azureSqlTargetType\":\"AzureVirtualMachine\"}],\"sharedResources\":{\"sharedDataDisks\":[{},{},{},{}],\"sharedLogDisks\":[{},{},{}],\"sharedTempDbDisks\":[{},{},{}],\"numberOfMounts\":1276332701,\"quorumWitness\":{\"quorumWitnessType\":\"Cloud\"}},\"monthlyComputeCost\":67.98498,\"monthlyStorageCost\":89.08338,\"costComponents\":[{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":43.12796,\"description\":\"tikesl\"},{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":71.988,\"description\":\"ixyqhfnkvy\"}],\"securitySuitability\":\"Suitable\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"FailoverGroupInstance\",\"migrationGuidelines\":[{\"guidelineId\":\"quwzxhrptyodl\",\"migrationGuidelineCategory\":\"General\",\"migrationGuidelineContext\":[{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"dsobjopnouhbq\",\"reasoningString\":\"kqxs\",\"reasoningCategory\":\"uzyigfcvcewbwqhd\",\"contextParameters\":[{},{}]}],\"migrationTargetPlatform\":\"Unknown\",\"suitability\":\"Unknown\",\"migrationIssues\":[{\"issueId\":\"mazdfsqxh\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{},{}]},{\"issueId\":\"parn\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{},{}]}]},\"azureSqlDBSuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"Automatic\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Automatic\",\"storageMaxSizeInMB\":7.691741,\"predictedDataSizeInMB\":3.1134665,\"predictedLogSizeInMB\":0.019079447,\"cores\":1650141631,\"azureSqlTargetType\":\"AzureSqlManagedInstance\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"HyperScale\",\"azureSqlComputeTier\":\"Automatic\",\"azureSqlHardwareGeneration\":\"DC_series\",\"storageMaxSizeInMB\":52.820633,\"predictedDataSizeInMB\":95.00618,\"predictedLogSizeInMB\":49.1711,\"cores\":1244357050,\"azureSqlTargetType\":\"Recommended\"}],\"sharedResources\":{\"sharedDataDisks\":[{},{},{}],\"sharedLogDisks\":[{}],\"sharedTempDbDisks\":[{},{},{},{}],\"numberOfMounts\":1707361059,\"quorumWitness\":{\"quorumWitnessType\":\"Disk\"}},\"monthlyComputeCost\":8.474427,\"monthlyStorageCost\":51.78052,\"costComponents\":[{\"name\":\"MonthlySecurityCost\",\"value\":2.1707296,\"description\":\"rocqsxy\"}],\"securitySuitability\":\"NotSuitable\",\"shouldProvisionReplicas\":false,\"skuReplicationMode\":\"NotApplicable\",\"migrationGuidelines\":[{\"guidelineId\":\"is\",\"migrationGuidelineCategory\":\"Unknown\",\"migrationGuidelineContext\":[{},{}]},{\"guidelineId\":\"ajamc\",\"migrationGuidelineCategory\":\"Unknown\",\"migrationGuidelineContext\":[{},{},{},{}]},{\"guidelineId\":\"p\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{},{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"eynq\",\"reasoningString\":\"hkigglclwalhvub\",\"reasoningCategory\":\"zphetxdqcm\",\"contextParameters\":[{},{}]},{\"reasoningId\":\"jq\",\"reasoningString\":\"vale\",\"reasoningCategory\":\"bibiwks\",\"contextParameters\":[{}]},{\"reasoningId\":\"x\",\"reasoningString\":\"fpzvoikvntwczf\",\"reasoningCategory\":\"ushlcxpblalh\",\"contextParameters\":[{},{}]}],\"migrationTargetPlatform\":\"Recommended\",\"suitability\":\"ConditionallySuitable\",\"migrationIssues\":[{\"issueId\":\"idqzsaaoqdsgpto\",\"issueCategory\":\"Warning\",\"impactedObjects\":[{},{}]}]},\"azureSqlVMSuitabilityDetails\":{\"azureSqlSku\":{\"virtualMachineSize\":{\"azureVmFamily\":\"Standard_A0_A7\",\"cores\":43506706,\"azureSkuName\":\"Basic_A2\",\"availableCores\":2052552411,\"maxNetworkInterfaces\":1525228635},\"dataDiskSizes\":[{}],\"logDiskSizes\":[{}],\"azureSqlTargetType\":\"Unknown\"},\"replicaAzureSqlSku\":[{\"virtualMachineSize\":{},\"dataDiskSizes\":[{}],\"logDiskSizes\":[{},{}],\"azureSqlTargetType\":\"AzureSqlManagedInstance\"},{\"virtualMachineSize\":{},\"dataDiskSizes\":[{},{},{}],\"logDiskSizes\":[{},{},{}],\"azureSqlTargetType\":\"Recommended\"}],\"sharedResources\":{\"sharedDataDisks\":[{}],\"sharedLogDisks\":[{},{},{}],\"sharedTempDbDisks\":[{},{},{},{}],\"numberOfMounts\":707800072,\"quorumWitness\":{\"quorumWitnessType\":\"Disk\"}},\"monthlyComputeCost\":59.643085,\"monthlyStorageCost\":67.26635,\"costComponents\":[{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":69.455376,\"description\":\"xre\"},{\"name\":\"Unknown\",\"value\":99.84853,\"description\":\"n\"}],\"securitySuitability\":\"ConditionallySuitable\",\"shouldProvisionReplicas\":false,\"skuReplicationMode\":\"ActiveGeoReplication\",\"migrationGuidelines\":[{\"guidelineId\":\"qycmmoxf\",\"migrationGuidelineCategory\":\"AvailabilityGroupGuideline\",\"migrationGuidelineContext\":[{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"mwh\",\"reasoningString\":\"ali\",\"reasoningCategory\":\"ycgnwplrrbphc\",\"contextParameters\":[{}]},{\"reasoningId\":\"ibticuhqv\",\"reasoningString\":\"spbfsfeqbbewfc\",\"reasoningCategory\":\"fpyyxmzrmtm\",\"contextParameters\":[{},{}]},{\"reasoningId\":\"uweyyjshcyb\",\"reasoningString\":\"upp\",\"reasoningCategory\":\"prcmvouujxdiik\",\"contextParameters\":[{},{},{}]}],\"migrationTargetPlatform\":\"Recommended\",\"suitability\":\"ReadinessUnknown\",\"migrationIssues\":[{\"issueId\":\"lrxikj\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{}]}]},\"assessedSqlEntityArmId\":\"npipcwybszfncn\",\"isClustered\":false,\"isHighAvailabilityEnabled\":true,\"sqlEdition\":\"saebwfwhxorpwal\",\"sqlVersion\":\"wugexojfccyl\",\"sizingCriterion\":\"PerformanceBased\"},\"id\":\"thvazjpw\",\"name\":\"xcdrzprobzzxezm\",\"type\":\"rkjg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - AssessedSqlRecommendedEntity response = manager.assessedSqlRecommendedEntityOperations() - .getWithResponse("wz", "drpizfulgyctsdb", "qgkujds", "oxrqw", "eurbtigapdyarik", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("npipcwybszfncn", response.properties().assessedSqlEntityArmId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityOperationsListBySqlAssessmentV2MockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityOperationsListBySqlAssessmentV2MockTests.java deleted file mode 100644 index 40979d495ea4..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessedSqlRecommendedEntityOperationsListBySqlAssessmentV2MockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessedSqlRecommendedEntity; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessedSqlRecommendedEntityOperationsListBySqlAssessmentV2MockTests { - @Test - public void testListBySqlAssessmentV2() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"machineName\":\"skbwgm\",\"instanceName\":\"rulcfogx\",\"productSupportStatus\":{\"currentVersion\":\"nwjtpf\",\"servicePackStatus\":\"xcouzfwofwak\",\"esuStatus\":\"zkdtzxsoed\",\"supportStatus\":\"wglihezomu\",\"eta\":1614778568,\"currentEsuYear\":\"isnionetbzdrdpue\",\"mainstreamEndDate\":\"2021-07-27T09:18:03Z\",\"extendedSupportEndDate\":\"2021-05-10T00:45:18Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-02-16T02:41:21Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-10-08T03:35:33Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-05-02T19:22:45Z\"},\"dbCount\":212272318,\"discoveredDBCount\":118271276,\"hasScanOccurred\":false,\"recommendedAzureSqlTargetType\":\"AzureVirtualMachine\",\"recommendedSuitability\":\"PotentiallySuitableForVM\",\"azureSqlMISuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"BusinessCritical\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Unknown\",\"storageMaxSizeInMB\":56.445385,\"predictedDataSizeInMB\":82.74375,\"predictedLogSizeInMB\":68.94291,\"cores\":926783353,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"GeneralPurpose\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"Gen5\",\"storageMaxSizeInMB\":96.515785,\"predictedDataSizeInMB\":95.57669,\"predictedLogSizeInMB\":2.9654562,\"cores\":1015199416,\"azureSqlTargetType\":\"Recommended\"},{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"DC_series\",\"storageMaxSizeInMB\":28.742128,\"predictedDataSizeInMB\":89.02015,\"predictedLogSizeInMB\":35.792778,\"cores\":1889348759,\"azureSqlTargetType\":\"AzureSqlManagedInstance\"},{\"azureSqlServiceTier\":\"Automatic\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Unknown\",\"storageMaxSizeInMB\":36.13075,\"predictedDataSizeInMB\":58.18631,\"predictedLogSizeInMB\":76.93034,\"cores\":161019045,\"azureSqlTargetType\":\"Unknown\"},{\"azureSqlServiceTier\":\"GeneralPurpose\",\"azureSqlComputeTier\":\"Automatic\",\"azureSqlHardwareGeneration\":\"Fsv2_series\",\"storageMaxSizeInMB\":31.641466,\"predictedDataSizeInMB\":57.541405,\"predictedLogSizeInMB\":91.92485,\"cores\":1236323053,\"azureSqlTargetType\":\"AzureVirtualMachine\"}],\"sharedResources\":{\"sharedDataDisks\":[{}],\"sharedLogDisks\":[{},{}],\"sharedTempDbDisks\":[{},{}],\"numberOfMounts\":873252711,\"quorumWitness\":{\"quorumWitnessType\":\"Disk\"}},\"monthlyComputeCost\":54.43496,\"monthlyStorageCost\":95.73449,\"costComponents\":[{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":97.70187,\"description\":\"paydhfn\"}],\"securitySuitability\":\"ReadinessUnknown\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"NotApplicable\",\"migrationGuidelines\":[{\"guidelineId\":\"snyzmspam\",\"migrationGuidelineCategory\":\"General\",\"migrationGuidelineContext\":[{}]},{\"guidelineId\":\"lslcefiqdktwtkvi\",\"migrationGuidelineCategory\":\"General\",\"migrationGuidelineContext\":[{},{}]},{\"guidelineId\":\"woynguu\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{},{}]},{\"guidelineId\":\"dpcmhjh\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"ym\",\"reasoningString\":\"ztsilscvq\",\"reasoningCategory\":\"eiihfymko\",\"contextParameters\":[{}]},{\"reasoningId\":\"eseuugci\",\"reasoningString\":\"hogsmgbvmtd\",\"reasoningCategory\":\"qbe\",\"contextParameters\":[{},{}]},{\"reasoningId\":\"veglabtvkbiwzn\",\"reasoningString\":\"fg\",\"reasoningCategory\":\"cud\",\"contextParameters\":[{},{}]},{\"reasoningId\":\"paczmuh\",\"reasoningString\":\"akznhokhoitwhr\",\"reasoningCategory\":\"dmmazdnc\",\"contextParameters\":[{}]}],\"migrationTargetPlatform\":\"AzureSqlManagedInstance\",\"suitability\":\"Unknown\",\"migrationIssues\":[{\"issueId\":\"qpx\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{}]},{\"issueId\":\"kcdgfhbssd\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{}]},{\"issueId\":\"xdede\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{}]},{\"issueId\":\"gxsur\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{}]}]},\"azureSqlDBSuitabilityDetails\":{\"azureSqlSku\":{\"azureSqlServiceTier\":\"HyperScale\",\"azureSqlComputeTier\":\"Unknown\",\"azureSqlHardwareGeneration\":\"Automatic\",\"storageMaxSizeInMB\":82.34454,\"predictedDataSizeInMB\":54.51052,\"predictedLogSizeInMB\":18.703657,\"cores\":753616806,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"},\"replicaAzureSqlSku\":[{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Unknown\",\"storageMaxSizeInMB\":77.19659,\"predictedDataSizeInMB\":0.005275011,\"predictedLogSizeInMB\":1.6721785,\"cores\":1844678161,\"azureSqlTargetType\":\"AzureSqlVirtualMachine\"},{\"azureSqlServiceTier\":\"Automatic\",\"azureSqlComputeTier\":\"Automatic\",\"azureSqlHardwareGeneration\":\"Fsv2_series\",\"storageMaxSizeInMB\":80.447624,\"predictedDataSizeInMB\":10.910189,\"predictedLogSizeInMB\":37.55529,\"cores\":1473902358,\"azureSqlTargetType\":\"Unknown\"},{\"azureSqlServiceTier\":\"HyperScale\",\"azureSqlComputeTier\":\"Serverless\",\"azureSqlHardwareGeneration\":\"M_series\",\"storageMaxSizeInMB\":57.48646,\"predictedDataSizeInMB\":81.59941,\"predictedLogSizeInMB\":75.11977,\"cores\":1325876132,\"azureSqlTargetType\":\"AzureVirtualMachine\"}],\"sharedResources\":{\"sharedDataDisks\":[{},{},{}],\"sharedLogDisks\":[{}],\"sharedTempDbDisks\":[{},{},{}],\"numberOfMounts\":421840772,\"quorumWitness\":{\"quorumWitnessType\":\"Unknown\"}},\"monthlyComputeCost\":20.23537,\"monthlyStorageCost\":62.92355,\"costComponents\":[{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":96.248505,\"description\":\"kqlujqgira\"},{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":51.221985,\"description\":\"chpqvctsfaeuhww\"}],\"securitySuitability\":\"ConditionallySuitable\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"ActiveGeoReplication\",\"migrationGuidelines\":[{\"guidelineId\":\"asupmlppdpg\",\"migrationGuidelineCategory\":\"General\",\"migrationGuidelineContext\":[{},{}]},{\"guidelineId\":\"vbkarkptgon\",\"migrationGuidelineCategory\":\"AvailabilityGroupGuideline\",\"migrationGuidelineContext\":[{},{}]},{\"guidelineId\":\"yiysjqheni\",\"migrationGuidelineCategory\":\"Unknown\",\"migrationGuidelineContext\":[{}]},{\"guidelineId\":\"uba\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{},{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"cseydz\",\"reasoningString\":\"mexmnvk\",\"reasoningCategory\":\"uwrxl\",\"contextParameters\":[{},{},{},{}]}],\"migrationTargetPlatform\":\"AzureSqlVirtualMachine\",\"suitability\":\"ReadinessUnknown\",\"migrationIssues\":[{\"issueId\":\"lhvdvmiphbeaeqj\",\"issueCategory\":\"Warning\",\"impactedObjects\":[{},{},{},{}]},{\"issueId\":\"lacro\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{}]},{\"issueId\":\"erkeluxzsh\",\"issueCategory\":\"Warning\",\"impactedObjects\":[{},{}]},{\"issueId\":\"uzudlevzskejcg\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{},{}]}]},\"azureSqlVMSuitabilityDetails\":{\"azureSqlSku\":{\"virtualMachineSize\":{\"azureVmFamily\":\"Ebsv5_series\",\"cores\":1663628881,\"azureSkuName\":\"Standard_M64ms_v2\",\"availableCores\":977354992,\"maxNetworkInterfaces\":30369579},\"dataDiskSizes\":[{},{},{},{}],\"logDiskSizes\":[{},{},{},{}],\"azureSqlTargetType\":\"Recommended\"},\"replicaAzureSqlSku\":[{\"virtualMachineSize\":{},\"dataDiskSizes\":[{},{},{}],\"logDiskSizes\":[{},{}],\"azureSqlTargetType\":\"AzureVirtualMachine\"}],\"sharedResources\":{\"sharedDataDisks\":[{},{}],\"sharedLogDisks\":[{}],\"sharedTempDbDisks\":[{},{},{}],\"numberOfMounts\":1723389232,\"quorumWitness\":{\"quorumWitnessType\":\"Disk\"}},\"monthlyComputeCost\":66.83869,\"monthlyStorageCost\":1.153487,\"costComponents\":[{\"name\":\"MonthlySecurityCost\",\"value\":36.31253,\"description\":\"aonzvaj\"},{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":39.682243,\"description\":\"demdidackzi\"},{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":92.795334,\"description\":\"damisvpztdi\"}],\"securitySuitability\":\"NotSuitable\",\"shouldProvisionReplicas\":true,\"skuReplicationMode\":\"FailoverGroupInstance\",\"migrationGuidelines\":[{\"guidelineId\":\"pjfojiunrls\",\"migrationGuidelineCategory\":\"FailoverCluterInstanceGuideLine\",\"migrationGuidelineContext\":[{}]}],\"recommendationReasonings\":[{\"reasoningId\":\"dtoiboancdrcoanv\",\"reasoningString\":\"ldxonckb\",\"reasoningCategory\":\"blfxlupibaqzi\",\"contextParameters\":[{},{}]}],\"migrationTargetPlatform\":\"AzureVirtualMachine\",\"suitability\":\"ConditionallySuitable\",\"migrationIssues\":[{\"issueId\":\"wwbogvgfklqiy\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{}]},{\"issueId\":\"lsb\",\"issueCategory\":\"Internal\",\"impactedObjects\":[{},{},{},{}]}]},\"assessedSqlEntityArmId\":\"kzx\",\"isClustered\":false,\"isHighAvailabilityEnabled\":false,\"sqlEdition\":\"vlrdsmovpi\",\"sqlVersion\":\"ndnoxaxnrqaq\",\"sizingCriterion\":\"PerformanceBased\"},\"id\":\"dxolousdv\",\"name\":\"g\",\"type\":\"tqm\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.assessedSqlRecommendedEntityOperations() - .listBySqlAssessmentV2("hqodv", "gcnbhcbmjk", "ti", "n", "ynts", 695243142, "mfmeftvhkmoo", 1369210689, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kzx", response.iterator().next().properties().assessedSqlEntityArmId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsInnerTests.java deleted file mode 100644 index e2347e4e8d7e..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessmentOptionsInner; -import com.azure.resourcemanager.migration.assessment.models.AssessmentOptionsProperties; - -public final class AssessmentOptionsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessmentOptionsInner model = BinaryData.fromString( - "{\"properties\":{\"vmFamilies\":[{\"familyName\":\"mpxttdbhrbnlankx\",\"targetLocations\":[\"k\",\"bhenbtkcxywnyt\",\"rsyn\",\"qidybyx\"],\"category\":[\"clha\",\"xdbabphlwr\",\"lfktsths\",\"cocmnyyaztt\"]},{\"familyName\":\"wwrq\",\"targetLocations\":[\"dckzywbiexz\",\"eyueaxibxujwb\",\"qwalmuzyoxaepd\",\"zjancuxr\"],\"category\":[\"bavxbniwdjswzt\",\"dbpgnxytxhp\",\"xbzpfzab\"]}],\"reservedInstanceVmFamilies\":[\"uhxwtctyqiklbbov\"],\"reservedInstanceSupportedLocations\":[\"zbhvgyuguosv\",\"kfssxqukkf\",\"l\"],\"reservedInstanceSupportedCurrencies\":[\"sxnkjzkdeslpvlo\",\"wiyighxpkdw\",\"baiuebbaumny\",\"upedeojnabckhs\"],\"reservedInstanceSupportedOffers\":[\"psiebtfhvpes\",\"pskrdqmh\",\"jdhtldwkyzxu\",\"tkncwsc\"],\"ultraDiskVmFamilies\":[{\"familyName\":\"xotogtwrupqsxv\",\"targetLocations\":[\"cykvceo\"]},{\"familyName\":\"ilovnot\",\"targetLocations\":[\"fcnj\"]},{\"familyName\":\"cn\",\"targetLocations\":[\"bttk\",\"h\",\"wpn\"]},{\"familyName\":\"t\",\"targetLocations\":[\"ermclfplphoxuscr\",\"abgy\"]}],\"premiumDiskVmFamilies\":[\"bjtazqugxywpmu\"],\"savingsPlanVmFamilies\":[\"jzwf\"],\"savingsPlanSupportedLocations\":[\"ujidsuyono\"]},\"id\":\"laocqxtccmg\",\"name\":\"udxytlmoyrx\",\"type\":\"wfudwpzntxhdzhl\"}") - .toObject(AssessmentOptionsInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessmentOptionsInner model = new AssessmentOptionsInner().withProperties(new AssessmentOptionsProperties()); - model = BinaryData.fromObject(model).toObject(AssessmentOptionsInner.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsListResultTests.java deleted file mode 100644 index 7482e1ef9178..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsListResultTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessmentOptionsInner; -import com.azure.resourcemanager.migration.assessment.models.AssessmentOptionsListResult; -import com.azure.resourcemanager.migration.assessment.models.AssessmentOptionsProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AssessmentOptionsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessmentOptionsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"vmFamilies\":[{\"familyName\":\"ljjgpbtoqcjmkl\",\"targetLocations\":[\"bqidtqaj\",\"yulpkudjkr\"],\"category\":[\"bzhfepgzgqexz\",\"ocxscpaierhhbcs\"]}],\"reservedInstanceVmFamilies\":[\"mmajtjaodx\",\"bnbdxkqpxokajion\",\"imexgstxgcpodgma\"],\"reservedInstanceSupportedLocations\":[\"mvdjwzrlovmc\"],\"reservedInstanceSupportedCurrencies\":[\"ijcoejctb\",\"aqsqsycbkbfk\"],\"reservedInstanceSupportedOffers\":[\"dkexxppofm\",\"axcfjpgddtocjjx\"],\"ultraDiskVmFamilies\":[{\"familyName\":\"o\",\"targetLocations\":[\"hd\",\"xibqeojnx\",\"bzv\",\"dntwndeicbtw\"]},{\"familyName\":\"zao\",\"targetLocations\":[\"hrhcffcyddglmjth\",\"qkwpyeicxmqc\",\"wqvhkhixuigdt\",\"pbobjo\"]},{\"familyName\":\"m\",\"targetLocations\":[\"a\"]}],\"premiumDiskVmFamilies\":[\"hrzayvvtpgvdf\",\"iotkftutqxl\",\"gxlefgugnxkrxd\"],\"savingsPlanVmFamilies\":[\"dt\"],\"savingsPlanSupportedLocations\":[\"rvqdra\",\"hjybigehoqfbo\"]},\"id\":\"kanyktzlcuiywg\",\"name\":\"ywgndrv\",\"type\":\"nhzgpphrcgyn\"},{\"properties\":{\"vmFamilies\":[{\"familyName\":\"cfvmmco\",\"targetLocations\":[\"xlzevgbmqjqabcy\",\"mivkwlzuvcc\",\"wnfnbacf\"],\"category\":[\"l\",\"bxetqgtzxdpn\",\"bqqwxrj\",\"eallnwsubisnj\"]}],\"reservedInstanceVmFamilies\":[\"mngnzscxaqw\"],\"reservedInstanceSupportedLocations\":[\"hcbonqvpkvlr\",\"njeaseipheofloke\",\"y\",\"enjbdlwtgrhp\"],\"reservedInstanceSupportedCurrencies\":[\"jumasx\"],\"reservedInstanceSupportedOffers\":[\"pqyegualhbxxh\",\"jj\"],\"ultraDiskVmFamilies\":[{\"familyName\":\"udgwdslfho\",\"targetLocations\":[\"cynpwlbjnp\"]}],\"premiumDiskVmFamilies\":[\"ftadehxnltyfs\",\"ppusuesnzwdejba\"],\"savingsPlanVmFamilies\":[\"xzdmohctb\",\"vudwx\",\"ndnvo\",\"gujjugwdkcglh\"],\"savingsPlanSupportedLocations\":[\"zj\",\"yggdtjixh\"]},\"id\":\"uofqwe\",\"name\":\"kh\",\"type\":\"enevfyexfwhybci\"},{\"properties\":{\"vmFamilies\":[{\"familyName\":\"c\",\"targetLocations\":[\"ynnaam\",\"ectehf\",\"qsc\",\"eypvhezrkg\"],\"category\":[\"jrefovgmkqsle\"]},{\"familyName\":\"vxyqjpkcattpngjc\",\"targetLocations\":[\"zsqpjhvmdajvny\",\"ounqecano\",\"eupfhyhltrpm\"],\"category\":[\"mcmatuokthfuiu\",\"odsfcpkvxodpuozm\",\"zydagfuaxbezyiuo\",\"ktwh\"]},{\"familyName\":\"xw\",\"targetLocations\":[\"q\",\"mbsureximo\"],\"category\":[\"cfsf\"]}],\"reservedInstanceVmFamilies\":[\"mddystkiiux\",\"qyud\"],\"reservedInstanceSupportedLocations\":[\"rq\",\"b\",\"oczvy\",\"fqrvkdvjsllrmvvd\"],\"reservedInstanceSupportedCurrencies\":[\"t\",\"pnpulexxbczwtru\"],\"reservedInstanceSupportedOffers\":[\"zb\",\"j\",\"sovmyokacspkwl\"],\"ultraDiskVmFamilies\":[{\"familyName\":\"bpxjmfl\",\"targetLocations\":[\"nchrkcciww\",\"juqk\",\"rsa\"]},{\"familyName\":\"wkuofoskghsauu\",\"targetLocations\":[\"mvxi\",\"duugidyjr\"]},{\"familyName\":\"byao\",\"targetLocations\":[\"xc\"]},{\"familyName\":\"npc\",\"targetLocations\":[\"cohslkev\",\"eggzfb\",\"hfmvfaxkffe\"]}],\"premiumDiskVmFamilies\":[\"hl\"],\"savingsPlanVmFamilies\":[\"zy\"],\"savingsPlanSupportedLocations\":[\"xmzsbbzogg\",\"grxwbu\",\"vjxxjnsp\",\"dptkoenkouk\"]},\"id\":\"udwtiukbl\",\"name\":\"ngkpocipazy\",\"type\":\"o\"},{\"properties\":{\"vmFamilies\":[{\"familyName\":\"jnpiucgyg\",\"targetLocations\":[\"zntypmrb\",\"izcdrqjsd\"],\"category\":[\"nfyhx\",\"eoejzic\",\"ifsjttgzfbishcb\",\"hajdeyeamdpha\"]}],\"reservedInstanceVmFamilies\":[\"pbuxwgipwhon\",\"wkgshwa\",\"kix\",\"bin\"],\"reservedInstanceSupportedLocations\":[\"uttmrywnuzoqft\"],\"reservedInstanceSupportedCurrencies\":[\"zrnkcqvyxlwh\",\"lsicohoqqnwv\",\"ryavwhheunmmqh\",\"yxzk\"],\"reservedInstanceSupportedOffers\":[\"cukoklyaxuconu\",\"szfkbe\",\"pewr\"],\"ultraDiskVmFamilies\":[{\"familyName\":\"vvjektcxsenhwlrs\",\"targetLocations\":[\"zpwv\",\"qdqgbi\",\"ylihkaetckt\",\"fcivfsnkym\"]},{\"familyName\":\"tqhjfbebrjcx\",\"targetLocations\":[\"uwutttxfvjrbi\",\"phxepcyvahf\",\"ljkyqxjvuuj\"]},{\"familyName\":\"idokgjlj\",\"targetLocations\":[\"gvcl\",\"bgsncghkjeszzhb\"]},{\"familyName\":\"htxfvgxbfsmxnehm\",\"targetLocations\":[\"cxgod\"]}],\"premiumDiskVmFamilies\":[\"qkkrb\",\"pukgriwflzlfb\"],\"savingsPlanVmFamilies\":[\"uzycispnqza\"],\"savingsPlanSupportedLocations\":[\"kbrpyydhibnuq\",\"kpikadrgvt\"]},\"id\":\"gnbuy\",\"name\":\"hijggme\",\"type\":\"fsiarbutr\"}],\"nextLink\":\"pnazzm\"}") - .toObject(AssessmentOptionsListResult.class); - Assertions.assertEquals("pnazzm", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessmentOptionsListResult model - = new AssessmentOptionsListResult() - .withValue(Arrays.asList(new AssessmentOptionsInner().withProperties(new AssessmentOptionsProperties()), - new AssessmentOptionsInner().withProperties(new AssessmentOptionsProperties()), - new AssessmentOptionsInner().withProperties(new AssessmentOptionsProperties()), - new AssessmentOptionsInner().withProperties(new AssessmentOptionsProperties()))) - .withNextLink("pnazzm"); - model = BinaryData.fromObject(model).toObject(AssessmentOptionsListResult.class); - Assertions.assertEquals("pnazzm", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsOperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsOperationsGetWithResponseMockTests.java deleted file mode 100644 index 23bb52e33793..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessmentOptions; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessmentOptionsOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"vmFamilies\":[{\"familyName\":\"haokgkskjiv\",\"targetLocations\":[\"hajqfuk\",\"eexpgeumi\"],\"category\":[\"uitrdexyiono\"]},{\"familyName\":\"inbd\",\"targetLocations\":[\"xcwqqrsmpc\"],\"category\":[\"rtugavbzbcyks\",\"vm\"]},{\"familyName\":\"gd\",\"targetLocations\":[\"fcmkr\",\"tsjcwjjxs\",\"mb\"],\"category\":[\"ifdxkecifhocjxw\",\"loozrvt\",\"vcmuf\",\"nlcpxxviry\"]}],\"reservedInstanceVmFamilies\":[\"gjgvr\",\"uvp\",\"gglpmcrdcuelj\"],\"reservedInstanceSupportedLocations\":[\"hxmfqryarvsxzqb\"],\"reservedInstanceSupportedCurrencies\":[\"jkayspthzo\",\"ubtlmjtg\"],\"reservedInstanceSupportedOffers\":[\"oskkfmk\",\"fdjxyxg\",\"kkqvjcteoedl\",\"slskkz\"],\"ultraDiskVmFamilies\":[{\"familyName\":\"nzdpvoco\",\"targetLocations\":[\"cnabxzf\",\"nggy\"]},{\"familyName\":\"xv\",\"targetLocations\":[\"mhi\",\"zkwwwn\",\"knrzdajlskzpt\"]},{\"familyName\":\"ulweucyrth\",\"targetLocations\":[\"ehmcgcje\",\"n\",\"ehokamvfej\",\"qnttmbq\"]},{\"familyName\":\"bzfivfok\",\"targetLocations\":[\"thhzagjfw\",\"yrl\",\"g\"]}],\"premiumDiskVmFamilies\":[\"zejgvkv\",\"baqszllrzlsmmd\",\"gmihzpimcqr\",\"nxtminklog\"],\"savingsPlanVmFamilies\":[\"tzarhzvqnsqktc\"],\"savingsPlanSupportedLocations\":[\"wzzoslpk\",\"btglwkzpgajsqj\",\"emqbmfuvqarwzxuq\"]},\"id\":\"bluimmbw\",\"name\":\"sfgtdmbvxekra\",\"type\":\"k\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - AssessmentOptions response = manager.assessmentOptionsOperations() - .getWithResponse("ypefcpczshnuqnda", "zupfkhuytuszxhm", "vtvegwqiukvzw", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsOperationsListByAssessmentProjectMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsOperationsListByAssessmentProjectMockTests.java deleted file mode 100644 index 832cff36f2a5..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsOperationsListByAssessmentProjectMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessmentOptions; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessmentOptionsOperationsListByAssessmentProjectMockTests { - @Test - public void testListByAssessmentProject() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"vmFamilies\":[{\"familyName\":\"pjptn\",\"targetLocations\":[\"hrsidq\",\"xlbtp\",\"kft\"],\"category\":[\"twmykyut\"]},{\"familyName\":\"mdwmf\",\"targetLocations\":[\"y\",\"vjqdvdwkq\",\"ldrlefgnaavua\",\"n\"],\"category\":[\"aou\",\"n\",\"dc\"]},{\"familyName\":\"hspfefyihd\",\"targetLocations\":[\"uyld\",\"hmtybkcgsuthhll\",\"mwynefxexlfciatx\"],\"category\":[\"rl\",\"mdskjhhxdlajfoxc\",\"scv\"]}],\"reservedInstanceVmFamilies\":[\"lh\",\"a\",\"krmukmyjmkxett\"],\"reservedInstanceSupportedLocations\":[\"ojfkq\",\"dnqtoqxjhqx\",\"s\"],\"reservedInstanceSupportedCurrencies\":[\"kbtn\",\"l\",\"ngldmbiipsn\"],\"reservedInstanceSupportedOffers\":[\"lqkznxhhllxricct\"],\"ultraDiskVmFamilies\":[{\"familyName\":\"qqoajxeiyglesrw\",\"targetLocations\":[\"xhdctrceqnk\"]},{\"familyName\":\"upobehdmljz\",\"targetLocations\":[\"umepjpbibn\"]},{\"familyName\":\"phepifexleqirc\",\"targetLocations\":[\"ly\"]}],\"premiumDiskVmFamilies\":[\"x\",\"rpjl\"],\"savingsPlanVmFamilies\":[\"uod\",\"cpunettepdjx\",\"eskoy\"],\"savingsPlanSupportedLocations\":[\"ylpckaewsedv\",\"skwxe\"]},\"id\":\"phrgfnzhctm\",\"name\":\"tsghpbcbcp\",\"type\":\"arpzeqacdldtzm\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.assessmentOptionsOperations() - .listByAssessmentProject("fv", "n", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsPropertiesTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsPropertiesTests.java deleted file mode 100644 index ccdd5df6c36c..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentOptionsPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AssessmentOptionsProperties; - -public final class AssessmentOptionsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessmentOptionsProperties model = BinaryData.fromString( - "{\"vmFamilies\":[{\"familyName\":\"hckfrlhrx\",\"targetLocations\":[\"yvpycanuzbpzk\"],\"category\":[\"uwbc\",\"nwbmeh\",\"seyvj\"]},{\"familyName\":\"rts\",\"targetLocations\":[\"pkdeemaofmxagkvt\",\"elmqk\"],\"category\":[\"hvljuahaquh\",\"dhmdua\",\"aex\"]},{\"familyName\":\"vfadmws\",\"targetLocations\":[\"gvxp\"],\"category\":[\"mzlfmisgwb\",\"b\"]}],\"reservedInstanceVmFamilies\":[\"dawkzbali\",\"urqhaka\",\"hashsfwxosow\",\"xcug\"],\"reservedInstanceSupportedLocations\":[\"ooxdjebwpuc\",\"wfvovbv\",\"euecivyhzceuoj\"],\"reservedInstanceSupportedCurrencies\":[\"wjue\"],\"reservedInstanceSupportedOffers\":[\"wmcdytdxwi\"],\"ultraDiskVmFamilies\":[{\"familyName\":\"jawgqwg\",\"targetLocations\":[\"isk\"]},{\"familyName\":\"bkpyc\",\"targetLocations\":[\"wndnhj\"]},{\"familyName\":\"uwhvylwzbtdhxujz\",\"targetLocations\":[\"pow\",\"wpr\"]}],\"premiumDiskVmFamilies\":[\"veual\"],\"savingsPlanVmFamilies\":[\"mkh\"],\"savingsPlanSupportedLocations\":[\"bbcswsrtjri\"]}") - .toObject(AssessmentOptionsProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessmentOptionsProperties model = new AssessmentOptionsProperties(); - model = BinaryData.fromObject(model).toObject(AssessmentOptionsProperties.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectInnerTests.java deleted file mode 100644 index 71446b938ad8..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectInnerTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessmentProjectInner; -import com.azure.resourcemanager.migration.assessment.models.ProjectProperties; -import com.azure.resourcemanager.migration.assessment.models.ProjectStatus; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AssessmentProjectInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessmentProjectInner model = BinaryData.fromString( - "{\"properties\":{\"createdTimestamp\":\"2021-11-09T02:37:57Z\",\"updatedTimestamp\":\"2021-01-31T22:20:23Z\",\"serviceEndpoint\":\"aolthqtrg\",\"assessmentSolutionId\":\"bpf\",\"projectStatus\":\"Active\",\"customerWorkspaceId\":\"n\",\"customerWorkspaceLocation\":\"v\",\"publicNetworkAccess\":\"jrwzox\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"luwfzitonpeqfpjk\",\"lxofpdvhpfxxypin\",\"nmayhuybb\",\"podepoo\"],\"privateEndpoint\":{\"id\":\"uvamiheognarxzxt\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"usivye\",\"actionsRequired\":\"ciqihnhung\"},\"provisioningState\":\"Creating\"},\"id\":\"rnfygxgispem\",\"name\":\"tzfkufubl\",\"type\":\"ofx\"},{\"properties\":{\"groupIds\":[\"jaeq\",\"hqjbasvmsmj\"],\"privateEndpoint\":{\"id\":\"ngsntnbybk\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"rwclxxwrljdo\",\"actionsRequired\":\"kcqvkocrc\"},\"provisioningState\":\"Succeeded\"},\"id\":\"tnhxbn\",\"name\":\"biksq\",\"type\":\"gls\"}],\"customerStorageAccountArmId\":\"inqpjwnzll\",\"provisioningState\":\"Updating\"},\"location\":\"pee\",\"tags\":{\"uujitcjc\":\"gxsabkyq\",\"d\":\"dzevndhkrw\"},\"id\":\"ppdsbdkvwrwj\",\"name\":\"eusnhutj\",\"type\":\"ltmrldh\"}") - .toObject(AssessmentProjectInner.class); - Assertions.assertEquals("pee", model.location()); - Assertions.assertEquals("gxsabkyq", model.tags().get("uujitcjc")); - Assertions.assertEquals(ProvisioningState.UPDATING, model.properties().provisioningState()); - Assertions.assertEquals("bpf", model.properties().assessmentSolutionId()); - Assertions.assertEquals(ProjectStatus.ACTIVE, model.properties().projectStatus()); - Assertions.assertEquals("n", model.properties().customerWorkspaceId()); - Assertions.assertEquals("v", model.properties().customerWorkspaceLocation()); - Assertions.assertEquals("jrwzox", model.properties().publicNetworkAccess()); - Assertions.assertEquals("inqpjwnzll", model.properties().customerStorageAccountArmId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessmentProjectInner model = new AssessmentProjectInner().withLocation("pee") - .withTags(mapOf("uujitcjc", "gxsabkyq", "d", "dzevndhkrw")) - .withProperties(new ProjectProperties().withProvisioningState(ProvisioningState.UPDATING) - .withAssessmentSolutionId("bpf") - .withProjectStatus(ProjectStatus.ACTIVE) - .withCustomerWorkspaceId("n") - .withCustomerWorkspaceLocation("v") - .withPublicNetworkAccess("jrwzox") - .withCustomerStorageAccountArmId("inqpjwnzll")); - model = BinaryData.fromObject(model).toObject(AssessmentProjectInner.class); - Assertions.assertEquals("pee", model.location()); - Assertions.assertEquals("gxsabkyq", model.tags().get("uujitcjc")); - Assertions.assertEquals(ProvisioningState.UPDATING, model.properties().provisioningState()); - Assertions.assertEquals("bpf", model.properties().assessmentSolutionId()); - Assertions.assertEquals(ProjectStatus.ACTIVE, model.properties().projectStatus()); - Assertions.assertEquals("n", model.properties().customerWorkspaceId()); - Assertions.assertEquals("v", model.properties().customerWorkspaceLocation()); - Assertions.assertEquals("jrwzox", model.properties().publicNetworkAccess()); - Assertions.assertEquals("inqpjwnzll", model.properties().customerStorageAccountArmId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectListResultTests.java deleted file mode 100644 index fee52fa8e190..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectListResultTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessmentProjectInner; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectListResult; -import com.azure.resourcemanager.migration.assessment.models.ProjectProperties; -import com.azure.resourcemanager.migration.assessment.models.ProjectStatus; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AssessmentProjectListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessmentProjectListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"createdTimestamp\":\"2021-11-25T18:32:18Z\",\"updatedTimestamp\":\"2021-08-11T05:57:13Z\",\"serviceEndpoint\":\"qhabifpikxwcz\",\"assessmentSolutionId\":\"scnpqxuhivy\",\"projectStatus\":\"Inactive\",\"customerWorkspaceId\":\"b\",\"customerWorkspaceLocation\":\"rkxvdum\",\"publicNetworkAccess\":\"rtfw\",\"privateEndpointConnections\":[{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"audccsnhs\",\"name\":\"cnyejhkryhtnapcz\",\"type\":\"lokjyemkk\"}],\"customerStorageAccountArmId\":\"ipjoxzjnchgejs\",\"provisioningState\":\"Failed\"},\"location\":\"ailzydehojwyahu\",\"tags\":{\"wixjsprozvcp\":\"pmqnja\",\"atscmd\":\"tegjvwmf\",\"zkrwfn\":\"pjhulsuuvmkj\",\"lwejdpv\":\"iodjp\"},\"id\":\"ryo\",\"name\":\"psoacctazakljl\",\"type\":\"hbcryffdfdosyge\"}],\"nextLink\":\"aojakhmsbzjhcrz\"}") - .toObject(AssessmentProjectListResult.class); - Assertions.assertEquals("ailzydehojwyahu", model.value().get(0).location()); - Assertions.assertEquals("pmqnja", model.value().get(0).tags().get("wixjsprozvcp")); - Assertions.assertEquals(ProvisioningState.FAILED, model.value().get(0).properties().provisioningState()); - Assertions.assertEquals("scnpqxuhivy", model.value().get(0).properties().assessmentSolutionId()); - Assertions.assertEquals(ProjectStatus.INACTIVE, model.value().get(0).properties().projectStatus()); - Assertions.assertEquals("b", model.value().get(0).properties().customerWorkspaceId()); - Assertions.assertEquals("rkxvdum", model.value().get(0).properties().customerWorkspaceLocation()); - Assertions.assertEquals("rtfw", model.value().get(0).properties().publicNetworkAccess()); - Assertions.assertEquals("ipjoxzjnchgejs", model.value().get(0).properties().customerStorageAccountArmId()); - Assertions.assertEquals("aojakhmsbzjhcrz", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessmentProjectListResult model = new AssessmentProjectListResult() - .withValue(Arrays.asList(new AssessmentProjectInner().withLocation("ailzydehojwyahu") - .withTags( - mapOf("wixjsprozvcp", "pmqnja", "atscmd", "tegjvwmf", "zkrwfn", "pjhulsuuvmkj", "lwejdpv", "iodjp")) - .withProperties(new ProjectProperties().withProvisioningState(ProvisioningState.FAILED) - .withAssessmentSolutionId("scnpqxuhivy") - .withProjectStatus(ProjectStatus.INACTIVE) - .withCustomerWorkspaceId("b") - .withCustomerWorkspaceLocation("rkxvdum") - .withPublicNetworkAccess("rtfw") - .withCustomerStorageAccountArmId("ipjoxzjnchgejs")))) - .withNextLink("aojakhmsbzjhcrz"); - model = BinaryData.fromObject(model).toObject(AssessmentProjectListResult.class); - Assertions.assertEquals("ailzydehojwyahu", model.value().get(0).location()); - Assertions.assertEquals("pmqnja", model.value().get(0).tags().get("wixjsprozvcp")); - Assertions.assertEquals(ProvisioningState.FAILED, model.value().get(0).properties().provisioningState()); - Assertions.assertEquals("scnpqxuhivy", model.value().get(0).properties().assessmentSolutionId()); - Assertions.assertEquals(ProjectStatus.INACTIVE, model.value().get(0).properties().projectStatus()); - Assertions.assertEquals("b", model.value().get(0).properties().customerWorkspaceId()); - Assertions.assertEquals("rkxvdum", model.value().get(0).properties().customerWorkspaceLocation()); - Assertions.assertEquals("rtfw", model.value().get(0).properties().publicNetworkAccess()); - Assertions.assertEquals("ipjoxzjnchgejs", model.value().get(0).properties().customerStorageAccountArmId()); - Assertions.assertEquals("aojakhmsbzjhcrz", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryInnerTests.java deleted file mode 100644 index a66571246931..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessmentProjectSummaryInner; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectSummaryProperties; - -public final class AssessmentProjectSummaryInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessmentProjectSummaryInner model = BinaryData.fromString( - "{\"properties\":{\"errorSummaryAffectedEntities\":[{\"assessmentType\":\"Unknown\",\"count\":561767008},{\"assessmentType\":\"WebAppAssessment\",\"count\":1999784595},{\"assessmentType\":\"MachineAssessment\",\"count\":1630921405},{\"assessmentType\":\"Unknown\",\"count\":1509139368}],\"numberOfPrivateEndpointConnections\":1650902966,\"numberOfGroups\":512176401,\"numberOfMachines\":562062198,\"numberOfImportMachines\":2048897127,\"numberOfAssessments\":1477121585,\"lastAssessmentTimestamp\":\"2021-07-10T00:46:33Z\"},\"id\":\"oqmavnwqjwgo\",\"name\":\"nlejjjkxybwf\",\"type\":\"bkjbz\"}") - .toObject(AssessmentProjectSummaryInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessmentProjectSummaryInner model - = new AssessmentProjectSummaryInner().withProperties(new AssessmentProjectSummaryProperties()); - model = BinaryData.fromObject(model).toObject(AssessmentProjectSummaryInner.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryListResultTests.java deleted file mode 100644 index 762c6b535cc0..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryListResultTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AssessmentProjectSummaryInner; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectSummaryListResult; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectSummaryProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AssessmentProjectSummaryListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessmentProjectSummaryListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"errorSummaryAffectedEntities\":[{\"assessmentType\":\"WebAppAssessment\",\"count\":1760515250},{\"assessmentType\":\"MachineAssessment\",\"count\":855475519},{\"assessmentType\":\"AvsAssessment\",\"count\":44359984},{\"assessmentType\":\"SqlAssessment\",\"count\":1790320918}],\"numberOfPrivateEndpointConnections\":1654088054,\"numberOfGroups\":43115717,\"numberOfMachines\":1661164676,\"numberOfImportMachines\":1777294883,\"numberOfAssessments\":1206039468,\"lastAssessmentTimestamp\":\"2021-08-24T15:13:37Z\"},\"id\":\"essmzhhku\",\"name\":\"ip\",\"type\":\"dqq\"},{\"properties\":{\"errorSummaryAffectedEntities\":[{\"assessmentType\":\"WebAppAssessment\",\"count\":1539234550}],\"numberOfPrivateEndpointConnections\":205688026,\"numberOfGroups\":863397586,\"numberOfMachines\":1828874744,\"numberOfImportMachines\":759827804,\"numberOfAssessments\":218702918,\"lastAssessmentTimestamp\":\"2021-01-24T19:13:48Z\"},\"id\":\"a\",\"name\":\"mxhzzysevus\",\"type\":\"ivzrrryveimipsk\"},{\"properties\":{\"errorSummaryAffectedEntities\":[{\"assessmentType\":\"Unknown\",\"count\":1556384271},{\"assessmentType\":\"WebAppAssessment\",\"count\":1460525745},{\"assessmentType\":\"SqlAssessment\",\"count\":754737870}],\"numberOfPrivateEndpointConnections\":1587694223,\"numberOfGroups\":1055282303,\"numberOfMachines\":1296722433,\"numberOfImportMachines\":1064338012,\"numberOfAssessments\":422626057,\"lastAssessmentTimestamp\":\"2021-05-14T23:41:37Z\"},\"id\":\"smjtgrqgdg\",\"name\":\"kileplkcsmknhwtb\",\"type\":\"aedorvvmqf\"},{\"properties\":{\"errorSummaryAffectedEntities\":[{\"assessmentType\":\"WebAppAssessment\",\"count\":1086162181}],\"numberOfPrivateEndpointConnections\":943881137,\"numberOfGroups\":833434328,\"numberOfMachines\":1369032842,\"numberOfImportMachines\":1457349123,\"numberOfAssessments\":1726761587,\"lastAssessmentTimestamp\":\"2021-08-22T08:57:03Z\"},\"id\":\"exjddvjsaqwot\",\"name\":\"mwllcolsrsxapt\",\"type\":\"f\"}],\"nextLink\":\"xcgjokjljnhvlq\"}") - .toObject(AssessmentProjectSummaryListResult.class); - Assertions.assertEquals("xcgjokjljnhvlq", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessmentProjectSummaryListResult model = new AssessmentProjectSummaryListResult() - .withValue(Arrays.asList( - new AssessmentProjectSummaryInner().withProperties(new AssessmentProjectSummaryProperties()), - new AssessmentProjectSummaryInner().withProperties(new AssessmentProjectSummaryProperties()), - new AssessmentProjectSummaryInner().withProperties(new AssessmentProjectSummaryProperties()), - new AssessmentProjectSummaryInner().withProperties(new AssessmentProjectSummaryProperties()))) - .withNextLink("xcgjokjljnhvlq"); - model = BinaryData.fromObject(model).toObject(AssessmentProjectSummaryListResult.class); - Assertions.assertEquals("xcgjokjljnhvlq", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsGetWithResponseMockTests.java deleted file mode 100644 index 13a58db43faa..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectSummary; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessmentProjectSummaryOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"errorSummaryAffectedEntities\":[{\"assessmentType\":\"WebAppAssessment\",\"count\":895776301},{\"assessmentType\":\"WebAppAssessment\",\"count\":1257209908}],\"numberOfPrivateEndpointConnections\":1819948805,\"numberOfGroups\":678358747,\"numberOfMachines\":1768698237,\"numberOfImportMachines\":817823208,\"numberOfAssessments\":161346417,\"lastAssessmentTimestamp\":\"2021-02-06T01:10:03Z\"},\"id\":\"ddwvmqxiyooky\",\"name\":\"ozkbnzxbypfq\",\"type\":\"gaixwrgrkkd\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - AssessmentProjectSummary response = manager.assessmentProjectSummaryOperations() - .getWithResponse("zxpxhn", "lslekcttgzkj", "yqpdwadeghztld", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsListByAssessmentProjectMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsListByAssessmentProjectMockTests.java deleted file mode 100644 index e8642cd87c41..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryOperationsListByAssessmentProjectMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectSummary; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessmentProjectSummaryOperationsListByAssessmentProjectMockTests { - @Test - public void testListByAssessmentProject() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"errorSummaryAffectedEntities\":[{\"assessmentType\":\"AvsAssessment\",\"count\":584772284}],\"numberOfPrivateEndpointConnections\":1957416812,\"numberOfGroups\":1553900618,\"numberOfMachines\":1951216053,\"numberOfImportMachines\":986123391,\"numberOfAssessments\":1439738026,\"lastAssessmentTimestamp\":\"2021-07-21T20:09:12Z\"},\"id\":\"qizjv\",\"name\":\"pwooajeyyj\",\"type\":\"jjx\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.assessmentProjectSummaryOperations() - .listByAssessmentProject("luqrojadhfztlray", "rkgzkyhudbkuw", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryPropertiesTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryPropertiesTests.java deleted file mode 100644 index b209527c8040..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectSummaryPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectSummaryProperties; - -public final class AssessmentProjectSummaryPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessmentProjectSummaryProperties model = BinaryData.fromString( - "{\"errorSummaryAffectedEntities\":[{\"assessmentType\":\"WebAppAssessment\",\"count\":880729716}],\"numberOfPrivateEndpointConnections\":1891353200,\"numberOfGroups\":1541050102,\"numberOfMachines\":605317874,\"numberOfImportMachines\":491994414,\"numberOfAssessments\":811449935,\"lastAssessmentTimestamp\":\"2021-03-02T20:18:48Z\"}") - .toObject(AssessmentProjectSummaryProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessmentProjectSummaryProperties model = new AssessmentProjectSummaryProperties(); - model = BinaryData.fromObject(model).toObject(AssessmentProjectSummaryProperties.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectUpdatePropertiesTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectUpdatePropertiesTests.java deleted file mode 100644 index d231bb5b7aa1..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectUpdatePropertiesTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectUpdateProperties; -import com.azure.resourcemanager.migration.assessment.models.ProjectStatus; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import org.junit.jupiter.api.Assertions; - -public final class AssessmentProjectUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessmentProjectUpdateProperties model = BinaryData.fromString( - "{\"assessmentSolutionId\":\"hc\",\"projectStatus\":\"Active\",\"customerWorkspaceId\":\"hjtckwhd\",\"customerWorkspaceLocation\":\"ifiyipjxsqwpgrj\",\"publicNetworkAccess\":\"norcjxvsnbyxqab\",\"customerStorageAccountArmId\":\"ocpcy\",\"provisioningState\":\"Accepted\"}") - .toObject(AssessmentProjectUpdateProperties.class); - Assertions.assertEquals("hc", model.assessmentSolutionId()); - Assertions.assertEquals(ProjectStatus.ACTIVE, model.projectStatus()); - Assertions.assertEquals("hjtckwhd", model.customerWorkspaceId()); - Assertions.assertEquals("ifiyipjxsqwpgrj", model.customerWorkspaceLocation()); - Assertions.assertEquals("norcjxvsnbyxqab", model.publicNetworkAccess()); - Assertions.assertEquals("ocpcy", model.customerStorageAccountArmId()); - Assertions.assertEquals(ProvisioningState.ACCEPTED, model.provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessmentProjectUpdateProperties model = new AssessmentProjectUpdateProperties().withAssessmentSolutionId("hc") - .withProjectStatus(ProjectStatus.ACTIVE) - .withCustomerWorkspaceId("hjtckwhd") - .withCustomerWorkspaceLocation("ifiyipjxsqwpgrj") - .withPublicNetworkAccess("norcjxvsnbyxqab") - .withCustomerStorageAccountArmId("ocpcy") - .withProvisioningState(ProvisioningState.ACCEPTED); - model = BinaryData.fromObject(model).toObject(AssessmentProjectUpdateProperties.class); - Assertions.assertEquals("hc", model.assessmentSolutionId()); - Assertions.assertEquals(ProjectStatus.ACTIVE, model.projectStatus()); - Assertions.assertEquals("hjtckwhd", model.customerWorkspaceId()); - Assertions.assertEquals("ifiyipjxsqwpgrj", model.customerWorkspaceLocation()); - Assertions.assertEquals("norcjxvsnbyxqab", model.publicNetworkAccess()); - Assertions.assertEquals("ocpcy", model.customerStorageAccountArmId()); - Assertions.assertEquals(ProvisioningState.ACCEPTED, model.provisioningState()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectUpdateTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectUpdateTests.java deleted file mode 100644 index 6a00d5733adb..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectUpdateTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectUpdate; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProjectUpdateProperties; -import com.azure.resourcemanager.migration.assessment.models.ProjectStatus; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AssessmentProjectUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessmentProjectUpdate model = BinaryData.fromString( - "{\"tags\":{\"ymwisdkft\":\"zwdzuh\",\"vkmijcmmxdcuf\":\"wxmnteiwao\",\"cxtbzsg\":\"fsrpymzidnse\",\"sne\":\"yc\"},\"properties\":{\"assessmentSolutionId\":\"wzjeiach\",\"projectStatus\":\"Active\",\"customerWorkspaceId\":\"flnrosfqpteehzz\",\"customerWorkspaceLocation\":\"pyqr\",\"publicNetworkAccess\":\"z\",\"customerStorageAccountArmId\":\"pvswjdkirso\",\"provisioningState\":\"Canceled\"}}") - .toObject(AssessmentProjectUpdate.class); - Assertions.assertEquals("zwdzuh", model.tags().get("ymwisdkft")); - Assertions.assertEquals("wzjeiach", model.properties().assessmentSolutionId()); - Assertions.assertEquals(ProjectStatus.ACTIVE, model.properties().projectStatus()); - Assertions.assertEquals("flnrosfqpteehzz", model.properties().customerWorkspaceId()); - Assertions.assertEquals("pyqr", model.properties().customerWorkspaceLocation()); - Assertions.assertEquals("z", model.properties().publicNetworkAccess()); - Assertions.assertEquals("pvswjdkirso", model.properties().customerStorageAccountArmId()); - Assertions.assertEquals(ProvisioningState.CANCELED, model.properties().provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessmentProjectUpdate model = new AssessmentProjectUpdate() - .withTags( - mapOf("ymwisdkft", "zwdzuh", "vkmijcmmxdcuf", "wxmnteiwao", "cxtbzsg", "fsrpymzidnse", "sne", "yc")) - .withProperties(new AssessmentProjectUpdateProperties().withAssessmentSolutionId("wzjeiach") - .withProjectStatus(ProjectStatus.ACTIVE) - .withCustomerWorkspaceId("flnrosfqpteehzz") - .withCustomerWorkspaceLocation("pyqr") - .withPublicNetworkAccess("z") - .withCustomerStorageAccountArmId("pvswjdkirso") - .withProvisioningState(ProvisioningState.CANCELED)); - model = BinaryData.fromObject(model).toObject(AssessmentProjectUpdate.class); - Assertions.assertEquals("zwdzuh", model.tags().get("ymwisdkft")); - Assertions.assertEquals("wzjeiach", model.properties().assessmentSolutionId()); - Assertions.assertEquals(ProjectStatus.ACTIVE, model.properties().projectStatus()); - Assertions.assertEquals("flnrosfqpteehzz", model.properties().customerWorkspaceId()); - Assertions.assertEquals("pyqr", model.properties().customerWorkspaceLocation()); - Assertions.assertEquals("z", model.properties().publicNetworkAccess()); - Assertions.assertEquals("pvswjdkirso", model.properties().customerStorageAccountArmId()); - Assertions.assertEquals(ProvisioningState.CANCELED, model.properties().provisioningState()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsCreateMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsCreateMockTests.java deleted file mode 100644 index 26d3413daee3..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsCreateMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProject; -import com.azure.resourcemanager.migration.assessment.models.ProjectProperties; -import com.azure.resourcemanager.migration.assessment.models.ProjectStatus; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessmentProjectsOperationsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"createdTimestamp\":\"2021-12-08T22:47:10Z\",\"updatedTimestamp\":\"2021-05-04T10:08:41Z\",\"serviceEndpoint\":\"e\",\"assessmentSolutionId\":\"exkxbhx\",\"projectStatus\":\"Inactive\",\"customerWorkspaceId\":\"ulgm\",\"customerWorkspaceLocation\":\"jevdyznf\",\"publicNetworkAccess\":\"svkskmqoz\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"jrliiz\",\"ixlqfhefkwabsolr\",\"nqqlmgnl\",\"xsjxtelexhvuqboz\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\"},\"id\":\"ocarkuzlbcnndt\",\"name\":\"nx\",\"type\":\"wqy\"},{\"properties\":{\"groupIds\":[\"dyz\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\"},\"id\":\"exn\",\"name\":\"akckywym\",\"type\":\"gaabjkdtf\"},{\"properties\":{\"groupIds\":[\"ogzvk\",\"wrsiwdyjqurykc\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\"},\"id\":\"ekcsueh\",\"name\":\"gdda\",\"type\":\"bcbgydlqidywmhm\"},{\"properties\":{\"groupIds\":[\"ilkfbnrqqxv\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"fnqt\",\"name\":\"jtoma\",\"type\":\"swbnfddepldwqjns\"}],\"customerStorageAccountArmId\":\"ygleexa\",\"provisioningState\":\"Succeeded\"},\"location\":\"whsbrcary\",\"tags\":{\"yvoaqajuvehzp\":\"j\",\"mpfu\":\"dmkrrb\",\"mpzkrvfyifkd\":\"ubefgybpmfbfunu\",\"tnkjjwgcwnphb\":\"chlzvfi\"},\"id\":\"gfyrtogmhmjpjsc\",\"name\":\"fp\",\"type\":\"qwtygevgwmseharx\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - AssessmentProject response = manager.assessmentProjectsOperations() - .define("bjqvls") - .withRegion("sbzxl") - .withExistingResourceGroup("vxisimjcea") - .withTags(mapOf("zacn", "omeikjcl", "qbxyxoyfpuqqi", "wpfsuqtaaz", "wvpsoz", "ezxlhdjzqdca", "pnx", - "iihjriybmrzo")) - .withProperties(new ProjectProperties().withProvisioningState(ProvisioningState.ACCEPTED) - .withAssessmentSolutionId("puby") - .withProjectStatus(ProjectStatus.ACTIVE) - .withCustomerWorkspaceId("k") - .withCustomerWorkspaceLocation("eebgvopemtuoqu") - .withPublicNetworkAccess("yegq") - .withCustomerStorageAccountArmId("xuwwkp")) - .create(); - - Assertions.assertEquals("whsbrcary", response.location()); - Assertions.assertEquals("j", response.tags().get("yvoaqajuvehzp")); - Assertions.assertEquals(ProvisioningState.SUCCEEDED, response.properties().provisioningState()); - Assertions.assertEquals("exkxbhx", response.properties().assessmentSolutionId()); - Assertions.assertEquals(ProjectStatus.INACTIVE, response.properties().projectStatus()); - Assertions.assertEquals("ulgm", response.properties().customerWorkspaceId()); - Assertions.assertEquals("jevdyznf", response.properties().customerWorkspaceLocation()); - Assertions.assertEquals("svkskmqoz", response.properties().publicNetworkAccess()); - Assertions.assertEquals("ygleexa", response.properties().customerStorageAccountArmId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsDeleteByResourceGroupWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 3b0eb0771821..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessmentProjectsOperationsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.assessmentProjectsOperations() - .deleteByResourceGroupWithResponse("jcx", "yqgxhlus", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsGetByResourceGroupWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index f315f8abb08d..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProject; -import com.azure.resourcemanager.migration.assessment.models.ProjectStatus; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessmentProjectsOperationsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"createdTimestamp\":\"2021-09-12T18:54:27Z\",\"updatedTimestamp\":\"2021-07-23T12:28:28Z\",\"serviceEndpoint\":\"dsiwdfmmp\",\"assessmentSolutionId\":\"zzwvywrgyng\",\"projectStatus\":\"Inactive\",\"customerWorkspaceId\":\"pxncakiqao\",\"customerWorkspaceLocation\":\"jrkc\",\"publicNetworkAccess\":\"mgglvlmfe\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"kgltyg\",\"hqfgqkayejsx\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"wf\",\"name\":\"ziiucij\",\"type\":\"ceatlijjjrtvamca\"},{\"properties\":{\"groupIds\":[\"xk\",\"ccxetyvkun\",\"ignohi\",\"kgqogjw\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"dvabbxbhmedeilb\",\"name\":\"ywfcfxzi\",\"type\":\"zzihvwy\"}],\"customerStorageAccountArmId\":\"suvjslcz\",\"provisioningState\":\"Updating\"},\"location\":\"djsllfr\",\"tags\":{\"acfrgna\":\"mvxad\",\"fbktyjmfczlf\":\"bab\"},\"id\":\"yq\",\"name\":\"frbzgowo\",\"type\":\"qmje\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - AssessmentProject response = manager.assessmentProjectsOperations() - .getByResourceGroupWithResponse("dmkxwxdcvjwcy", "iakeciqc", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("djsllfr", response.location()); - Assertions.assertEquals("mvxad", response.tags().get("acfrgna")); - Assertions.assertEquals(ProvisioningState.UPDATING, response.properties().provisioningState()); - Assertions.assertEquals("zzwvywrgyng", response.properties().assessmentSolutionId()); - Assertions.assertEquals(ProjectStatus.INACTIVE, response.properties().projectStatus()); - Assertions.assertEquals("pxncakiqao", response.properties().customerWorkspaceId()); - Assertions.assertEquals("jrkc", response.properties().customerWorkspaceLocation()); - Assertions.assertEquals("mgglvlmfe", response.properties().publicNetworkAccess()); - Assertions.assertEquals("suvjslcz", response.properties().customerStorageAccountArmId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsListByResourceGroupMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsListByResourceGroupMockTests.java deleted file mode 100644 index d9919f59ad07..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsListByResourceGroupMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProject; -import com.azure.resourcemanager.migration.assessment.models.ProjectStatus; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessmentProjectsOperationsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"createdTimestamp\":\"2021-09-08T11:13:10Z\",\"updatedTimestamp\":\"2021-11-06T14:05:16Z\",\"serviceEndpoint\":\"ljomevt\",\"assessmentSolutionId\":\"cnlbv\",\"projectStatus\":\"Active\",\"customerWorkspaceId\":\"dkkgjiiytssikizb\",\"customerWorkspaceLocation\":\"fqb\",\"publicNetworkAccess\":\"tnrgmqsorhce\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"km\",\"cpwzv\",\"doksqdtiwlwxlbon\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"qicqchygt\",\"name\":\"xbyja\",\"type\":\"epubdp\"},{\"properties\":{\"groupIds\":[\"vgxiaodetvo\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"uwsaifmcwn\",\"name\":\"s\",\"type\":\"zlehgcvkbcknjolg\"}],\"customerStorageAccountArmId\":\"yxpvelszerqze\",\"provisioningState\":\"Provisioning\"},\"location\":\"eintxwaljglzobl\",\"tags\":{\"yqbhd\":\"afrqulhm\",\"xwmzwdfkbnrz\":\"afjrqpjiyrqjcrg\",\"tqjfgxxsaet\":\"rpdltbq\",\"cduwjoedx\":\"zdgvpyigdaqqilz\"},\"id\":\"gucaif\",\"name\":\"aurwwgilfjq\",\"type\":\"a\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.assessmentProjectsOperations().listByResourceGroup("cgqtag", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("eintxwaljglzobl", response.iterator().next().location()); - Assertions.assertEquals("afrqulhm", response.iterator().next().tags().get("yqbhd")); - Assertions.assertEquals(ProvisioningState.PROVISIONING, - response.iterator().next().properties().provisioningState()); - Assertions.assertEquals("cnlbv", response.iterator().next().properties().assessmentSolutionId()); - Assertions.assertEquals(ProjectStatus.ACTIVE, response.iterator().next().properties().projectStatus()); - Assertions.assertEquals("dkkgjiiytssikizb", response.iterator().next().properties().customerWorkspaceId()); - Assertions.assertEquals("fqb", response.iterator().next().properties().customerWorkspaceLocation()); - Assertions.assertEquals("tnrgmqsorhce", response.iterator().next().properties().publicNetworkAccess()); - Assertions.assertEquals("yxpvelszerqze", response.iterator().next().properties().customerStorageAccountArmId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsListMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsListMockTests.java deleted file mode 100644 index 745a981436c2..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentProjectsOperationsListMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessmentProject; -import com.azure.resourcemanager.migration.assessment.models.ProjectStatus; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessmentProjectsOperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"createdTimestamp\":\"2021-09-21T03:29:13Z\",\"updatedTimestamp\":\"2021-03-30T18:39:54Z\",\"serviceEndpoint\":\"adrmmwiuawvcmjzk\",\"assessmentSolutionId\":\"idisczskosw\",\"projectStatus\":\"Inactive\",\"customerWorkspaceId\":\"azugamxzkrrcoi\",\"customerWorkspaceLocation\":\"bamnppcc\",\"publicNetworkAccess\":\"u\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"zaxy\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Failed\"},\"id\":\"uizh\",\"name\":\"hnepkpeti\",\"type\":\"rx\"},{\"properties\":{\"groupIds\":[\"xdukecpxd\",\"zvdhctmmkosz\",\"dblnsntrp\",\"aqkiofkb\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"lbnld\",\"name\":\"vcb\",\"type\":\"hez\"},{\"properties\":{\"groupIds\":[\"usqxutrpbrr\",\"yuuatvlmbjwcolbm\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"tpc\",\"name\":\"ahprzrvxhmtfhocn\",\"type\":\"zcmjhngxnoqrxt\"}],\"customerStorageAccountArmId\":\"sn\",\"provisioningState\":\"Deleting\"},\"location\":\"d\",\"tags\":{\"hepfwwtjfdoes\":\"did\",\"dbckyo\":\"xhmw\",\"jzrbhtmeplv\":\"kxkxhnegk\",\"pgsn\":\"kaobrl\"},\"id\":\"agnchjhgemuowaky\",\"name\":\"a\",\"type\":\"hjym\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.assessmentProjectsOperations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("d", response.iterator().next().location()); - Assertions.assertEquals("did", response.iterator().next().tags().get("hepfwwtjfdoes")); - Assertions.assertEquals(ProvisioningState.DELETING, - response.iterator().next().properties().provisioningState()); - Assertions.assertEquals("idisczskosw", response.iterator().next().properties().assessmentSolutionId()); - Assertions.assertEquals(ProjectStatus.INACTIVE, response.iterator().next().properties().projectStatus()); - Assertions.assertEquals("azugamxzkrrcoi", response.iterator().next().properties().customerWorkspaceId()); - Assertions.assertEquals("bamnppcc", response.iterator().next().properties().customerWorkspaceLocation()); - Assertions.assertEquals("u", response.iterator().next().properties().publicNetworkAccess()); - Assertions.assertEquals("sn", response.iterator().next().properties().customerStorageAccountArmId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsDeleteWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsDeleteWithResponseMockTests.java deleted file mode 100644 index 046319f3604d..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessmentsOperationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.assessmentsOperations() - .deleteWithResponse("dqqjwkrhwzdano", "isgglmvokat", "ztjctibpvbkae", "xsmzygdf", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsDownloadUrlMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsDownloadUrlMockTests.java deleted file mode 100644 index 3b50d7d9eefe..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AssessmentsOperationsDownloadUrlMockTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AssessmentsOperationsDownloadUrlMockTests { - @Test - public void testDownloadUrl() throws Exception { - String responseStr = "{\"assessmentReportUrl\":\"vgmfalkzazmgok\",\"expirationTime\":\"2021-09-06T15:08:44Z\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - DownloadUrl response = manager.assessmentsOperations() - .downloadUrl("akw", "eivmak", "hysowljuxlkbect", "tfjmskdchmaiub", "datavlzw", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedDiskTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedDiskTests.java deleted file mode 100644 index 82966f8b7340..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedDiskTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessedDisk; - -public final class AvsAssessedDiskTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvsAssessedDisk model = BinaryData.fromString( - "{\"name\":\"uzqogsexnevf\",\"displayName\":\"wnwmewzs\",\"gigabytesProvisioned\":87.22587,\"megabytesPerSecondOfRead\":25.413382,\"megabytesPerSecondOfWrite\":66.84359,\"numberOfReadOperationsPerSecond\":4.8421144,\"numberOfWriteOperationsPerSecond\":47.16871}") - .toObject(AvsAssessedDisk.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvsAssessedDisk model = new AvsAssessedDisk(); - model = BinaryData.fromObject(model).toObject(AvsAssessedDisk.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedNetworkAdapterTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedNetworkAdapterTests.java deleted file mode 100644 index 3c3a0ffe591e..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessedNetworkAdapterTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessedNetworkAdapter; - -public final class AvsAssessedNetworkAdapterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvsAssessedNetworkAdapter model = BinaryData.fromString( - "{\"macAddress\":\"dpfrxtrthzvaytdw\",\"ipAddresses\":[\"rqubpaxhexiil\",\"vpdtiirqtdqoa\"],\"displayName\":\"r\",\"megabytesPerSecondReceived\":27.96995,\"megabytesPerSecondTransmitted\":74.71945}") - .toObject(AvsAssessedNetworkAdapter.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvsAssessedNetworkAdapter model = new AvsAssessedNetworkAdapter(); - model = BinaryData.fromObject(model).toObject(AvsAssessedNetworkAdapter.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsInnerTests.java deleted file mode 100644 index c78d0f9f3885..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsInnerTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentOptionsInner; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentOptionsProperties; -import com.azure.resourcemanager.migration.assessment.models.AvsSkuOptions; -import com.azure.resourcemanager.migration.assessment.models.AzureAvsNodeType; -import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.FttAndRaidLevel; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AvsAssessmentOptionsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvsAssessmentOptionsInner model = BinaryData.fromString( - "{\"properties\":{\"avsNodes\":[{\"nodeType\":\"AV36\",\"targetLocations\":[\"USGovIowa\",\"SouthAfricaWest\"]},{\"nodeType\":\"Unknown\",\"targetLocations\":[\"CanadaCentral\",\"EastUs2\",\"NorthEurope\",\"KoreaCentral\"]},{\"nodeType\":\"AV36\",\"targetLocations\":[\"USDoDCentral\",\"USGovVirginia\",\"GermanyNortheast\"]}],\"failuresToTolerateAndRaidLevelValues\":[\"Ftt3Raid1\"],\"reservedInstanceAvsNodes\":[\"Unknown\",\"Unknown\",\"AV36\",\"Unknown\"],\"reservedInstanceSupportedLocations\":[\"JapanWest\",\"ChinaNorth\",\"EastUs2\",\"UAECentral\"],\"reservedInstanceSupportedCurrencies\":[\"BRL\",\"ARS\"],\"reservedInstanceSupportedOffers\":[\"MSAZR0149P\",\"Unknown\"]},\"id\":\"slynqwwnc\",\"name\":\"zzhxgktrm\",\"type\":\"ucnapkteoellwp\"}") - .toObject(AvsAssessmentOptionsInner.class); - Assertions.assertEquals(AzureAvsNodeType.AV36, model.properties().avsNodes().get(0).nodeType()); - Assertions.assertEquals(AzureLocation.USGOV_IOWA, - model.properties().avsNodes().get(0).targetLocations().get(0)); - Assertions.assertEquals(FttAndRaidLevel.FTT3RAID1, - model.properties().failuresToTolerateAndRaidLevelValues().get(0)); - Assertions.assertEquals(AzureAvsNodeType.UNKNOWN, model.properties().reservedInstanceAvsNodes().get(0)); - Assertions.assertEquals(AzureLocation.JAPAN_WEST, - model.properties().reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.BRL, model.properties().reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.MSAZR0149P, model.properties().reservedInstanceSupportedOffers().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvsAssessmentOptionsInner model - = new AvsAssessmentOptionsInner().withProperties(new AvsAssessmentOptionsProperties() - .withAvsNodes(Arrays.asList( - new AvsSkuOptions().withNodeType(AzureAvsNodeType.AV36) - .withTargetLocations(Arrays.asList(AzureLocation.USGOV_IOWA, AzureLocation.SOUTH_AFRICA_WEST)), - new AvsSkuOptions().withNodeType(AzureAvsNodeType.UNKNOWN) - .withTargetLocations(Arrays.asList(AzureLocation.CANADA_CENTRAL, AzureLocation.EAST_US2, - AzureLocation.NORTH_EUROPE, AzureLocation.KOREA_CENTRAL)), - new AvsSkuOptions().withNodeType(AzureAvsNodeType.AV36) - .withTargetLocations(Arrays.asList(AzureLocation.USDO_DCENTRAL, AzureLocation.USGOV_VIRGINIA, - AzureLocation.GERMANY_NORTHEAST)))) - .withFailuresToTolerateAndRaidLevelValues(Arrays.asList(FttAndRaidLevel.FTT3RAID1)) - .withReservedInstanceAvsNodes(Arrays.asList(AzureAvsNodeType.UNKNOWN, AzureAvsNodeType.UNKNOWN, - AzureAvsNodeType.AV36, AzureAvsNodeType.UNKNOWN)) - .withReservedInstanceSupportedLocations(Arrays.asList(AzureLocation.JAPAN_WEST, - AzureLocation.CHINA_NORTH, AzureLocation.EAST_US2, AzureLocation.UAECENTRAL)) - .withReservedInstanceSupportedCurrencies(Arrays.asList(AzureCurrency.BRL, AzureCurrency.ARS)) - .withReservedInstanceSupportedOffers(Arrays.asList(AzureOfferCode.MSAZR0149P, AzureOfferCode.UNKNOWN))); - model = BinaryData.fromObject(model).toObject(AvsAssessmentOptionsInner.class); - Assertions.assertEquals(AzureAvsNodeType.AV36, model.properties().avsNodes().get(0).nodeType()); - Assertions.assertEquals(AzureLocation.USGOV_IOWA, - model.properties().avsNodes().get(0).targetLocations().get(0)); - Assertions.assertEquals(FttAndRaidLevel.FTT3RAID1, - model.properties().failuresToTolerateAndRaidLevelValues().get(0)); - Assertions.assertEquals(AzureAvsNodeType.UNKNOWN, model.properties().reservedInstanceAvsNodes().get(0)); - Assertions.assertEquals(AzureLocation.JAPAN_WEST, - model.properties().reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.BRL, model.properties().reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.MSAZR0149P, model.properties().reservedInstanceSupportedOffers().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsListResultTests.java deleted file mode 100644 index d2172db1a834..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsListResultTests.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.AvsAssessmentOptionsInner; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentOptionsListResult; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentOptionsProperties; -import com.azure.resourcemanager.migration.assessment.models.AvsSkuOptions; -import com.azure.resourcemanager.migration.assessment.models.AzureAvsNodeType; -import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.FttAndRaidLevel; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AvsAssessmentOptionsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvsAssessmentOptionsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"avsNodes\":[{\"nodeType\":\"AV36\",\"targetLocations\":[\"CanadaEast\",\"USGovTexas\",\"USGovArizona\"]},{\"nodeType\":\"AV36\",\"targetLocations\":[\"ChinaEast\"]}],\"failuresToTolerateAndRaidLevelValues\":[\"Ftt1Raid5\",\"Unknown\",\"Ftt1Raid1\",\"Ftt2Raid1\"],\"reservedInstanceAvsNodes\":[\"Unknown\"],\"reservedInstanceSupportedLocations\":[\"NorwayWest\"],\"reservedInstanceSupportedCurrencies\":[\"MXN\",\"EUR\",\"KRW\",\"MYR\"],\"reservedInstanceSupportedOffers\":[\"Unknown\"]},\"id\":\"xdjzlmwlxk\",\"name\":\"ug\",\"type\":\"hzovawjvzunlut\"},{\"properties\":{\"avsNodes\":[{\"nodeType\":\"Unknown\",\"targetLocations\":[\"USGovVirginia\"]},{\"nodeType\":\"AV36\",\"targetLocations\":[\"AustraliaEast\"]},{\"nodeType\":\"AV36\",\"targetLocations\":[\"USGovTexas\"]}],\"failuresToTolerateAndRaidLevelValues\":[\"Ftt1Raid1\",\"Ftt2Raid6\"],\"reservedInstanceAvsNodes\":[\"Unknown\",\"AV36\"],\"reservedInstanceSupportedLocations\":[\"JapanEast\",\"AustraliaEast\",\"NorthCentralUs\"],\"reservedInstanceSupportedCurrencies\":[\"SEK\"],\"reservedInstanceSupportedOffers\":[\"MSMCAZR0060P\"]},\"id\":\"pwo\",\"name\":\"uh\",\"type\":\"fpbsjyofdxl\"},{\"properties\":{\"avsNodes\":[{\"nodeType\":\"AV36\",\"targetLocations\":[\"USDoDEast\",\"SwitzerlandWest\",\"SwedenCentral\"]},{\"nodeType\":\"Unknown\",\"targetLocations\":[\"USDoDEast\",\"KoreaCentral\"]},{\"nodeType\":\"Unknown\",\"targetLocations\":[\"EastUs2\"]},{\"nodeType\":\"AV36\",\"targetLocations\":[\"JapanWest\",\"SouthAfricaWest\",\"NorthCentralUs\",\"Unknown\"]}],\"failuresToTolerateAndRaidLevelValues\":[\"Ftt3Raid1\",\"Ftt2Raid1\"],\"reservedInstanceAvsNodes\":[\"AV36\"],\"reservedInstanceSupportedLocations\":[\"USGovArizona\",\"UsSecCentral\",\"NorthEurope\",\"NorwayWest\"],\"reservedInstanceSupportedCurrencies\":[\"AUD\"],\"reservedInstanceSupportedOffers\":[\"MSAZR0022P\"]},\"id\":\"aq\",\"name\":\"slyjpkiid\",\"type\":\"yexz\"}],\"nextLink\":\"lixhnrztfol\"}") - .toObject(AvsAssessmentOptionsListResult.class); - Assertions.assertEquals(AzureAvsNodeType.AV36, model.value().get(0).properties().avsNodes().get(0).nodeType()); - Assertions.assertEquals(AzureLocation.CANADA_EAST, - model.value().get(0).properties().avsNodes().get(0).targetLocations().get(0)); - Assertions.assertEquals(FttAndRaidLevel.FTT1RAID5, - model.value().get(0).properties().failuresToTolerateAndRaidLevelValues().get(0)); - Assertions.assertEquals(AzureAvsNodeType.UNKNOWN, - model.value().get(0).properties().reservedInstanceAvsNodes().get(0)); - Assertions.assertEquals(AzureLocation.NORWAY_WEST, - model.value().get(0).properties().reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.MXN, - model.value().get(0).properties().reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.UNKNOWN, - model.value().get(0).properties().reservedInstanceSupportedOffers().get(0)); - Assertions.assertEquals("lixhnrztfol", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvsAssessmentOptionsListResult model = new AvsAssessmentOptionsListResult() - .withValue(Arrays.asList( - new AvsAssessmentOptionsInner().withProperties(new AvsAssessmentOptionsProperties() - .withAvsNodes(Arrays.asList( - new AvsSkuOptions().withNodeType(AzureAvsNodeType.AV36) - .withTargetLocations(Arrays.asList(AzureLocation.CANADA_EAST, AzureLocation.USGOV_TEXAS, - AzureLocation.USGOV_ARIZONA)), - new AvsSkuOptions().withNodeType(AzureAvsNodeType.AV36) - .withTargetLocations(Arrays.asList(AzureLocation.CHINA_EAST)))) - .withFailuresToTolerateAndRaidLevelValues(Arrays.asList(FttAndRaidLevel.FTT1RAID5, - FttAndRaidLevel.UNKNOWN, FttAndRaidLevel.FTT1RAID1, FttAndRaidLevel.FTT2RAID1)) - .withReservedInstanceAvsNodes(Arrays.asList(AzureAvsNodeType.UNKNOWN)) - .withReservedInstanceSupportedLocations(Arrays.asList(AzureLocation.NORWAY_WEST)) - .withReservedInstanceSupportedCurrencies( - Arrays.asList(AzureCurrency.MXN, AzureCurrency.EUR, AzureCurrency.KRW, AzureCurrency.MYR)) - .withReservedInstanceSupportedOffers(Arrays.asList(AzureOfferCode.UNKNOWN))), - new AvsAssessmentOptionsInner().withProperties(new AvsAssessmentOptionsProperties() - .withAvsNodes(Arrays.asList( - new AvsSkuOptions().withNodeType(AzureAvsNodeType.UNKNOWN) - .withTargetLocations(Arrays.asList(AzureLocation.USGOV_VIRGINIA)), - new AvsSkuOptions().withNodeType(AzureAvsNodeType.AV36) - .withTargetLocations(Arrays.asList(AzureLocation.AUSTRALIA_EAST)), - new AvsSkuOptions().withNodeType(AzureAvsNodeType.AV36) - .withTargetLocations(Arrays.asList(AzureLocation.USGOV_TEXAS)))) - .withFailuresToTolerateAndRaidLevelValues( - Arrays.asList(FttAndRaidLevel.FTT1RAID1, FttAndRaidLevel.FTT2RAID6)) - .withReservedInstanceAvsNodes(Arrays.asList(AzureAvsNodeType.UNKNOWN, AzureAvsNodeType.AV36)) - .withReservedInstanceSupportedLocations(Arrays - .asList(AzureLocation.JAPAN_EAST, AzureLocation.AUSTRALIA_EAST, AzureLocation.NORTH_CENTRAL_US)) - .withReservedInstanceSupportedCurrencies(Arrays.asList(AzureCurrency.SEK)) - .withReservedInstanceSupportedOffers(Arrays.asList(AzureOfferCode.MSMCAZR0060P))), - new AvsAssessmentOptionsInner().withProperties(new AvsAssessmentOptionsProperties() - .withAvsNodes(Arrays.asList( - new AvsSkuOptions().withNodeType(AzureAvsNodeType.AV36) - .withTargetLocations(Arrays.asList(AzureLocation.USDO_DEAST, AzureLocation.SWITZERLAND_WEST, - AzureLocation.SWEDEN_CENTRAL)), - new AvsSkuOptions() - .withNodeType(AzureAvsNodeType.UNKNOWN) - .withTargetLocations(Arrays.asList(AzureLocation.USDO_DEAST, AzureLocation.KOREA_CENTRAL)), - new AvsSkuOptions().withNodeType(AzureAvsNodeType.UNKNOWN) - .withTargetLocations(Arrays.asList(AzureLocation.EAST_US2)), - new AvsSkuOptions().withNodeType(AzureAvsNodeType.AV36) - .withTargetLocations( - Arrays.asList(AzureLocation.JAPAN_WEST, AzureLocation.SOUTH_AFRICA_WEST, - AzureLocation.NORTH_CENTRAL_US, AzureLocation.UNKNOWN)))) - .withFailuresToTolerateAndRaidLevelValues( - Arrays.asList(FttAndRaidLevel.FTT3RAID1, FttAndRaidLevel.FTT2RAID1)) - .withReservedInstanceAvsNodes(Arrays.asList(AzureAvsNodeType.AV36)) - .withReservedInstanceSupportedLocations(Arrays.asList(AzureLocation.USGOV_ARIZONA, - AzureLocation.US_SEC_CENTRAL, AzureLocation.NORTH_EUROPE, AzureLocation.NORWAY_WEST)) - .withReservedInstanceSupportedCurrencies(Arrays.asList(AzureCurrency.AUD)) - .withReservedInstanceSupportedOffers(Arrays.asList(AzureOfferCode.MSAZR0022P))))) - .withNextLink("lixhnrztfol"); - model = BinaryData.fromObject(model).toObject(AvsAssessmentOptionsListResult.class); - Assertions.assertEquals(AzureAvsNodeType.AV36, model.value().get(0).properties().avsNodes().get(0).nodeType()); - Assertions.assertEquals(AzureLocation.CANADA_EAST, - model.value().get(0).properties().avsNodes().get(0).targetLocations().get(0)); - Assertions.assertEquals(FttAndRaidLevel.FTT1RAID5, - model.value().get(0).properties().failuresToTolerateAndRaidLevelValues().get(0)); - Assertions.assertEquals(AzureAvsNodeType.UNKNOWN, - model.value().get(0).properties().reservedInstanceAvsNodes().get(0)); - Assertions.assertEquals(AzureLocation.NORWAY_WEST, - model.value().get(0).properties().reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.MXN, - model.value().get(0).properties().reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.UNKNOWN, - model.value().get(0).properties().reservedInstanceSupportedOffers().get(0)); - Assertions.assertEquals("lixhnrztfol", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsOperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsOperationsGetWithResponseMockTests.java deleted file mode 100644 index e216c9ce1b11..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentOptions; -import com.azure.resourcemanager.migration.assessment.models.AzureAvsNodeType; -import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.FttAndRaidLevel; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AvsAssessmentOptionsOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"avsNodes\":[{\"nodeType\":\"AV36\",\"targetLocations\":[\"USGovVirginia\",\"SouthCentralUs\",\"EastUs2\"]}],\"failuresToTolerateAndRaidLevelValues\":[\"Ftt3Raid1\"],\"reservedInstanceAvsNodes\":[\"Unknown\",\"AV36\"],\"reservedInstanceSupportedLocations\":[\"SouthAfricaWest\",\"CanadaEast\"],\"reservedInstanceSupportedCurrencies\":[\"JPY\",\"SAR\"],\"reservedInstanceSupportedOffers\":[\"MSMCAZR0044P\",\"SavingsPlan3Year\",\"MSAZR0120P\"]},\"id\":\"ko\",\"name\":\"r\",\"type\":\"awn\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - AvsAssessmentOptions response = manager.avsAssessmentOptionsOperations() - .getWithResponse("fwbivqvo", "fuy", "wvbhlimbyq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AzureAvsNodeType.AV36, response.properties().avsNodes().get(0).nodeType()); - Assertions.assertEquals(AzureLocation.USGOV_VIRGINIA, - response.properties().avsNodes().get(0).targetLocations().get(0)); - Assertions.assertEquals(FttAndRaidLevel.FTT3RAID1, - response.properties().failuresToTolerateAndRaidLevelValues().get(0)); - Assertions.assertEquals(AzureAvsNodeType.UNKNOWN, response.properties().reservedInstanceAvsNodes().get(0)); - Assertions.assertEquals(AzureLocation.SOUTH_AFRICA_WEST, - response.properties().reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.JPY, response.properties().reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.MSMCAZR0044P, - response.properties().reservedInstanceSupportedOffers().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsOperationsListByAssessmentProjectMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsOperationsListByAssessmentProjectMockTests.java deleted file mode 100644 index e52b5091b431..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsOperationsListByAssessmentProjectMockTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentOptions; -import com.azure.resourcemanager.migration.assessment.models.AzureAvsNodeType; -import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.FttAndRaidLevel; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AvsAssessmentOptionsOperationsListByAssessmentProjectMockTests { - @Test - public void testListByAssessmentProject() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"avsNodes\":[{\"nodeType\":\"AV36\",\"targetLocations\":[\"SouthAfricaNorth\",\"ChinaNorth\",\"Unknown\"]},{\"nodeType\":\"Unknown\",\"targetLocations\":[\"UsSecWest\",\"JapanWest\",\"USGovTexas\",\"UAECentral\"]},{\"nodeType\":\"AV36\",\"targetLocations\":[\"CanadaEast\",\"ChinaNorth2\",\"JapanEast\",\"EastUs2\"]},{\"nodeType\":\"AV36\",\"targetLocations\":[\"SwitzerlandNorth\",\"NorthEurope\",\"NorwayEast\",\"CanadaEast\"]}],\"failuresToTolerateAndRaidLevelValues\":[\"Ftt2Raid1\",\"Ftt2Raid1\",\"Unknown\"],\"reservedInstanceAvsNodes\":[\"AV36\"],\"reservedInstanceSupportedLocations\":[\"NorwayEast\",\"SwitzerlandWest\",\"USGovVirginia\"],\"reservedInstanceSupportedCurrencies\":[\"TWD\"],\"reservedInstanceSupportedOffers\":[\"MSMCAZR0060P\",\"MSAZR0025P\",\"MSAZR0129P\",\"MSAZR0127P\"]},\"id\":\"mfcoibic\",\"name\":\"iuswswj\",\"type\":\"kbqsjhbtqqvyfscy\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.avsAssessmentOptionsOperations() - .listByAssessmentProject("kbudbtwaokb", "vlyttaaknwfrke", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AzureAvsNodeType.AV36, - response.iterator().next().properties().avsNodes().get(0).nodeType()); - Assertions.assertEquals(AzureLocation.SOUTH_AFRICA_NORTH, - response.iterator().next().properties().avsNodes().get(0).targetLocations().get(0)); - Assertions.assertEquals(FttAndRaidLevel.FTT2RAID1, - response.iterator().next().properties().failuresToTolerateAndRaidLevelValues().get(0)); - Assertions.assertEquals(AzureAvsNodeType.AV36, - response.iterator().next().properties().reservedInstanceAvsNodes().get(0)); - Assertions.assertEquals(AzureLocation.NORWAY_EAST, - response.iterator().next().properties().reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.TWD, - response.iterator().next().properties().reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.MSMCAZR0060P, - response.iterator().next().properties().reservedInstanceSupportedOffers().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsPropertiesTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsPropertiesTests.java deleted file mode 100644 index ad00800e8f9f..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentOptionsPropertiesTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AvsAssessmentOptionsProperties; -import com.azure.resourcemanager.migration.assessment.models.AvsSkuOptions; -import com.azure.resourcemanager.migration.assessment.models.AzureAvsNodeType; -import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.FttAndRaidLevel; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AvsAssessmentOptionsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvsAssessmentOptionsProperties model = BinaryData.fromString( - "{\"avsNodes\":[{\"nodeType\":\"AV36\",\"targetLocations\":[\"SwitzerlandNorth\",\"CanadaCentral\",\"AustraliaCentral2\"]}],\"failuresToTolerateAndRaidLevelValues\":[\"Ftt2Raid6\",\"Ftt1Raid5\",\"Unknown\",\"Ftt1Raid1\"],\"reservedInstanceAvsNodes\":[\"AV36\",\"Unknown\"],\"reservedInstanceSupportedLocations\":[\"FranceSouth\",\"UsNatWest\",\"USGovVirginia\"],\"reservedInstanceSupportedCurrencies\":[\"MXN\",\"DKK\"],\"reservedInstanceSupportedOffers\":[\"Unknown\",\"MSMCAZR0059P\",\"MSAZR0125P\"]}") - .toObject(AvsAssessmentOptionsProperties.class); - Assertions.assertEquals(AzureAvsNodeType.AV36, model.avsNodes().get(0).nodeType()); - Assertions.assertEquals(AzureLocation.SWITZERLAND_NORTH, model.avsNodes().get(0).targetLocations().get(0)); - Assertions.assertEquals(FttAndRaidLevel.FTT2RAID6, model.failuresToTolerateAndRaidLevelValues().get(0)); - Assertions.assertEquals(AzureAvsNodeType.AV36, model.reservedInstanceAvsNodes().get(0)); - Assertions.assertEquals(AzureLocation.FRANCE_SOUTH, model.reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.MXN, model.reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.UNKNOWN, model.reservedInstanceSupportedOffers().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvsAssessmentOptionsProperties model = new AvsAssessmentOptionsProperties() - .withAvsNodes(Arrays.asList(new AvsSkuOptions().withNodeType(AzureAvsNodeType.AV36) - .withTargetLocations(Arrays.asList(AzureLocation.SWITZERLAND_NORTH, AzureLocation.CANADA_CENTRAL, - AzureLocation.AUSTRALIA_CENTRAL2)))) - .withFailuresToTolerateAndRaidLevelValues(Arrays.asList(FttAndRaidLevel.FTT2RAID6, - FttAndRaidLevel.FTT1RAID5, FttAndRaidLevel.UNKNOWN, FttAndRaidLevel.FTT1RAID1)) - .withReservedInstanceAvsNodes(Arrays.asList(AzureAvsNodeType.AV36, AzureAvsNodeType.UNKNOWN)) - .withReservedInstanceSupportedLocations( - Arrays.asList(AzureLocation.FRANCE_SOUTH, AzureLocation.US_NAT_WEST, AzureLocation.USGOV_VIRGINIA)) - .withReservedInstanceSupportedCurrencies(Arrays.asList(AzureCurrency.MXN, AzureCurrency.DKK)) - .withReservedInstanceSupportedOffers( - Arrays.asList(AzureOfferCode.UNKNOWN, AzureOfferCode.MSMCAZR0059P, AzureOfferCode.MSAZR0125P)); - model = BinaryData.fromObject(model).toObject(AvsAssessmentOptionsProperties.class); - Assertions.assertEquals(AzureAvsNodeType.AV36, model.avsNodes().get(0).nodeType()); - Assertions.assertEquals(AzureLocation.SWITZERLAND_NORTH, model.avsNodes().get(0).targetLocations().get(0)); - Assertions.assertEquals(FttAndRaidLevel.FTT2RAID6, model.failuresToTolerateAndRaidLevelValues().get(0)); - Assertions.assertEquals(AzureAvsNodeType.AV36, model.reservedInstanceAvsNodes().get(0)); - Assertions.assertEquals(AzureLocation.FRANCE_SOUTH, model.reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.MXN, model.reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.UNKNOWN, model.reservedInstanceSupportedOffers().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsDeleteWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsDeleteWithResponseMockTests.java deleted file mode 100644 index f530b058f80d..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AvsAssessmentsOperationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.avsAssessmentsOperations() - .deleteWithResponse("g", "wdjuxdbdljzgdy", "cvuq", "sgzlrqhb", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsDownloadUrlMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsDownloadUrlMockTests.java deleted file mode 100644 index 3b2b298ded9b..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsAssessmentsOperationsDownloadUrlMockTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AvsAssessmentsOperationsDownloadUrlMockTests { - @Test - public void testDownloadUrl() throws Exception { - String responseStr = "{\"assessmentReportUrl\":\"dzzqjmu\",\"expirationTime\":\"2021-11-30T17:24:02Z\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - DownloadUrl response = manager.avsAssessmentsOperations() - .downloadUrl("nq", "gdxwbsfpyxx", "jlf", "ecominxojjluxxd", "datailz", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsSkuOptionsTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsSkuOptionsTests.java deleted file mode 100644 index 85b8c369d5a4..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AvsSkuOptionsTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AvsSkuOptions; -import com.azure.resourcemanager.migration.assessment.models.AzureAvsNodeType; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AvsSkuOptionsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvsSkuOptions model - = BinaryData.fromString("{\"nodeType\":\"AV36\",\"targetLocations\":[\"SouthAfricaNorth\",\"WestUs2\"]}") - .toObject(AvsSkuOptions.class); - Assertions.assertEquals(AzureAvsNodeType.AV36, model.nodeType()); - Assertions.assertEquals(AzureLocation.SOUTH_AFRICA_NORTH, model.targetLocations().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvsSkuOptions model = new AvsSkuOptions().withNodeType(AzureAvsNodeType.AV36) - .withTargetLocations(Arrays.asList(AzureLocation.SOUTH_AFRICA_NORTH, AzureLocation.WEST_US2)); - model = BinaryData.fromObject(model).toObject(AvsSkuOptions.class); - Assertions.assertEquals(AzureAvsNodeType.AV36, model.nodeType()); - Assertions.assertEquals(AzureLocation.SOUTH_AFRICA_NORTH, model.targetLocations().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureManagedDiskSkuDtoTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureManagedDiskSkuDtoTests.java deleted file mode 100644 index 9d559381de0c..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureManagedDiskSkuDtoTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AzureManagedDiskSkuDto; - -public final class AzureManagedDiskSkuDtoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureManagedDiskSkuDto model = BinaryData.fromString( - "{\"diskType\":\"PremiumV2\",\"diskSize\":\"StandardSSD_E80\",\"diskRedundancy\":\"ZRS\",\"storageCost\":45.557858,\"recommendedSizeInGib\":27.858305,\"recommendedThroughputInMbps\":40.938957,\"recommendedIops\":92.67548}") - .toObject(AzureManagedDiskSkuDto.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureManagedDiskSkuDto model = new AzureManagedDiskSkuDto(); - model = BinaryData.fromObject(model).toObject(AzureManagedDiskSkuDto.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureQuorumWitnessDtoTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureQuorumWitnessDtoTests.java deleted file mode 100644 index 30c2b8332448..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureQuorumWitnessDtoTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AzureQuorumWitnessDto; - -public final class AzureQuorumWitnessDtoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureQuorumWitnessDto model - = BinaryData.fromString("{\"quorumWitnessType\":\"Unknown\"}").toObject(AzureQuorumWitnessDto.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureQuorumWitnessDto model = new AzureQuorumWitnessDto(); - model = BinaryData.fromObject(model).toObject(AzureQuorumWitnessDto.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureResourcePropertiesTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureResourcePropertiesTests.java deleted file mode 100644 index f51071f159ab..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureResourcePropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AzureResourceProperties; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import org.junit.jupiter.api.Assertions; - -public final class AzureResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureResourceProperties model - = BinaryData.fromString("{\"provisioningState\":\"Deleting\"}").toObject(AzureResourceProperties.class); - Assertions.assertEquals(ProvisioningState.DELETING, model.provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureResourceProperties model = new AzureResourceProperties().withProvisioningState(ProvisioningState.DELETING); - model = BinaryData.fromObject(model).toObject(AzureResourceProperties.class); - Assertions.assertEquals(ProvisioningState.DELETING, model.provisioningState()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureSqlIaasSkuDtoTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureSqlIaasSkuDtoTests.java deleted file mode 100644 index d24602d30ac2..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureSqlIaasSkuDtoTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlIaasSkuDto; - -public final class AzureSqlIaasSkuDtoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureSqlIaasSkuDto model = BinaryData.fromString( - "{\"virtualMachineSize\":{\"azureVmFamily\":\"Edv5_series\",\"cores\":1029083448,\"azureSkuName\":\"Standard_D2as_v5\",\"availableCores\":1218728383,\"maxNetworkInterfaces\":617532608},\"dataDiskSizes\":[{\"diskType\":\"Premium\",\"diskSize\":\"Premium_P30\",\"diskRedundancy\":\"LRS\",\"storageCost\":37.59306,\"recommendedSizeInGib\":99.90342,\"recommendedThroughputInMbps\":43.10251,\"recommendedIops\":58.430733},{\"diskType\":\"Premium\",\"diskSize\":\"StandardSSD_E6\",\"diskRedundancy\":\"Unknown\",\"storageCost\":52.928745,\"recommendedSizeInGib\":44.91767,\"recommendedThroughputInMbps\":91.69271,\"recommendedIops\":61.968582},{\"diskType\":\"Standard\",\"diskSize\":\"StandardSSD_E70\",\"diskRedundancy\":\"ZRS\",\"storageCost\":40.48493,\"recommendedSizeInGib\":90.719376,\"recommendedThroughputInMbps\":48.726143,\"recommendedIops\":45.43301}],\"logDiskSizes\":[{\"diskType\":\"PremiumV2\",\"diskSize\":\"Premium_P1\",\"diskRedundancy\":\"LRS\",\"storageCost\":47.28567,\"recommendedSizeInGib\":64.00328,\"recommendedThroughputInMbps\":63.62545,\"recommendedIops\":91.40803}],\"azureSqlTargetType\":\"AzureVirtualMachine\"}") - .toObject(AzureSqlIaasSkuDto.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureSqlIaasSkuDto model = new AzureSqlIaasSkuDto(); - model = BinaryData.fromObject(model).toObject(AzureSqlIaasSkuDto.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureSqlPaasSkuDtoTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureSqlPaasSkuDtoTests.java deleted file mode 100644 index 26466d9aa1d2..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureSqlPaasSkuDtoTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlPaasSkuDto; - -public final class AzureSqlPaasSkuDtoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureSqlPaasSkuDto model = BinaryData.fromString( - "{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlHardwareGeneration\":\"Unknown\",\"storageMaxSizeInMB\":73.21512,\"predictedDataSizeInMB\":43.510838,\"predictedLogSizeInMB\":53.732086,\"cores\":1586436941,\"azureSqlTargetType\":\"Recommended\"}") - .toObject(AzureSqlPaasSkuDto.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureSqlPaasSkuDto model = new AzureSqlPaasSkuDto(); - model = BinaryData.fromObject(model).toObject(AzureSqlPaasSkuDto.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureVirtualMachineSkuDtoTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureVirtualMachineSkuDtoTests.java deleted file mode 100644 index b32b50b99bca..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/AzureVirtualMachineSkuDtoTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AzureVirtualMachineSkuDto; - -public final class AzureVirtualMachineSkuDtoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureVirtualMachineSkuDto model = BinaryData.fromString( - "{\"azureVmFamily\":\"D_series\",\"cores\":1814498181,\"azureSkuName\":\"Standard_M64s_v2\",\"availableCores\":2136201648,\"maxNetworkInterfaces\":1242659668}") - .toObject(AzureVirtualMachineSkuDto.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureVirtualMachineSkuDto model = new AzureVirtualMachineSkuDto(); - model = BinaryData.fromObject(model).toObject(AzureVirtualMachineSkuDto.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/CollectorAgentPropertiesBaseTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/CollectorAgentPropertiesBaseTests.java deleted file mode 100644 index 55cd39987506..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/CollectorAgentPropertiesBaseTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class CollectorAgentPropertiesBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CollectorAgentPropertiesBase model = BinaryData.fromString( - "{\"id\":\"mbzmqk\",\"version\":\"tbnxwbjsid\",\"lastHeartbeatUtc\":\"2021-01-03T19:24:54Z\",\"spnDetails\":{\"authority\":\"pksokdgogew\",\"applicationId\":\"ym\",\"audience\":\"bguzozky\",\"objectId\":\"nfnzhhh\",\"tenantId\":\"smffjkutycyarnr\"}}") - .toObject(CollectorAgentPropertiesBase.class); - Assertions.assertEquals("mbzmqk", model.id()); - Assertions.assertEquals("tbnxwbjsid", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-03T19:24:54Z"), model.lastHeartbeatUtc()); - Assertions.assertEquals("pksokdgogew", model.spnDetails().authority()); - Assertions.assertEquals("ym", model.spnDetails().applicationId()); - Assertions.assertEquals("bguzozky", model.spnDetails().audience()); - Assertions.assertEquals("nfnzhhh", model.spnDetails().objectId()); - Assertions.assertEquals("smffjkutycyarnr", model.spnDetails().tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CollectorAgentPropertiesBase model = new CollectorAgentPropertiesBase().withId("mbzmqk") - .withVersion("tbnxwbjsid") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-01-03T19:24:54Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("pksokdgogew") - .withApplicationId("ym") - .withAudience("bguzozky") - .withObjectId("nfnzhhh") - .withTenantId("smffjkutycyarnr")); - model = BinaryData.fromObject(model).toObject(CollectorAgentPropertiesBase.class); - Assertions.assertEquals("mbzmqk", model.id()); - Assertions.assertEquals("tbnxwbjsid", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-03T19:24:54Z"), model.lastHeartbeatUtc()); - Assertions.assertEquals("pksokdgogew", model.spnDetails().authority()); - Assertions.assertEquals("ym", model.spnDetails().applicationId()); - Assertions.assertEquals("bguzozky", model.spnDetails().audience()); - Assertions.assertEquals("nfnzhhh", model.spnDetails().objectId()); - Assertions.assertEquals("smffjkutycyarnr", model.spnDetails().tenantId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/CollectorAgentSpnPropertiesBaseTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/CollectorAgentSpnPropertiesBaseTests.java deleted file mode 100644 index 43a2518f3343..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/CollectorAgentSpnPropertiesBaseTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import org.junit.jupiter.api.Assertions; - -public final class CollectorAgentSpnPropertiesBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CollectorAgentSpnPropertiesBase model = BinaryData.fromString( - "{\"authority\":\"hguabzoghktdp\",\"applicationId\":\"z\",\"audience\":\"oeocnhzqrott\",\"objectId\":\"cfyjzp\",\"tenantId\":\"rl\"}") - .toObject(CollectorAgentSpnPropertiesBase.class); - Assertions.assertEquals("hguabzoghktdp", model.authority()); - Assertions.assertEquals("z", model.applicationId()); - Assertions.assertEquals("oeocnhzqrott", model.audience()); - Assertions.assertEquals("cfyjzp", model.objectId()); - Assertions.assertEquals("rl", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CollectorAgentSpnPropertiesBase model = new CollectorAgentSpnPropertiesBase().withAuthority("hguabzoghktdp") - .withApplicationId("z") - .withAudience("oeocnhzqrott") - .withObjectId("cfyjzp") - .withTenantId("rl"); - model = BinaryData.fromObject(model).toObject(CollectorAgentSpnPropertiesBase.class); - Assertions.assertEquals("hguabzoghktdp", model.authority()); - Assertions.assertEquals("z", model.applicationId()); - Assertions.assertEquals("oeocnhzqrott", model.audience()); - Assertions.assertEquals("cfyjzp", model.objectId()); - Assertions.assertEquals("rl", model.tenantId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/CollectorPropertiesBaseTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/CollectorPropertiesBaseTests.java deleted file mode 100644 index 6fdd8792a3e1..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/CollectorPropertiesBaseTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import org.junit.jupiter.api.Assertions; - -public final class CollectorPropertiesBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CollectorPropertiesBase model = BinaryData.fromString( - "{\"discoverySiteId\":\"qkxrerl\",\"createdTimestamp\":\"2021-05-08T13:28:22Z\",\"updatedTimestamp\":\"2020-12-28T09:57:47Z\",\"provisioningState\":\"Failed\"}") - .toObject(CollectorPropertiesBase.class); - Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); - Assertions.assertEquals("qkxrerl", model.discoverySiteId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CollectorPropertiesBase model = new CollectorPropertiesBase().withProvisioningState(ProvisioningState.FAILED) - .withDiscoverySiteId("qkxrerl"); - model = BinaryData.fromObject(model).toObject(CollectorPropertiesBase.class); - Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); - Assertions.assertEquals("qkxrerl", model.discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/CollectorPropertiesBaseWithAgentTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/CollectorPropertiesBaseWithAgentTests.java deleted file mode 100644 index 0de32d3202d4..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/CollectorPropertiesBaseWithAgentTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class CollectorPropertiesBaseWithAgentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CollectorPropertiesBaseWithAgent model = BinaryData.fromString( - "{\"agentProperties\":{\"id\":\"ormkfqlwxldyk\",\"version\":\"sy\",\"lastHeartbeatUtc\":\"2021-08-24T12:28:36Z\",\"spnDetails\":{\"authority\":\"jpnnbmjksibjgsj\",\"applicationId\":\"xahmrnadzyqegxy\",\"audience\":\"pinbmhwbjijkgqxn\",\"objectId\":\"bkezn\",\"tenantId\":\"ujvaannggi\"}},\"discoverySiteId\":\"wkdtaawxwf\",\"createdTimestamp\":\"2021-05-27T21:19:02Z\",\"updatedTimestamp\":\"2021-08-31T11:37:22Z\",\"provisioningState\":\"Succeeded\"}") - .toObject(CollectorPropertiesBaseWithAgent.class); - Assertions.assertEquals(ProvisioningState.SUCCEEDED, model.provisioningState()); - Assertions.assertEquals("ormkfqlwxldyk", model.agentProperties().id()); - Assertions.assertEquals("sy", model.agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-24T12:28:36Z"), - model.agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("jpnnbmjksibjgsj", model.agentProperties().spnDetails().authority()); - Assertions.assertEquals("xahmrnadzyqegxy", model.agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("pinbmhwbjijkgqxn", model.agentProperties().spnDetails().audience()); - Assertions.assertEquals("bkezn", model.agentProperties().spnDetails().objectId()); - Assertions.assertEquals("ujvaannggi", model.agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("wkdtaawxwf", model.discoverySiteId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CollectorPropertiesBaseWithAgent model - = new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.SUCCEEDED) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("ormkfqlwxldyk") - .withVersion("sy") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-08-24T12:28:36Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("jpnnbmjksibjgsj") - .withApplicationId("xahmrnadzyqegxy") - .withAudience("pinbmhwbjijkgqxn") - .withObjectId("bkezn") - .withTenantId("ujvaannggi"))) - .withDiscoverySiteId("wkdtaawxwf"); - model = BinaryData.fromObject(model).toObject(CollectorPropertiesBaseWithAgent.class); - Assertions.assertEquals(ProvisioningState.SUCCEEDED, model.provisioningState()); - Assertions.assertEquals("ormkfqlwxldyk", model.agentProperties().id()); - Assertions.assertEquals("sy", model.agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-24T12:28:36Z"), - model.agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("jpnnbmjksibjgsj", model.agentProperties().spnDetails().authority()); - Assertions.assertEquals("xahmrnadzyqegxy", model.agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("pinbmhwbjijkgqxn", model.agentProperties().spnDetails().audience()); - Assertions.assertEquals("bkezn", model.agentProperties().spnDetails().objectId()); - Assertions.assertEquals("ujvaannggi", model.agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("wkdtaawxwf", model.discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/CostComponentTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/CostComponentTests.java deleted file mode 100644 index 4a6f1a0b1cb5..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/CostComponentTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.CostComponent; -import org.junit.jupiter.api.Assertions; - -public final class CostComponentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CostComponent model = BinaryData - .fromString("{\"name\":\"MonthlySecurityCost\",\"value\":2.368176,\"description\":\"hykojoxafnndlpic\"}") - .toObject(CostComponent.class); - Assertions.assertEquals(2.368176F, model.value()); - Assertions.assertEquals("hykojoxafnndlpic", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CostComponent model = new CostComponent().withValue(2.368176F).withDescription("hykojoxafnndlpic"); - model = BinaryData.fromObject(model).toObject(CostComponent.class); - Assertions.assertEquals(2.368176F, model.value()); - Assertions.assertEquals("hykojoxafnndlpic", model.description()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/DiskTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/DiskTests.java deleted file mode 100644 index f23e8a763854..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/DiskTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.Disk; - -public final class DiskTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Disk model = BinaryData.fromString("{\"gigabytesAllocated\":99.23195,\"displayName\":\"wwnlzafwxudgnh\"}") - .toObject(Disk.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Disk model = new Disk(); - model = BinaryData.fromObject(model).toObject(Disk.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/DownloadUrlInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/DownloadUrlInnerTests.java deleted file mode 100644 index 51497a393fd9..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/DownloadUrlInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.DownloadUrlInner; - -public final class DownloadUrlInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DownloadUrlInner model - = BinaryData.fromString("{\"assessmentReportUrl\":\"h\",\"expirationTime\":\"2021-07-08T09:31:36Z\"}") - .toObject(DownloadUrlInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DownloadUrlInner model = new DownloadUrlInner(); - model = BinaryData.fromObject(model).toObject(DownloadUrlInner.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/EntityUptimeTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/EntityUptimeTests.java deleted file mode 100644 index a3adde0bbcdd..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/EntityUptimeTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.EntityUptime; -import org.junit.jupiter.api.Assertions; - -public final class EntityUptimeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EntityUptime model = BinaryData.fromString("{\"daysPerMonth\":887664704,\"hoursPerDay\":354248500}") - .toObject(EntityUptime.class); - Assertions.assertEquals(887664704, model.daysPerMonth()); - Assertions.assertEquals(354248500, model.hoursPerDay()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EntityUptime model = new EntityUptime().withDaysPerMonth(887664704).withHoursPerDay(354248500); - model = BinaryData.fromObject(model).toObject(EntityUptime.class); - Assertions.assertEquals(887664704, model.daysPerMonth()); - Assertions.assertEquals(354248500, model.hoursPerDay()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ErrorSummaryTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ErrorSummaryTests.java deleted file mode 100644 index fed7c01815cb..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ErrorSummaryTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.ErrorSummary; - -public final class ErrorSummaryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ErrorSummary model = BinaryData.fromString("{\"assessmentType\":\"MachineAssessment\",\"count\":877780052}") - .toObject(ErrorSummary.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ErrorSummary model = new ErrorSummary(); - model = BinaryData.fromObject(model).toObject(ErrorSummary.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupBodyPropertiesTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupBodyPropertiesTests.java deleted file mode 100644 index da1314138147..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupBodyPropertiesTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.GroupBodyProperties; -import com.azure.resourcemanager.migration.assessment.models.GroupUpdateOperation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class GroupBodyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupBodyProperties model - = BinaryData.fromString("{\"operationType\":\"Remove\",\"machines\":[\"pmvssehaep\"]}") - .toObject(GroupBodyProperties.class); - Assertions.assertEquals(GroupUpdateOperation.REMOVE, model.operationType()); - Assertions.assertEquals("pmvssehaep", model.machines().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupBodyProperties model = new GroupBodyProperties().withOperationType(GroupUpdateOperation.REMOVE) - .withMachines(Arrays.asList("pmvssehaep")); - model = BinaryData.fromObject(model).toObject(GroupBodyProperties.class); - Assertions.assertEquals(GroupUpdateOperation.REMOVE, model.operationType()); - Assertions.assertEquals("pmvssehaep", model.machines().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupInnerTests.java deleted file mode 100644 index 88b701755dfc..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupInnerTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.GroupInner; -import com.azure.resourcemanager.migration.assessment.models.AssessmentType; -import com.azure.resourcemanager.migration.assessment.models.GroupProperties; -import com.azure.resourcemanager.migration.assessment.models.GroupType; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class GroupInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupInner model = BinaryData.fromString( - "{\"properties\":{\"groupStatus\":\"Updated\",\"machineCount\":655886827,\"assessments\":[\"cgjbirxbp\",\"bsrfbj\",\"dtws\"],\"supportedAssessmentTypes\":[\"Unknown\"],\"areAssessmentsRunning\":false,\"createdTimestamp\":\"2021-01-31T07:10:37Z\",\"updatedTimestamp\":\"2021-12-05T15:12:17Z\",\"groupType\":\"Default\",\"provisioningState\":\"Failed\"},\"id\":\"znfqqnvwpmqtar\",\"name\":\"oujmkcjhwqytj\",\"type\":\"ybn\"}") - .toObject(GroupInner.class); - Assertions.assertEquals(ProvisioningState.FAILED, model.properties().provisioningState()); - Assertions.assertEquals(AssessmentType.UNKNOWN, model.properties().supportedAssessmentTypes().get(0)); - Assertions.assertEquals(GroupType.DEFAULT, model.properties().groupType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupInner model - = new GroupInner().withProperties(new GroupProperties().withProvisioningState(ProvisioningState.FAILED) - .withSupportedAssessmentTypes(Arrays.asList(AssessmentType.UNKNOWN)) - .withGroupType(GroupType.DEFAULT)); - model = BinaryData.fromObject(model).toObject(GroupInner.class); - Assertions.assertEquals(ProvisioningState.FAILED, model.properties().provisioningState()); - Assertions.assertEquals(AssessmentType.UNKNOWN, model.properties().supportedAssessmentTypes().get(0)); - Assertions.assertEquals(GroupType.DEFAULT, model.properties().groupType()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupListResultTests.java deleted file mode 100644 index 7bd0dc1766a2..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupListResultTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.GroupInner; -import com.azure.resourcemanager.migration.assessment.models.AssessmentType; -import com.azure.resourcemanager.migration.assessment.models.GroupListResult; -import com.azure.resourcemanager.migration.assessment.models.GroupProperties; -import com.azure.resourcemanager.migration.assessment.models.GroupType; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class GroupListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupStatus\":\"Invalid\",\"machineCount\":1172989545,\"assessments\":[\"moizpos\",\"mgrcfbu\",\"rmfqjhhkxbpvj\"],\"supportedAssessmentTypes\":[\"MachineAssessment\",\"AvsAssessment\"],\"areAssessmentsRunning\":false,\"createdTimestamp\":\"2021-02-21T04:56:22Z\",\"updatedTimestamp\":\"2021-02-07T09:11:24Z\",\"groupType\":\"Default\",\"provisioningState\":\"Succeeded\"},\"id\":\"tswb\",\"name\":\"qzvszjf\",\"type\":\"uvjfdxxive\"},{\"properties\":{\"groupStatus\":\"Running\",\"machineCount\":393815457,\"assessments\":[\"doqmcbxvwvxys\"],\"supportedAssessmentTypes\":[\"SqlAssessment\",\"MachineAssessment\"],\"areAssessmentsRunning\":true,\"createdTimestamp\":\"2021-01-17T13:22:14Z\",\"updatedTimestamp\":\"2021-08-05T08:56:45Z\",\"groupType\":\"Default\",\"provisioningState\":\"Canceled\"},\"id\":\"pe\",\"name\":\"wwfbkrvrnsvshq\",\"type\":\"ohxcrsbfova\"}],\"nextLink\":\"ruvw\"}") - .toObject(GroupListResult.class); - Assertions.assertEquals(ProvisioningState.SUCCEEDED, model.value().get(0).properties().provisioningState()); - Assertions.assertEquals(AssessmentType.MACHINE_ASSESSMENT, - model.value().get(0).properties().supportedAssessmentTypes().get(0)); - Assertions.assertEquals(GroupType.DEFAULT, model.value().get(0).properties().groupType()); - Assertions.assertEquals("ruvw", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupListResult model = new GroupListResult().withValue(Arrays.asList( - new GroupInner().withProperties(new GroupProperties().withProvisioningState(ProvisioningState.SUCCEEDED) - .withSupportedAssessmentTypes( - Arrays.asList(AssessmentType.MACHINE_ASSESSMENT, AssessmentType.AVS_ASSESSMENT)) - .withGroupType(GroupType.DEFAULT)), - new GroupInner().withProperties(new GroupProperties().withProvisioningState(ProvisioningState.CANCELED) - .withSupportedAssessmentTypes( - Arrays.asList(AssessmentType.SQL_ASSESSMENT, AssessmentType.MACHINE_ASSESSMENT)) - .withGroupType(GroupType.DEFAULT)))) - .withNextLink("ruvw"); - model = BinaryData.fromObject(model).toObject(GroupListResult.class); - Assertions.assertEquals(ProvisioningState.SUCCEEDED, model.value().get(0).properties().provisioningState()); - Assertions.assertEquals(AssessmentType.MACHINE_ASSESSMENT, - model.value().get(0).properties().supportedAssessmentTypes().get(0)); - Assertions.assertEquals(GroupType.DEFAULT, model.value().get(0).properties().groupType()); - Assertions.assertEquals("ruvw", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupPropertiesTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupPropertiesTests.java deleted file mode 100644 index 694622f851fd..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupPropertiesTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AssessmentType; -import com.azure.resourcemanager.migration.assessment.models.GroupProperties; -import com.azure.resourcemanager.migration.assessment.models.GroupType; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class GroupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupProperties model = BinaryData.fromString( - "{\"groupStatus\":\"Created\",\"machineCount\":1598094804,\"assessments\":[\"jervnaenqpehi\",\"doy\"],\"supportedAssessmentTypes\":[\"Unknown\",\"MachineAssessment\"],\"areAssessmentsRunning\":true,\"createdTimestamp\":\"2021-02-11T01:14:35Z\",\"updatedTimestamp\":\"2021-02-21T18:42:47Z\",\"groupType\":\"Default\",\"provisioningState\":\"Accepted\"}") - .toObject(GroupProperties.class); - Assertions.assertEquals(ProvisioningState.ACCEPTED, model.provisioningState()); - Assertions.assertEquals(AssessmentType.UNKNOWN, model.supportedAssessmentTypes().get(0)); - Assertions.assertEquals(GroupType.DEFAULT, model.groupType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupProperties model = new GroupProperties().withProvisioningState(ProvisioningState.ACCEPTED) - .withSupportedAssessmentTypes(Arrays.asList(AssessmentType.UNKNOWN, AssessmentType.MACHINE_ASSESSMENT)) - .withGroupType(GroupType.DEFAULT); - model = BinaryData.fromObject(model).toObject(GroupProperties.class); - Assertions.assertEquals(ProvisioningState.ACCEPTED, model.provisioningState()); - Assertions.assertEquals(AssessmentType.UNKNOWN, model.supportedAssessmentTypes().get(0)); - Assertions.assertEquals(GroupType.DEFAULT, model.groupType()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsCreateMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsCreateMockTests.java deleted file mode 100644 index f2d05b0f95de..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsCreateMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessmentType; -import com.azure.resourcemanager.migration.assessment.models.Group; -import com.azure.resourcemanager.migration.assessment.models.GroupProperties; -import com.azure.resourcemanager.migration.assessment.models.GroupType; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupsOperationsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"groupStatus\":\"Running\",\"machineCount\":1655801360,\"assessments\":[\"lbvgwzsf\",\"tedousnktjtgrava\",\"ogfkbebauzlqb\",\"xxw\"],\"supportedAssessmentTypes\":[\"AvsAssessment\"],\"areAssessmentsRunning\":false,\"createdTimestamp\":\"2021-04-25T18:33:04Z\",\"updatedTimestamp\":\"2021-07-31T04:59:21Z\",\"groupType\":\"Default\",\"provisioningState\":\"Succeeded\"},\"id\":\"eboywhczzqrhm\",\"name\":\"gqbedygi\",\"type\":\"rzwnyk\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - Group response = manager.groupsOperations() - .define("gazlsvbz") - .withExistingAssessmentProject("csklhsidsjt", "lpbnin") - .withProperties(new GroupProperties().withProvisioningState(ProvisioningState.SUCCEEDED) - .withSupportedAssessmentTypes( - Arrays.asList(AssessmentType.WEB_APP_ASSESSMENT, AssessmentType.WEB_APP_ASSESSMENT)) - .withGroupType(GroupType.DEFAULT)) - .create(); - - Assertions.assertEquals(ProvisioningState.SUCCEEDED, response.properties().provisioningState()); - Assertions.assertEquals(AssessmentType.AVS_ASSESSMENT, response.properties().supportedAssessmentTypes().get(0)); - Assertions.assertEquals(GroupType.DEFAULT, response.properties().groupType()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsDeleteWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsDeleteWithResponseMockTests.java deleted file mode 100644 index f33e47dc5054..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupsOperationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.groupsOperations() - .deleteWithResponse("chlutixmqru", "jizcbfzmcrunfhiu", "nmfbc", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsGetWithResponseMockTests.java deleted file mode 100644 index 36028fc516fb..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessmentType; -import com.azure.resourcemanager.migration.assessment.models.Group; -import com.azure.resourcemanager.migration.assessment.models.GroupType; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupsOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupStatus\":\"Completed\",\"machineCount\":102893037,\"assessments\":[\"iprnzcalincry\",\"xzxaqzibmqimiym\",\"ruqg\"],\"supportedAssessmentTypes\":[\"SqlAssessment\",\"WebAppAssessment\",\"MachineAssessment\"],\"areAssessmentsRunning\":true,\"createdTimestamp\":\"2021-09-25T07:34:08Z\",\"updatedTimestamp\":\"2021-01-30T09:52:55Z\",\"groupType\":\"Default\",\"provisioningState\":\"Deleting\"},\"id\":\"flanfkgxsyao\",\"name\":\"uzowpuohdkcpr\",\"type\":\"ukxrzti\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - Group response = manager.groupsOperations() - .getWithResponse("fcmfcn", "jajqmatxjt", "elnzqgxxgfbbmt", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ProvisioningState.DELETING, response.properties().provisioningState()); - Assertions.assertEquals(AssessmentType.SQL_ASSESSMENT, response.properties().supportedAssessmentTypes().get(0)); - Assertions.assertEquals(GroupType.DEFAULT, response.properties().groupType()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsListByAssessmentProjectMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsListByAssessmentProjectMockTests.java deleted file mode 100644 index 3e48d64884fd..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsListByAssessmentProjectMockTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessmentType; -import com.azure.resourcemanager.migration.assessment.models.Group; -import com.azure.resourcemanager.migration.assessment.models.GroupType; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupsOperationsListByAssessmentProjectMockTests { - @Test - public void testListByAssessmentProject() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupStatus\":\"Completed\",\"machineCount\":1660222132,\"assessments\":[\"abjqqaxuyvymcnud\",\"doabhj\"],\"supportedAssessmentTypes\":[\"MachineAssessment\",\"Unknown\"],\"areAssessmentsRunning\":false,\"createdTimestamp\":\"2021-05-22T15:15:36Z\",\"updatedTimestamp\":\"2021-05-10T02:13:14Z\",\"groupType\":\"Import\",\"provisioningState\":\"Canceled\"},\"id\":\"tnsqxtlt\",\"name\":\"lkrdpqgfhy\",\"type\":\"frakkldgrc\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.groupsOperations().listByAssessmentProject("zm", "n", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ProvisioningState.CANCELED, - response.iterator().next().properties().provisioningState()); - Assertions.assertEquals(AssessmentType.MACHINE_ASSESSMENT, - response.iterator().next().properties().supportedAssessmentTypes().get(0)); - Assertions.assertEquals(GroupType.IMPORT, response.iterator().next().properties().groupType()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsUpdateMachinesMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsUpdateMachinesMockTests.java deleted file mode 100644 index eab4ea734d25..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/GroupsOperationsUpdateMachinesMockTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AssessmentType; -import com.azure.resourcemanager.migration.assessment.models.Group; -import com.azure.resourcemanager.migration.assessment.models.GroupBodyProperties; -import com.azure.resourcemanager.migration.assessment.models.GroupType; -import com.azure.resourcemanager.migration.assessment.models.GroupUpdateOperation; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.UpdateGroupBody; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupsOperationsUpdateMachinesMockTests { - @Test - public void testUpdateMachines() throws Exception { - String responseStr - = "{\"properties\":{\"groupStatus\":\"Invalid\",\"machineCount\":2066098356,\"assessments\":[\"ulndhzyoeo\",\"ht\",\"llhsvidmyt\",\"l\"],\"supportedAssessmentTypes\":[\"MachineAssessment\",\"Unknown\",\"WebAppAssessment\"],\"areAssessmentsRunning\":true,\"createdTimestamp\":\"2021-03-05T10:18:22Z\",\"updatedTimestamp\":\"2020-12-23T04:34:54Z\",\"groupType\":\"Import\",\"provisioningState\":\"Succeeded\"},\"id\":\"qagywvtxig\",\"name\":\"jrktpgaeukya\",\"type\":\"ohpmwhqn\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - Group response = manager.groupsOperations() - .updateMachines("aqktkrumzu", "dkyzbfvxov", "kxiuxqggvqr", - new UpdateGroupBody().withEtag("yhlwcjsqg") - .withProperties(new GroupBodyProperties().withOperationType(GroupUpdateOperation.REMOVE) - .withMachines(Arrays.asList("xrqrkijpeuqlsd", "eqztvxwmwwm", "swenawwa"))), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ProvisioningState.SUCCEEDED, response.properties().provisioningState()); - Assertions.assertEquals(AssessmentType.MACHINE_ASSESSMENT, - response.properties().supportedAssessmentTypes().get(0)); - Assertions.assertEquals(GroupType.IMPORT, response.properties().groupType()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorInnerTests.java deleted file mode 100644 index fda66d24d6c5..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorInnerTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.HypervCollectorInner; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class HypervCollectorInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HypervCollectorInner model = BinaryData.fromString( - "{\"properties\":{\"agentProperties\":{\"id\":\"qwodiffjx\",\"version\":\"rmmuabwibvjo\",\"lastHeartbeatUtc\":\"2021-01-05T12:54:17Z\",\"spnDetails\":{\"authority\":\"cyefoyzbamwine\",\"applicationId\":\"vfkakpold\",\"audience\":\"evboclzhzjknyuxg\",\"objectId\":\"txpnrupza\",\"tenantId\":\"rdixt\"}},\"discoverySiteId\":\"kidswys\",\"createdTimestamp\":\"2021-08-12T20:46:57Z\",\"updatedTimestamp\":\"2021-04-18T19:34:30Z\",\"provisioningState\":\"Accepted\"},\"id\":\"lukkutvlxhrpqhvm\",\"name\":\"lcouqehbhbcdszir\",\"type\":\"randoypmb\"}") - .toObject(HypervCollectorInner.class); - Assertions.assertEquals(ProvisioningState.ACCEPTED, model.properties().provisioningState()); - Assertions.assertEquals("qwodiffjx", model.properties().agentProperties().id()); - Assertions.assertEquals("rmmuabwibvjo", model.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-05T12:54:17Z"), - model.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("cyefoyzbamwine", model.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("vfkakpold", model.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("evboclzhzjknyuxg", model.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("txpnrupza", model.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("rdixt", model.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("kidswys", model.properties().discoverySiteId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HypervCollectorInner model = new HypervCollectorInner() - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.ACCEPTED) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("qwodiffjx") - .withVersion("rmmuabwibvjo") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-01-05T12:54:17Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("cyefoyzbamwine") - .withApplicationId("vfkakpold") - .withAudience("evboclzhzjknyuxg") - .withObjectId("txpnrupza") - .withTenantId("rdixt"))) - .withDiscoverySiteId("kidswys")); - model = BinaryData.fromObject(model).toObject(HypervCollectorInner.class); - Assertions.assertEquals(ProvisioningState.ACCEPTED, model.properties().provisioningState()); - Assertions.assertEquals("qwodiffjx", model.properties().agentProperties().id()); - Assertions.assertEquals("rmmuabwibvjo", model.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-05T12:54:17Z"), - model.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("cyefoyzbamwine", model.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("vfkakpold", model.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("evboclzhzjknyuxg", model.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("txpnrupza", model.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("rdixt", model.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("kidswys", model.properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorListResultTests.java deleted file mode 100644 index 54bb91b2c625..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorListResultTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.HypervCollectorInner; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.HypervCollectorListResult; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class HypervCollectorListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HypervCollectorListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"agentProperties\":{\"id\":\"tczhupeuknijd\",\"version\":\"yespydjfbocyv\",\"lastHeartbeatUtc\":\"2021-02-09T06:15:43Z\",\"spnDetails\":{\"authority\":\"tywikd\",\"applicationId\":\"lakuflgbhgauacd\",\"audience\":\"mxu\",\"objectId\":\"sryjqgdkfno\",\"tenantId\":\"eoqbvjhvefgwbmqj\"}},\"discoverySiteId\":\"ntasfaymxbu\",\"createdTimestamp\":\"2021-06-23T05:18:51Z\",\"updatedTimestamp\":\"2021-04-19T02:13:28Z\",\"provisioningState\":\"Accepted\"},\"id\":\"qkyojwyvf\",\"name\":\"mbtsuahxsg\",\"type\":\"jcmmzrrscub\"}],\"nextLink\":\"sd\"}") - .toObject(HypervCollectorListResult.class); - Assertions.assertEquals(ProvisioningState.ACCEPTED, model.value().get(0).properties().provisioningState()); - Assertions.assertEquals("tczhupeuknijd", model.value().get(0).properties().agentProperties().id()); - Assertions.assertEquals("yespydjfbocyv", model.value().get(0).properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-09T06:15:43Z"), - model.value().get(0).properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("tywikd", model.value().get(0).properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("lakuflgbhgauacd", - model.value().get(0).properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("mxu", model.value().get(0).properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("sryjqgdkfno", - model.value().get(0).properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("eoqbvjhvefgwbmqj", - model.value().get(0).properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("ntasfaymxbu", model.value().get(0).properties().discoverySiteId()); - Assertions.assertEquals("sd", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HypervCollectorListResult model - = new HypervCollectorListResult().withValue(Arrays.asList(new HypervCollectorInner() - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.ACCEPTED) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("tczhupeuknijd") - .withVersion("yespydjfbocyv") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-02-09T06:15:43Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("tywikd") - .withApplicationId("lakuflgbhgauacd") - .withAudience("mxu") - .withObjectId("sryjqgdkfno") - .withTenantId("eoqbvjhvefgwbmqj"))) - .withDiscoverySiteId("ntasfaymxbu")))) - .withNextLink("sd"); - model = BinaryData.fromObject(model).toObject(HypervCollectorListResult.class); - Assertions.assertEquals(ProvisioningState.ACCEPTED, model.value().get(0).properties().provisioningState()); - Assertions.assertEquals("tczhupeuknijd", model.value().get(0).properties().agentProperties().id()); - Assertions.assertEquals("yespydjfbocyv", model.value().get(0).properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-09T06:15:43Z"), - model.value().get(0).properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("tywikd", model.value().get(0).properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("lakuflgbhgauacd", - model.value().get(0).properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("mxu", model.value().get(0).properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("sryjqgdkfno", - model.value().get(0).properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("eoqbvjhvefgwbmqj", - model.value().get(0).properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("ntasfaymxbu", model.value().get(0).properties().discoverySiteId()); - Assertions.assertEquals("sd", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsCreateMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsCreateMockTests.java deleted file mode 100644 index 56d4773fd6d7..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsCreateMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.HypervCollector; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class HypervCollectorsOperationsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"agentProperties\":{\"id\":\"mnoiicsudy\",\"version\":\"rjjtalxrdsjrho\",\"lastHeartbeatUtc\":\"2021-12-05T02:21:08Z\",\"spnDetails\":{\"authority\":\"usxxhdodpjwybl\",\"applicationId\":\"bdmvsby\",\"audience\":\"aelqpvekmkwjf\",\"objectId\":\"tlo\",\"tenantId\":\"dusxurs\"}},\"discoverySiteId\":\"v\",\"createdTimestamp\":\"2021-08-13T13:47:43Z\",\"updatedTimestamp\":\"2021-06-18T04:59:27Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"w\",\"name\":\"z\",\"type\":\"yiqrizf\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - HypervCollector response = manager.hypervCollectorsOperations() - .define("mbtple") - .withExistingAssessmentProject("vrdmvxyrxdh", "vqojbxaotcgbz") - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.SUCCEEDED) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("yidoxznvg") - .withVersion("tmuuvdawsx") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-02-17T03:12:37Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("knimxlp") - .withApplicationId("rxrzutylcur") - .withAudience("q") - .withObjectId("b") - .withTenantId("aehtd"))) - .withDiscoverySiteId("mbnvynfaooeacted")) - .create(); - - Assertions.assertEquals(ProvisioningState.SUCCEEDED, response.properties().provisioningState()); - Assertions.assertEquals("mnoiicsudy", response.properties().agentProperties().id()); - Assertions.assertEquals("rjjtalxrdsjrho", response.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-05T02:21:08Z"), - response.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("usxxhdodpjwybl", response.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("bdmvsby", response.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("aelqpvekmkwjf", response.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("tlo", response.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("dusxurs", response.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("v", response.properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsDeleteWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsDeleteWithResponseMockTests.java deleted file mode 100644 index 4debaa0a3177..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class HypervCollectorsOperationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.hypervCollectorsOperations() - .deleteWithResponse("y", "pnml", "iqcpszpmcvq", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsGetWithResponseMockTests.java deleted file mode 100644 index 93300230835a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.HypervCollector; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class HypervCollectorsOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"agentProperties\":{\"id\":\"piilhvtozy\",\"version\":\"jjnxkby\",\"lastHeartbeatUtc\":\"2021-08-02T23:43:07Z\",\"spnDetails\":{\"authority\":\"gffklvqzr\",\"applicationId\":\"rdgscnvqeonsgn\",\"audience\":\"lwmezyohxpthceop\",\"objectId\":\"vtwfvesobpbokhm\",\"tenantId\":\"cdyarnggcjfwblqh\"}},\"discoverySiteId\":\"asmcolmugpyvaos\",\"createdTimestamp\":\"2021-10-04T02:15:18Z\",\"updatedTimestamp\":\"2021-09-24T23:31:20Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"ygz\",\"name\":\"tyevjhu\",\"type\":\"nobguqisqsqkpdmi\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - HypervCollector response = manager.hypervCollectorsOperations() - .getWithResponse("ermhzicsbfdjhyaa", "nyukibx", "glhphzwx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ProvisioningState.PROVISIONING, response.properties().provisioningState()); - Assertions.assertEquals("piilhvtozy", response.properties().agentProperties().id()); - Assertions.assertEquals("jjnxkby", response.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-02T23:43:07Z"), - response.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("gffklvqzr", response.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("rdgscnvqeonsgn", response.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("lwmezyohxpthceop", response.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("vtwfvesobpbokhm", response.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("cdyarnggcjfwblqh", response.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("asmcolmugpyvaos", response.properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsListByAssessmentProjectMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsListByAssessmentProjectMockTests.java deleted file mode 100644 index 4772b5745225..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/HypervCollectorsOperationsListByAssessmentProjectMockTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.HypervCollector; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class HypervCollectorsOperationsListByAssessmentProjectMockTests { - @Test - public void testListByAssessmentProject() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"agentProperties\":{\"id\":\"tiklsm\",\"version\":\"hql\",\"lastHeartbeatUtc\":\"2021-11-24T07:26Z\",\"spnDetails\":{\"authority\":\"yiibh\",\"applicationId\":\"wbgbudav\",\"audience\":\"orbccqcdhth\",\"objectId\":\"vlirknuc\",\"tenantId\":\"awrdt\"}},\"discoverySiteId\":\"gzlgpyaixihz\",\"createdTimestamp\":\"2021-01-21T19:40:51Z\",\"updatedTimestamp\":\"2021-04-15T12:59:29Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"dqftt\",\"name\":\"acybdueurgmcdcpk\",\"type\":\"hlo\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.hypervCollectorsOperations() - .listByAssessmentProject("x", "tzo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ProvisioningState.PROVISIONING, - response.iterator().next().properties().provisioningState()); - Assertions.assertEquals("tiklsm", response.iterator().next().properties().agentProperties().id()); - Assertions.assertEquals("hql", response.iterator().next().properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-24T07:26Z"), - response.iterator().next().properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("yiibh", - response.iterator().next().properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("wbgbudav", - response.iterator().next().properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("orbccqcdhth", - response.iterator().next().properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("vlirknuc", - response.iterator().next().properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("awrdt", - response.iterator().next().properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("gzlgpyaixihz", response.iterator().next().properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImpactedAssessmentObjectTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImpactedAssessmentObjectTests.java deleted file mode 100644 index 90b49dbcffdf..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImpactedAssessmentObjectTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.ImpactedAssessmentObject; - -public final class ImpactedAssessmentObjectTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImpactedAssessmentObject model - = BinaryData.fromString("{\"objectName\":\"utpwoqhihejqgw\",\"objectType\":\"nfqn\"}") - .toObject(ImpactedAssessmentObject.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImpactedAssessmentObject model = new ImpactedAssessmentObject(); - model = BinaryData.fromObject(model).toObject(ImpactedAssessmentObject.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorInnerTests.java deleted file mode 100644 index 3c012800a936..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorInnerTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.ImportCollectorInner; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import org.junit.jupiter.api.Assertions; - -public final class ImportCollectorInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImportCollectorInner model = BinaryData.fromString( - "{\"properties\":{\"discoverySiteId\":\"qxuwyvca\",\"createdTimestamp\":\"2021-10-26T05:34:42Z\",\"updatedTimestamp\":\"2021-06-20T08:40:01Z\",\"provisioningState\":\"Failed\"},\"id\":\"izus\",\"name\":\"szlbscm\",\"type\":\"lzijiufehgmvflnw\"}") - .toObject(ImportCollectorInner.class); - Assertions.assertEquals(ProvisioningState.FAILED, model.properties().provisioningState()); - Assertions.assertEquals("qxuwyvca", model.properties().discoverySiteId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImportCollectorInner model = new ImportCollectorInner() - .withProperties(new CollectorPropertiesBase().withProvisioningState(ProvisioningState.FAILED) - .withDiscoverySiteId("qxuwyvca")); - model = BinaryData.fromObject(model).toObject(ImportCollectorInner.class); - Assertions.assertEquals(ProvisioningState.FAILED, model.properties().provisioningState()); - Assertions.assertEquals("qxuwyvca", model.properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorListResultTests.java deleted file mode 100644 index 5d587c8f1f78..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorListResultTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.ImportCollectorInner; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.ImportCollectorListResult; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImportCollectorListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImportCollectorListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"discoverySiteId\":\"qinfszpyglqd\",\"createdTimestamp\":\"2021-05-07T12:56:20Z\",\"updatedTimestamp\":\"2021-02-04T21:16:01Z\",\"provisioningState\":\"Canceled\"},\"id\":\"cxpjbyypsj\",\"name\":\"qcjenkyhf\",\"type\":\"zv\"}],\"nextLink\":\"xfxjelgcmpzqj\"}") - .toObject(ImportCollectorListResult.class); - Assertions.assertEquals(ProvisioningState.CANCELED, model.value().get(0).properties().provisioningState()); - Assertions.assertEquals("qinfszpyglqd", model.value().get(0).properties().discoverySiteId()); - Assertions.assertEquals("xfxjelgcmpzqj", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImportCollectorListResult model - = new ImportCollectorListResult().withValue(Arrays.asList(new ImportCollectorInner() - .withProperties(new CollectorPropertiesBase().withProvisioningState(ProvisioningState.CANCELED) - .withDiscoverySiteId("qinfszpyglqd")))) - .withNextLink("xfxjelgcmpzqj"); - model = BinaryData.fromObject(model).toObject(ImportCollectorListResult.class); - Assertions.assertEquals(ProvisioningState.CANCELED, model.value().get(0).properties().provisioningState()); - Assertions.assertEquals("qinfszpyglqd", model.value().get(0).properties().discoverySiteId()); - Assertions.assertEquals("xfxjelgcmpzqj", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsCreateMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsCreateMockTests.java deleted file mode 100644 index 2ae61e13c6d7..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsCreateMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.ImportCollector; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ImportCollectorsOperationsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"discoverySiteId\":\"nhrkmjqncfvdsc\",\"createdTimestamp\":\"2021-05-03T16:49:37Z\",\"updatedTimestamp\":\"2021-03-27T04:54:32Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"qqwypvn\",\"name\":\"r\",\"type\":\"b\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - ImportCollector response = manager.importCollectorsOperations() - .define("fvezefk") - .withExistingAssessmentProject("aqjmkgxqwque", "uylztpziizevjyk") - .withProperties(new CollectorPropertiesBase().withProvisioningState(ProvisioningState.UPDATING) - .withDiscoverySiteId("twql")) - .create(); - - Assertions.assertEquals(ProvisioningState.SUCCEEDED, response.properties().provisioningState()); - Assertions.assertEquals("nhrkmjqncfvdsc", response.properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsDeleteWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsDeleteWithResponseMockTests.java deleted file mode 100644 index 63984003381c..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ImportCollectorsOperationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.importCollectorsOperations() - .deleteWithResponse("yslb", "lglmnnkkwayqsh", "yqxridttb", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsGetWithResponseMockTests.java deleted file mode 100644 index b8b1ab1e4e4a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.ImportCollector; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ImportCollectorsOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"discoverySiteId\":\"jqy\",\"createdTimestamp\":\"2021-12-06T04:50:10Z\",\"updatedTimestamp\":\"2021-05-15T07:47:43Z\",\"provisioningState\":\"Failed\"},\"id\":\"tulcrcjdklo\",\"name\":\"csubmzoonsvobc\",\"type\":\"kxfpwh\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - ImportCollector response = manager.importCollectorsOperations() - .getWithResponse("yelsyasvfnk", "myg", "jekrknfd", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ProvisioningState.FAILED, response.properties().provisioningState()); - Assertions.assertEquals("jqy", response.properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsListByAssessmentProjectMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsListByAssessmentProjectMockTests.java deleted file mode 100644 index 9a95bbf0862c..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ImportCollectorsOperationsListByAssessmentProjectMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.ImportCollector; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ImportCollectorsOperationsListByAssessmentProjectMockTests { - @Test - public void testListByAssessmentProject() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"discoverySiteId\":\"aexxjfwtgdfkka\",\"createdTimestamp\":\"2021-09-28T18:01:42Z\",\"updatedTimestamp\":\"2021-06-30T22:22:51Z\",\"provisioningState\":\"Deleting\"},\"id\":\"mczfedyuepsvplt\",\"name\":\"dajjvywe\",\"type\":\"cfkumcfjxo\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.importCollectorsOperations() - .listByAssessmentProject("ihvaang", "tnhjrfdmfd", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ProvisioningState.DELETING, - response.iterator().next().properties().provisioningState()); - Assertions.assertEquals("aexxjfwtgdfkka", response.iterator().next().properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/NetworkAdapterTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/NetworkAdapterTests.java deleted file mode 100644 index ac4aa629b441..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/NetworkAdapterTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.NetworkAdapter; - -public final class NetworkAdapterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkAdapter model = BinaryData.fromString( - "{\"macAddress\":\"okrtalvnb\",\"ipAddresses\":[\"bemeluclvd\",\"jukyrdn\"],\"displayName\":\"dxahhxhqfaqnvzo\"}") - .toObject(NetworkAdapter.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkAdapter model = new NetworkAdapter(); - model = BinaryData.fromObject(model).toObject(NetworkAdapter.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/OperationDisplayTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/OperationDisplayTests.java deleted file mode 100644 index ab8cd3000305..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/OperationDisplayTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/OperationInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/OperationInnerTests.java deleted file mode 100644 index 2a8316ecb86b..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/OperationInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.OperationInner; -import com.azure.resourcemanager.migration.assessment.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/OperationListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/OperationListResultTests.java deleted file mode 100644 index c1a2fa5d5691..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/OperationListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/OperationsListMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/OperationsListMockTests.java deleted file mode 100644 index 62cc620d2680..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/OperationsListMockTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.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\":\"rhuzgfxonjtpu\",\"isDataAction\":false,\"display\":{\"provider\":\"pvti\",\"resource\":\"zbpdbo\",\"operation\":\"gryfqiuasig\",\"description\":\"wsocnequygdjbo\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.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/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index 56b8f7663cdb..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpoint; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.migration.assessment.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionInner model = BinaryData.fromString( - "{\"properties\":{\"groupIds\":[\"ddgmb\"],\"privateEndpoint\":{\"id\":\"xppbhtqqro\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"psalgbqux\",\"actionsRequired\":\"jyj\"},\"provisioningState\":\"Deleting\"},\"id\":\"o\",\"name\":\"fhrtxilnerkujysv\",\"type\":\"eju\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, - model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("psalgbqux", model.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("jyj", model.properties().privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionInner model - = new PrivateEndpointConnectionInner() - .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("psalgbqux") - .withActionsRequired("jyj"))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, - model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("psalgbqux", model.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("jyj", model.properties().privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionListResultTests.java deleted file mode 100644 index 1ba9f0b2f1f0..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpoint; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointConnectionListResult; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.migration.assessment.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupIds\":[\"emchgavsczuej\"],\"privateEndpoint\":{\"id\":\"ptlghwzhomewjjst\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"qawmoaianc\",\"actionsRequired\":\"vodrrslblxydkxr\"},\"provisioningState\":\"Deleting\"},\"id\":\"xiwkgfbql\",\"name\":\"nqkhych\",\"type\":\"c\"},{\"properties\":{\"groupIds\":[\"ehurqlr\"],\"privateEndpoint\":{\"id\":\"aweyur\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"jdxravjuqdbrx\",\"actionsRequired\":\"gchbapxkiy\"},\"provisioningState\":\"Succeeded\"},\"id\":\"bajbuscgduusi\",\"name\":\"ycblevpmcl\",\"type\":\"jy\"}],\"nextLink\":\"yxlzgs\"}") - .toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, - model.value().get(0).properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("qawmoaianc", - model.value().get(0).properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("vodrrslblxydkxr", - model.value().get(0).properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("yxlzgs", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model = new PrivateEndpointConnectionListResult().withValue(Arrays.asList( - new PrivateEndpointConnectionInner() - .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("qawmoaianc") - .withActionsRequired("vodrrslblxydkxr"))), - new PrivateEndpointConnectionInner() - .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("jdxravjuqdbrx") - .withActionsRequired("gchbapxkiy"))))) - .withNextLink("yxlzgs"); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, - model.value().get(0).properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("qawmoaianc", - model.value().get(0).properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("vodrrslblxydkxr", - model.value().get(0).properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("yxlzgs", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsDeleteWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsDeleteWithResponseMockTests.java deleted file mode 100644 index d6d1fece2b35..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionOperationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.privateEndpointConnectionOperations() - .deleteWithResponse("lduyehiiittugyuq", "rldaxurfqa", "csozjv", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsGetWithResponseMockTests.java deleted file mode 100644 index 09dc2f8936eb..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointConnection; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupIds\":[\"m\",\"yakmlwktf\"],\"privateEndpoint\":{\"id\":\"kroyrdurxflzqji\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"gzjxxlf\",\"actionsRequired\":\"lzuqloiwyayyzivr\"},\"provisioningState\":\"Creating\"},\"id\":\"dql\",\"name\":\"chwhrktj\",\"type\":\"eifibfiplhx\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PrivateEndpointConnection response = manager.privateEndpointConnectionOperations() - .getWithResponse("xjgvh", "ccbmkakm", "ookbpu", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - response.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("gzjxxlf", response.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("lzuqloiwyayyzivr", - response.properties().privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsListByAssessmentProjectMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsListByAssessmentProjectMockTests.java deleted file mode 100644 index 9216242858cf..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsListByAssessmentProjectMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointConnection; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionOperationsListByAssessmentProjectMockTests { - @Test - public void testListByAssessmentProject() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupIds\":[\"gbaduve\",\"ovsdqhzrtdbakrli\"],\"privateEndpoint\":{\"id\":\"vppkeqsi\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"lng\",\"actionsRequired\":\"nhr\"},\"provisioningState\":\"Failed\"},\"id\":\"cdtajdopggorw\",\"name\":\"oqtrotpvclpo\",\"type\":\"yrlmwkptsk\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.privateEndpointConnectionOperations() - .listByAssessmentProject("yjxvc", "asormrexzvdube", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - response.iterator().next().properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("lng", - response.iterator().next().properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("nhr", - response.iterator().next().properties().privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsUpdateMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsUpdateMockTests.java deleted file mode 100644 index 9d6252e0e657..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionOperationsUpdateMockTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpoint; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointConnection; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.migration.assessment.models.PrivateLinkServiceConnectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionOperationsUpdateMockTests { - @Test - public void testUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"groupIds\":[\"audgjtfbclakkucd\",\"wnhczbutou\",\"gjtirjwayhic\",\"qwwvgwkslvl\"],\"privateEndpoint\":{\"id\":\"dvbiabvnsrg\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"qx\",\"actionsRequired\":\"yfhbmwkh\"},\"provisioningState\":\"Succeeded\"},\"id\":\"tbspvkhglaqjs\",\"name\":\"yzstujrzxrkns\",\"type\":\"d\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PrivateEndpointConnection response = manager.privateEndpointConnectionOperations() - .update("nsmy", "jow", "yeyzm", - new PrivateEndpointConnectionInner() - .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("stcivrak") - .withActionsRequired("ry"))), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - response.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("qx", response.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("yfhbmwkh", - response.properties().privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index 7e0380ffc48c..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpoint; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.migration.assessment.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"groupIds\":[\"awrlyx\",\"jkcpr\",\"nwbxgjvtbvpyssz\"],\"privateEndpoint\":{\"id\":\"uj\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"muouqfp\",\"actionsRequired\":\"zw\"},\"provisioningState\":\"Succeeded\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("muouqfp", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("zw", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model - = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("muouqfp") - .withActionsRequired("zw")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("muouqfp", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("zw", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointTests.java deleted file mode 100644 index 5dd0fe7d7e80..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpoint; - -public final class PrivateEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"itnwuizgazxufi\"}").toObject(PrivateEndpoint.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint(); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceInnerTests.java deleted file mode 100644 index 90eb375373dc..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.migration.assessment.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceInner model = BinaryData.fromString( - "{\"properties\":{\"groupId\":\"fkndl\",\"requiredMembers\":[\"w\",\"nvgmmbugtywa\"],\"requiredZoneNames\":[\"aqkue\",\"tgroesh\"]},\"id\":\"gzcbyf\",\"name\":\"x\",\"type\":\"faoytehqpuv\"}") - .toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("aqkue", model.properties().requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceInner model = new PrivateLinkResourceInner().withProperties( - new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("aqkue", "tgroesh"))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("aqkue", model.properties().requiredZoneNames().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceListResultTests.java deleted file mode 100644 index bda4a5fd6d28..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceListResultTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.migration.assessment.models.PrivateLinkResourceListResult; -import com.azure.resourcemanager.migration.assessment.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"zltafhbzffovwm\",\"requiredMembers\":[\"zqs\"],\"requiredZoneNames\":[\"gvdwnapf\",\"qwowftptnuw\",\"tkschgcgqyhl\"]},\"id\":\"eyqrhv\",\"name\":\"eldotjv\",\"type\":\"kwiswskukjtas\"}],\"nextLink\":\"wispkxk\"}") - .toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("gvdwnapf", model.value().get(0).properties().requiredZoneNames().get(0)); - Assertions.assertEquals("wispkxk", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResult model = new PrivateLinkResourceListResult() - .withValue(Arrays.asList(new PrivateLinkResourceInner().withProperties(new PrivateLinkResourceProperties() - .withRequiredZoneNames(Arrays.asList("gvdwnapf", "qwowftptnuw", "tkschgcgqyhl"))))) - .withNextLink("wispkxk"); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("gvdwnapf", model.value().get(0).properties().requiredZoneNames().get(0)); - Assertions.assertEquals("wispkxk", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsGetWithResponseMockTests.java deleted file mode 100644 index 5fe0f09250b1..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.PrivateLinkResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourceOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupId\":\"fnzzryizwbxg\",\"requiredMembers\":[\"xlayunomir\",\"p\",\"abenqlamwmg\",\"way\"],\"requiredZoneNames\":[\"nbcpjstbhemhcucs\",\"snxfbxu\",\"eapdrbzyv\"]},\"id\":\"uadulpodkaxpfo\",\"name\":\"kzhmhj\",\"type\":\"qltd\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PrivateLinkResource response = manager.privateLinkResourceOperations() - .getWithResponse("dqumqvfm", "caddtgc", "xegtvgwyur", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("nbcpjstbhemhcucs", response.properties().requiredZoneNames().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsListByAssessmentProjectMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsListByAssessmentProjectMockTests.java deleted file mode 100644 index 494b45709161..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourceOperationsListByAssessmentProjectMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.PrivateLinkResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourceOperationsListByAssessmentProjectMockTests { - @Test - public void testListByAssessmentProject() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"walzyxwhoeamoeo\",\"requiredMembers\":[\"eysf\",\"nimtwuuhaueg\"],\"requiredZoneNames\":[\"mnfeub\",\"zjy\",\"kwfugiphrrkuu\",\"nqd\"]},\"id\":\"hz\",\"name\":\"fopueoqusvwluj\",\"type\":\"pwnibittozt\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.privateLinkResourceOperations() - .listByAssessmentProject("dzciggb", "vt", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("mnfeub", response.iterator().next().properties().requiredZoneNames().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourcePropertiesTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index 544417635730..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkResourcePropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = BinaryData.fromString( - "{\"groupId\":\"vqmtdwckygroejn\",\"requiredMembers\":[\"jdjusk\",\"rreqynkceysfaqe\",\"pl\",\"ryshwddkvbxgk\"],\"requiredZoneNames\":[\"ybwptda\",\"arvvlfnt\",\"mt\"]}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("ybwptda", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model - = new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("ybwptda", "arvvlfnt", "mt")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("ybwptda", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkServiceConnectionStateTests.java deleted file mode 100644 index 4e6c0cb6d896..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.migration.assessment.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model - = BinaryData.fromString("{\"status\":\"Pending\",\"description\":\"y\",\"actionsRequired\":\"hr\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); - Assertions.assertEquals("y", model.description()); - Assertions.assertEquals("hr", model.actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model - = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("y") - .withActionsRequired("hr"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); - Assertions.assertEquals("y", model.description()); - Assertions.assertEquals("hr", model.actionsRequired()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ProcessorInfoTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ProcessorInfoTests.java deleted file mode 100644 index a32ba5ebceba..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ProcessorInfoTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.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\":\"ksgplsa\",\"numberOfSockets\":931393503,\"numberOfCoresPerSocket\":792282663}") - .toObject(ProcessorInfo.class); - Assertions.assertEquals("ksgplsa", model.name()); - Assertions.assertEquals(931393503, model.numberOfSockets()); - Assertions.assertEquals(792282663, model.numberOfCoresPerSocket()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProcessorInfo model = new ProcessorInfo().withName("ksgplsa") - .withNumberOfSockets(931393503) - .withNumberOfCoresPerSocket(792282663); - model = BinaryData.fromObject(model).toObject(ProcessorInfo.class); - Assertions.assertEquals("ksgplsa", model.name()); - Assertions.assertEquals(931393503, model.numberOfSockets()); - Assertions.assertEquals(792282663, model.numberOfCoresPerSocket()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ProductSupportStatusTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ProductSupportStatusTests.java deleted file mode 100644 index 19f09edaf439..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ProductSupportStatusTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.ProductSupportStatus; - -public final class ProductSupportStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductSupportStatus model = BinaryData.fromString( - "{\"currentVersion\":\"ynl\",\"servicePackStatus\":\"huopxodlqiynto\",\"esuStatus\":\"ihleos\",\"supportStatus\":\"w\",\"eta\":1899163147,\"currentEsuYear\":\"lyzrpzbchckqqzqi\",\"mainstreamEndDate\":\"2021-05-24T05:08:39Z\",\"extendedSupportEndDate\":\"2021-11-07T11:18:56Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-10-31T06:14:16Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-10-09T00:37:48Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-06-27T05:18:24Z\"}") - .toObject(ProductSupportStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductSupportStatus model = new ProductSupportStatus(); - model = BinaryData.fromObject(model).toObject(ProductSupportStatus.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ProjectPropertiesTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ProjectPropertiesTests.java deleted file mode 100644 index 88117538527e..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ProjectPropertiesTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.ProjectProperties; -import com.azure.resourcemanager.migration.assessment.models.ProjectStatus; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import org.junit.jupiter.api.Assertions; - -public final class ProjectPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProjectProperties model = BinaryData.fromString( - "{\"createdTimestamp\":\"2021-05-11T01:45:16Z\",\"updatedTimestamp\":\"2021-04-06T09:15:33Z\",\"serviceEndpoint\":\"atqxho\",\"assessmentSolutionId\":\"geablgphuticndvk\",\"projectStatus\":\"Inactive\",\"customerWorkspaceId\":\"yiftyhxhuro\",\"customerWorkspaceLocation\":\"tyxolniwpwc\",\"publicNetworkAccess\":\"jfkgiawxk\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"ckbasyypndd\",\"sgcbac\",\"hejkotynqgou\"],\"privateEndpoint\":{\"id\":\"dlikwyqkgfgibma\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"eqsrxybzqqedqyt\",\"actionsRequired\":\"iqfouflmmnkz\"},\"provisioningState\":\"Creating\"},\"id\":\"mglougpbkw\",\"name\":\"mutduqktaps\",\"type\":\"wgcu\"}],\"customerStorageAccountArmId\":\"tumkdosvqwhbm\",\"provisioningState\":\"Provisioning\"}") - .toObject(ProjectProperties.class); - Assertions.assertEquals(ProvisioningState.PROVISIONING, model.provisioningState()); - Assertions.assertEquals("geablgphuticndvk", model.assessmentSolutionId()); - Assertions.assertEquals(ProjectStatus.INACTIVE, model.projectStatus()); - Assertions.assertEquals("yiftyhxhuro", model.customerWorkspaceId()); - Assertions.assertEquals("tyxolniwpwc", model.customerWorkspaceLocation()); - Assertions.assertEquals("jfkgiawxk", model.publicNetworkAccess()); - Assertions.assertEquals("tumkdosvqwhbm", model.customerStorageAccountArmId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProjectProperties model = new ProjectProperties().withProvisioningState(ProvisioningState.PROVISIONING) - .withAssessmentSolutionId("geablgphuticndvk") - .withProjectStatus(ProjectStatus.INACTIVE) - .withCustomerWorkspaceId("yiftyhxhuro") - .withCustomerWorkspaceLocation("tyxolniwpwc") - .withPublicNetworkAccess("jfkgiawxk") - .withCustomerStorageAccountArmId("tumkdosvqwhbm"); - model = BinaryData.fromObject(model).toObject(ProjectProperties.class); - Assertions.assertEquals(ProvisioningState.PROVISIONING, model.provisioningState()); - Assertions.assertEquals("geablgphuticndvk", model.assessmentSolutionId()); - Assertions.assertEquals(ProjectStatus.INACTIVE, model.projectStatus()); - Assertions.assertEquals("yiftyhxhuro", model.customerWorkspaceId()); - Assertions.assertEquals("tyxolniwpwc", model.customerWorkspaceLocation()); - Assertions.assertEquals("jfkgiawxk", model.publicNetworkAccess()); - Assertions.assertEquals("tumkdosvqwhbm", model.customerStorageAccountArmId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorInnerTests.java deleted file mode 100644 index d6222cabf881..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorInnerTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.ServerCollectorInner; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ServerCollectorInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerCollectorInner model = BinaryData.fromString( - "{\"properties\":{\"agentProperties\":{\"id\":\"ozfnkfexlvx\",\"version\":\"akizvoaikna\",\"lastHeartbeatUtc\":\"2021-04-06T13:12:15Z\",\"spnDetails\":{\"authority\":\"iguyxlykwphv\",\"applicationId\":\"cwxhmpej\",\"audience\":\"ke\",\"objectId\":\"onwivkcqhrxhxkn\",\"tenantId\":\"crmmkyupijuby\"}},\"discoverySiteId\":\"fkak\",\"createdTimestamp\":\"2021-11-11T13:29:18Z\",\"updatedTimestamp\":\"2021-07-21T09:43:27Z\",\"provisioningState\":\"Canceled\"},\"id\":\"il\",\"name\":\"udxjascowv\",\"type\":\"djkpdxph\"}") - .toObject(ServerCollectorInner.class); - Assertions.assertEquals(ProvisioningState.CANCELED, model.properties().provisioningState()); - Assertions.assertEquals("ozfnkfexlvx", model.properties().agentProperties().id()); - Assertions.assertEquals("akizvoaikna", model.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-06T13:12:15Z"), - model.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("iguyxlykwphv", model.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("cwxhmpej", model.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("ke", model.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("onwivkcqhrxhxkn", model.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("crmmkyupijuby", model.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("fkak", model.properties().discoverySiteId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerCollectorInner model = new ServerCollectorInner() - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.CANCELED) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("ozfnkfexlvx") - .withVersion("akizvoaikna") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-04-06T13:12:15Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("iguyxlykwphv") - .withApplicationId("cwxhmpej") - .withAudience("ke") - .withObjectId("onwivkcqhrxhxkn") - .withTenantId("crmmkyupijuby"))) - .withDiscoverySiteId("fkak")); - model = BinaryData.fromObject(model).toObject(ServerCollectorInner.class); - Assertions.assertEquals(ProvisioningState.CANCELED, model.properties().provisioningState()); - Assertions.assertEquals("ozfnkfexlvx", model.properties().agentProperties().id()); - Assertions.assertEquals("akizvoaikna", model.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-06T13:12:15Z"), - model.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("iguyxlykwphv", model.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("cwxhmpej", model.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("ke", model.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("onwivkcqhrxhxkn", model.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("crmmkyupijuby", model.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("fkak", model.properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorListResultTests.java deleted file mode 100644 index f78f36f66a69..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorListResultTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.ServerCollectorInner; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.ServerCollectorListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServerCollectorListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerCollectorListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"agentProperties\":{\"id\":\"nq\",\"version\":\"gjfbpkuwxeoi\",\"lastHeartbeatUtc\":\"2021-05-31T08:53:37Z\",\"spnDetails\":{\"authority\":\"fa\",\"applicationId\":\"jzwfb\",\"audience\":\"aykmmf\",\"objectId\":\"bfw\",\"tenantId\":\"zxmdew\"}},\"discoverySiteId\":\"sxkrpl\",\"createdTimestamp\":\"2021-10-04T01:54:23Z\",\"updatedTimestamp\":\"2021-08-18T20:19:59Z\",\"provisioningState\":\"Failed\"},\"id\":\"viyoypsuhbrnnhjx\",\"name\":\"qwjhqkbiwetpozyc\",\"type\":\"qiqyhgfsetzlexbs\"},{\"properties\":{\"agentProperties\":{\"id\":\"ynojpziuw\",\"version\":\"zkkdtnhqs\",\"lastHeartbeatUtc\":\"2021-06-07T11:46:36Z\",\"spnDetails\":{\"authority\":\"elpkpbafvafhlbyl\",\"applicationId\":\"bevxrhyzd\",\"audience\":\"rsofpltdbmairrh\",\"objectId\":\"fnrac\",\"tenantId\":\"pqigtuujwouhd\"}},\"discoverySiteId\":\"s\",\"createdTimestamp\":\"2021-09-12T08:30:14Z\",\"updatedTimestamp\":\"2021-03-06T17:38:31Z\",\"provisioningState\":\"Updating\"},\"id\":\"jybvit\",\"name\":\"qkj\",\"type\":\"az\"}],\"nextLink\":\"mtggmu\"}") - .toObject(ServerCollectorListResult.class); - Assertions.assertEquals(ProvisioningState.FAILED, model.value().get(0).properties().provisioningState()); - Assertions.assertEquals("nq", model.value().get(0).properties().agentProperties().id()); - Assertions.assertEquals("gjfbpkuwxeoi", model.value().get(0).properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-31T08:53:37Z"), - model.value().get(0).properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("fa", model.value().get(0).properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("jzwfb", - model.value().get(0).properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("aykmmf", model.value().get(0).properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("bfw", model.value().get(0).properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("zxmdew", model.value().get(0).properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("sxkrpl", model.value().get(0).properties().discoverySiteId()); - Assertions.assertEquals("mtggmu", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerCollectorListResult model = new ServerCollectorListResult().withValue(Arrays.asList( - new ServerCollectorInner() - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.FAILED) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("nq") - .withVersion("gjfbpkuwxeoi") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-05-31T08:53:37Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("fa") - .withApplicationId("jzwfb") - .withAudience("aykmmf") - .withObjectId("bfw") - .withTenantId("zxmdew"))) - .withDiscoverySiteId("sxkrpl")), - new ServerCollectorInner() - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.UPDATING) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("ynojpziuw") - .withVersion("zkkdtnhqs") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-06-07T11:46:36Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("elpkpbafvafhlbyl") - .withApplicationId("bevxrhyzd") - .withAudience("rsofpltdbmairrh") - .withObjectId("fnrac") - .withTenantId("pqigtuujwouhd"))) - .withDiscoverySiteId("s")))) - .withNextLink("mtggmu"); - model = BinaryData.fromObject(model).toObject(ServerCollectorListResult.class); - Assertions.assertEquals(ProvisioningState.FAILED, model.value().get(0).properties().provisioningState()); - Assertions.assertEquals("nq", model.value().get(0).properties().agentProperties().id()); - Assertions.assertEquals("gjfbpkuwxeoi", model.value().get(0).properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-31T08:53:37Z"), - model.value().get(0).properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("fa", model.value().get(0).properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("jzwfb", - model.value().get(0).properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("aykmmf", model.value().get(0).properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("bfw", model.value().get(0).properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("zxmdew", model.value().get(0).properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("sxkrpl", model.value().get(0).properties().discoverySiteId()); - Assertions.assertEquals("mtggmu", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsCreateMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsCreateMockTests.java deleted file mode 100644 index 82e00b9ce175..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsCreateMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.ServerCollector; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServerCollectorsOperationsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"agentProperties\":{\"id\":\"ekivycpzcvdizulr\",\"version\":\"bhtrezpzlpryfm\",\"lastHeartbeatUtc\":\"2021-03-29T10:22:50Z\",\"spnDetails\":{\"authority\":\"zf\",\"applicationId\":\"il\",\"audience\":\"udccgndjgdprig\",\"objectId\":\"qyeqfcbuulpyuflq\",\"tenantId\":\"shtujcyoh\"}},\"discoverySiteId\":\"imwdcsklkqnqvki\",\"createdTimestamp\":\"2021-01-31T20:14:53Z\",\"updatedTimestamp\":\"2021-09-14T00:51:35Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"uyrzw\",\"name\":\"mbzayspzvrietv\",\"type\":\"phmdzxplgtp\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - ServerCollector response = manager.serverCollectorsOperations() - .define("woykdnonaaxwm") - .withExistingAssessmentProject("zbkuckgkdsksw", "iiqqcqikclsmalns") - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.FAILED) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("jlqcwny") - .withVersion("lei") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-10-19T04:53:11Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("vs") - .withApplicationId("sertoxadhxuvjh") - .withAudience("nrqstjcmetwmlg") - .withObjectId("vnpvvd") - .withTenantId("jnaqyq"))) - .withDiscoverySiteId("slz")) - .create(); - - Assertions.assertEquals(ProvisioningState.SUCCEEDED, response.properties().provisioningState()); - Assertions.assertEquals("ekivycpzcvdizulr", response.properties().agentProperties().id()); - Assertions.assertEquals("bhtrezpzlpryfm", response.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-29T10:22:50Z"), - response.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("zf", response.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("il", response.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("udccgndjgdprig", response.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("qyeqfcbuulpyuflq", response.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("shtujcyoh", response.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("imwdcsklkqnqvki", response.properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsDeleteWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsDeleteWithResponseMockTests.java deleted file mode 100644 index a12a9e6d9f5c..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServerCollectorsOperationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.serverCollectorsOperations() - .deleteWithResponse("mtznpaxwfqtyyqi", "rcltungbsoljckm", "i", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsGetWithResponseMockTests.java deleted file mode 100644 index b86ee5295256..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.ServerCollector; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServerCollectorsOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"agentProperties\":{\"id\":\"rfijhggabq\",\"version\":\"amklilirwdv\",\"lastHeartbeatUtc\":\"2021-02-25T01:02:51Z\",\"spnDetails\":{\"authority\":\"pzou\",\"applicationId\":\"tqrxqwqnjxrdf\",\"audience\":\"t\",\"objectId\":\"lygtavczcxdfweap\",\"tenantId\":\"mlx\"}},\"discoverySiteId\":\"jphrasp\",\"createdTimestamp\":\"2021-10-13T05:12:25Z\",\"updatedTimestamp\":\"2021-04-07T06:21:32Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"mdbgi\",\"name\":\"ehfgsm\",\"type\":\"rjuqbpxtokl\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - ServerCollector response = manager.serverCollectorsOperations() - .getWithResponse("rmimrljdpoqfxyem", "kftbaewhte", "loamfmxtllfltym", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ProvisioningState.PROVISIONING, response.properties().provisioningState()); - Assertions.assertEquals("rfijhggabq", response.properties().agentProperties().id()); - Assertions.assertEquals("amklilirwdv", response.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T01:02:51Z"), - response.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("pzou", response.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("tqrxqwqnjxrdf", response.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("t", response.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("lygtavczcxdfweap", response.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("mlx", response.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("jphrasp", response.properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsListByAssessmentProjectMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsListByAssessmentProjectMockTests.java deleted file mode 100644 index 7e7c444cdb99..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/ServerCollectorsOperationsListByAssessmentProjectMockTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.ServerCollector; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServerCollectorsOperationsListByAssessmentProjectMockTests { - @Test - public void testListByAssessmentProject() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"agentProperties\":{\"id\":\"udzpgchz\",\"version\":\"fqum\",\"lastHeartbeatUtc\":\"2021-08-09T12:08:51Z\",\"spnDetails\":{\"authority\":\"zg\",\"applicationId\":\"odkynrc\",\"audience\":\"avf\",\"objectId\":\"dfmmxjdnajuopjy\",\"tenantId\":\"mk\"}},\"discoverySiteId\":\"hvcw\",\"createdTimestamp\":\"2020-12-27T08:55:26Z\",\"updatedTimestamp\":\"2021-07-26T14:54:57Z\",\"provisioningState\":\"Accepted\"},\"id\":\"uxxrwzobuzms\",\"name\":\"g\",\"type\":\"mtdtkwppthuzd\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.serverCollectorsOperations() - .listByAssessmentProject("rfrswqikwep", "ogggicwnxhtfm", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ProvisioningState.ACCEPTED, - response.iterator().next().properties().provisioningState()); - Assertions.assertEquals("udzpgchz", response.iterator().next().properties().agentProperties().id()); - Assertions.assertEquals("fqum", response.iterator().next().properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T12:08:51Z"), - response.iterator().next().properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("zg", - response.iterator().next().properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("odkynrc", - response.iterator().next().properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("avf", - response.iterator().next().properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("dfmmxjdnajuopjy", - response.iterator().next().properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("mk", - response.iterator().next().properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("hvcw", response.iterator().next().properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SharedResourcesDtoTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SharedResourcesDtoTests.java deleted file mode 100644 index f64bce531b40..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SharedResourcesDtoTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.SharedResourcesDto; - -public final class SharedResourcesDtoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SharedResourcesDto model = BinaryData.fromString( - "{\"sharedDataDisks\":[{\"diskType\":\"PremiumV2\",\"diskSize\":\"StandardSSD_E6\",\"diskRedundancy\":\"LRS\",\"storageCost\":49.056522,\"recommendedSizeInGib\":91.00812,\"recommendedThroughputInMbps\":9.602481,\"recommendedIops\":34.19709},{\"diskType\":\"StandardSSD\",\"diskSize\":\"StandardSSD_E70\",\"diskRedundancy\":\"LRS\",\"storageCost\":95.53731,\"recommendedSizeInGib\":9.462631,\"recommendedThroughputInMbps\":56.672623,\"recommendedIops\":85.27624}],\"sharedLogDisks\":[{\"diskType\":\"StandardSSD\",\"diskSize\":\"Premium_P70\",\"diskRedundancy\":\"LRS\",\"storageCost\":37.982494,\"recommendedSizeInGib\":83.62443,\"recommendedThroughputInMbps\":27.694584,\"recommendedIops\":71.01518}],\"sharedTempDbDisks\":[{\"diskType\":\"StandardSSD\",\"diskSize\":\"Standard_S70\",\"diskRedundancy\":\"ZRS\",\"storageCost\":7.3985996,\"recommendedSizeInGib\":33.910362,\"recommendedThroughputInMbps\":58.884544,\"recommendedIops\":18.486155},{\"diskType\":\"StandardOrPremium\",\"diskSize\":\"StandardSSD_E30\",\"diskRedundancy\":\"ZRS\",\"storageCost\":68.46939,\"recommendedSizeInGib\":64.62172,\"recommendedThroughputInMbps\":86.46677,\"recommendedIops\":95.01893},{\"diskType\":\"Premium\",\"diskSize\":\"Premium_P50\",\"diskRedundancy\":\"LRS\",\"storageCost\":72.11864,\"recommendedSizeInGib\":19.875591,\"recommendedThroughputInMbps\":72.86604,\"recommendedIops\":52.05117}],\"numberOfMounts\":1786221046,\"quorumWitness\":{\"quorumWitnessType\":\"Unknown\"}}") - .toObject(SharedResourcesDto.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SharedResourcesDto model = new SharedResourcesDto(); - model = BinaryData.fromObject(model).toObject(SharedResourcesDto.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessedNetworkAdapterTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessedNetworkAdapterTests.java deleted file mode 100644 index 655c868e599b..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessedNetworkAdapterTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AzureNetworkAdapterSuitabilityDetail; -import com.azure.resourcemanager.migration.assessment.models.AzureNetworkAdapterSuitabilityExplanation; -import com.azure.resourcemanager.migration.assessment.models.CloudSuitability; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessedNetworkAdapter; -import org.junit.jupiter.api.Assertions; - -public final class SqlAssessedNetworkAdapterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlAssessedNetworkAdapter model = BinaryData.fromString( - "{\"suitability\":\"ConditionallySuitable\",\"suitabilityDetail\":\"MegabytesOfDataTransmittedOutOfRange\",\"suitabilityExplanation\":\"InternalErrorOccurred\",\"monthlyBandwidthCosts\":55.11159,\"netGigabytesTransmittedPerMonth\":58.90187,\"name\":\"y\",\"displayName\":\"chrszi\",\"macAddress\":\"yuel\",\"ipAddresses\":[\"ndnbfqy\"],\"megabytesPerSecondReceived\":24.793839,\"megabytesPerSecondTransmitted\":46.289616}") - .toObject(SqlAssessedNetworkAdapter.class); - Assertions.assertEquals(CloudSuitability.CONDITIONALLY_SUITABLE, model.suitability()); - Assertions.assertEquals(AzureNetworkAdapterSuitabilityDetail.MEGABYTES_OF_DATA_TRANSMITTED_OUT_OF_RANGE, - model.suitabilityDetail()); - Assertions.assertEquals(AzureNetworkAdapterSuitabilityExplanation.INTERNAL_ERROR_OCCURRED, - model.suitabilityExplanation()); - Assertions.assertEquals(55.11159F, model.monthlyBandwidthCosts()); - Assertions.assertEquals(58.90187F, model.netGigabytesTransmittedPerMonth()); - Assertions.assertEquals("y", model.name()); - Assertions.assertEquals("chrszi", model.displayName()); - Assertions.assertEquals("yuel", model.macAddress()); - Assertions.assertEquals(24.793839F, model.megabytesPerSecondReceived()); - Assertions.assertEquals(46.289616F, model.megabytesPerSecondTransmitted()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlAssessedNetworkAdapter model - = new SqlAssessedNetworkAdapter().withSuitability(CloudSuitability.CONDITIONALLY_SUITABLE) - .withSuitabilityDetail(AzureNetworkAdapterSuitabilityDetail.MEGABYTES_OF_DATA_TRANSMITTED_OUT_OF_RANGE) - .withSuitabilityExplanation(AzureNetworkAdapterSuitabilityExplanation.INTERNAL_ERROR_OCCURRED) - .withMonthlyBandwidthCosts(55.11159F) - .withNetGigabytesTransmittedPerMonth(58.90187F) - .withName("y") - .withDisplayName("chrszi") - .withMacAddress("yuel") - .withMegabytesPerSecondReceived(24.793839F) - .withMegabytesPerSecondTransmitted(46.289616F); - model = BinaryData.fromObject(model).toObject(SqlAssessedNetworkAdapter.class); - Assertions.assertEquals(CloudSuitability.CONDITIONALLY_SUITABLE, model.suitability()); - Assertions.assertEquals(AzureNetworkAdapterSuitabilityDetail.MEGABYTES_OF_DATA_TRANSMITTED_OUT_OF_RANGE, - model.suitabilityDetail()); - Assertions.assertEquals(AzureNetworkAdapterSuitabilityExplanation.INTERNAL_ERROR_OCCURRED, - model.suitabilityExplanation()); - Assertions.assertEquals(55.11159F, model.monthlyBandwidthCosts()); - Assertions.assertEquals(58.90187F, model.netGigabytesTransmittedPerMonth()); - Assertions.assertEquals("y", model.name()); - Assertions.assertEquals("chrszi", model.displayName()); - Assertions.assertEquals("yuel", model.macAddress()); - Assertions.assertEquals(24.793839F, model.megabytesPerSecondReceived()); - Assertions.assertEquals(46.289616F, model.megabytesPerSecondTransmitted()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentMigrationIssueTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentMigrationIssueTests.java deleted file mode 100644 index 1ec37f07be5f..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentMigrationIssueTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentMigrationIssue; - -public final class SqlAssessmentMigrationIssueTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlAssessmentMigrationIssue model = BinaryData.fromString( - "{\"issueId\":\"a\",\"issueCategory\":\"Issue\",\"impactedObjects\":[{\"objectName\":\"h\",\"objectType\":\"usps\"},{\"objectName\":\"sdvlmfwdgzxulucv\",\"objectType\":\"mrsreuzvxurisjnh\"},{\"objectName\":\"txifqj\",\"objectType\":\"xmrhu\"},{\"objectName\":\"wp\",\"objectType\":\"sutrgjup\"}]}") - .toObject(SqlAssessmentMigrationIssue.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlAssessmentMigrationIssue model = new SqlAssessmentMigrationIssue(); - model = BinaryData.fromObject(model).toObject(SqlAssessmentMigrationIssue.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsInnerTests.java deleted file mode 100644 index a5a23c6188ee..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsInnerTests.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentOptionsInner; -import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlServiceTier; -import com.azure.resourcemanager.migration.assessment.models.AzureVmFamily; -import com.azure.resourcemanager.migration.assessment.models.ComputeTier; -import com.azure.resourcemanager.migration.assessment.models.HardwareGeneration; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentOptionsProperties; -import com.azure.resourcemanager.migration.assessment.models.SqlPaaSTargetOptions; -import com.azure.resourcemanager.migration.assessment.models.TargetType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SqlAssessmentOptionsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlAssessmentOptionsInner model = BinaryData.fromString( - "{\"properties\":{\"vmFamilies\":[{\"familyName\":\"nuhzafccnuh\",\"targetLocations\":[\"byl\",\"ui\"],\"category\":[\"vatvcrkd\",\"b\"]},{\"familyName\":\"qxvhcsyhzlwxa\",\"targetLocations\":[\"vurex\"],\"category\":[\"sbdweaderzmwnt\"]},{\"familyName\":\"agttm\",\"targetLocations\":[\"agoaqylkjztji\",\"azjcgmxitpfin\",\"cpdltkrlg\"],\"category\":[\"bd\",\"vcqguefzh\",\"mpheqdur\"]},{\"familyName\":\"yujlfyoumpckyecl\",\"targetLocations\":[\"gptaj\",\"rzmq\",\"ucycijo\",\"lxiutgjcyzyzjdnr\"],\"category\":[\"txjeaoqaqbzgy\",\"fwwvuatbwbqam\",\"e\",\"liys\"]}],\"reservedInstanceVmFamilies\":[\"Msv2_series\",\"Dsv4_series\",\"Edsv5_series\",\"GS_series\"],\"premiumDiskVmFamilies\":[\"Edsv4_series\",\"Edv5_series\",\"Eadsv5_series\"],\"savingsPlanVmFamilies\":[\"Dsv3_series\",\"GS_series\",\"Esv4_series\"],\"savingsPlanSupportedLocations\":[\"AustraliaSoutheast\",\"USDoDCentral\"],\"savingsPlanSupportedLocationsForPaas\":[\"SouthAfricaWest\",\"GermanyNortheast\",\"UsSecCentral\"],\"reservedInstanceSupportedLocationsForIaas\":[\"WestEurope\",\"GermanyNorth\",\"USGovVirginia\",\"USGovIowa\"],\"savingsPlanSupportedOffers\":[\"MSAZRUSGOV0003P\",\"MSAZR0036P\",\"MSAZR0121P\",\"MSAZR0063P\"],\"sqlSkus\":[{\"computeTier\":\"Serverless\",\"hardwareGeneration\":\"Unknown\",\"targetType\":\"AzureSqlVirtualMachine\",\"serviceTier\":\"GeneralPurpose\",\"targetLocations\":[\"SwitzerlandWest\"]},{\"computeTier\":\"Provisioned\",\"hardwareGeneration\":\"Gen5\",\"targetType\":\"AzureSqlDatabase\",\"serviceTier\":\"Unknown\",\"targetLocations\":[\"SwitzerlandNorth\",\"WestCentralUs\",\"JapanEast\",\"JapanWest\"]},{\"computeTier\":\"Automatic\",\"hardwareGeneration\":\"Unknown\",\"targetType\":\"AzureSqlVirtualMachine\",\"serviceTier\":\"BusinessCritical\",\"targetLocations\":[\"USGovArizona\"]}],\"reservedInstanceSqlTargets\":[\"AzureSqlVirtualMachine\",\"Unknown\",\"AzureSqlManagedInstance\",\"Recommended\"],\"reservedInstanceSupportedLocations\":[\"WestUs\",\"SoutheastAsia\",\"CanadaCentral\",\"AustraliaCentral2\"],\"reservedInstanceSupportedCurrencies\":[\"USD\",\"DKK\",\"JPY\"],\"reservedInstanceSupportedOffers\":[\"Unknown\",\"SavingsPlan3Year\",\"MSMCAZR0063P\",\"MSMCAZR0060P\"],\"supportedOffers\":[\"MSAZR0243P\",\"MSAZR0127P\"]},\"id\":\"imwrzregzgyufu\",\"name\":\"rw\",\"type\":\"weryekzk\"}") - .toObject(SqlAssessmentOptionsInner.class); - Assertions.assertEquals(AzureVmFamily.DSV3_SERIES, model.properties().savingsPlanVmFamilies().get(0)); - Assertions.assertEquals(AzureLocation.AUSTRALIA_SOUTHEAST, - model.properties().savingsPlanSupportedLocations().get(0)); - Assertions.assertEquals(AzureLocation.SOUTH_AFRICA_WEST, - model.properties().savingsPlanSupportedLocationsForPaas().get(0)); - Assertions.assertEquals(AzureLocation.WEST_EUROPE, - model.properties().reservedInstanceSupportedLocationsForIaas().get(0)); - Assertions.assertEquals(AzureOfferCode.MSAZRUSGOV0003P, model.properties().savingsPlanSupportedOffers().get(0)); - Assertions.assertEquals(ComputeTier.SERVERLESS, model.properties().sqlSkus().get(0).computeTier()); - Assertions.assertEquals(HardwareGeneration.UNKNOWN, model.properties().sqlSkus().get(0).hardwareGeneration()); - Assertions.assertEquals(TargetType.AZURE_SQL_VIRTUAL_MACHINE, model.properties().sqlSkus().get(0).targetType()); - Assertions.assertEquals(AzureSqlServiceTier.GENERAL_PURPOSE, model.properties().sqlSkus().get(0).serviceTier()); - Assertions.assertEquals(AzureLocation.SWITZERLAND_WEST, - model.properties().sqlSkus().get(0).targetLocations().get(0)); - Assertions.assertEquals(TargetType.AZURE_SQL_VIRTUAL_MACHINE, - model.properties().reservedInstanceSqlTargets().get(0)); - Assertions.assertEquals(AzureLocation.WEST_US, model.properties().reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.USD, model.properties().reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.UNKNOWN, model.properties().reservedInstanceSupportedOffers().get(0)); - Assertions.assertEquals(AzureOfferCode.MSAZR0243P, model.properties().supportedOffers().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlAssessmentOptionsInner model - = new SqlAssessmentOptionsInner().withProperties(new SqlAssessmentOptionsProperties() - .withSavingsPlanVmFamilies( - Arrays.asList(AzureVmFamily.DSV3_SERIES, AzureVmFamily.GS_SERIES, AzureVmFamily.ESV4_SERIES)) - .withSavingsPlanSupportedLocations( - Arrays.asList(AzureLocation.AUSTRALIA_SOUTHEAST, AzureLocation.USDO_DCENTRAL)) - .withSavingsPlanSupportedLocationsForPaas(Arrays.asList(AzureLocation.SOUTH_AFRICA_WEST, - AzureLocation.GERMANY_NORTHEAST, AzureLocation.US_SEC_CENTRAL)) - .withReservedInstanceSupportedLocationsForIaas(Arrays.asList(AzureLocation.WEST_EUROPE, - AzureLocation.GERMANY_NORTH, AzureLocation.USGOV_VIRGINIA, AzureLocation.USGOV_IOWA)) - .withSavingsPlanSupportedOffers(Arrays.asList(AzureOfferCode.MSAZRUSGOV0003P, AzureOfferCode.MSAZR0036P, - AzureOfferCode.MSAZR0121P, AzureOfferCode.MSAZR0063P)) - .withSqlSkus(Arrays.asList( - new SqlPaaSTargetOptions().withComputeTier(ComputeTier.SERVERLESS) - .withHardwareGeneration(HardwareGeneration.UNKNOWN) - .withTargetType(TargetType.AZURE_SQL_VIRTUAL_MACHINE) - .withServiceTier(AzureSqlServiceTier.GENERAL_PURPOSE) - .withTargetLocations(Arrays.asList(AzureLocation.SWITZERLAND_WEST)), - new SqlPaaSTargetOptions().withComputeTier(ComputeTier.PROVISIONED) - .withHardwareGeneration(HardwareGeneration.GEN5) - .withTargetType(TargetType.AZURE_SQL_DATABASE) - .withServiceTier(AzureSqlServiceTier.UNKNOWN) - .withTargetLocations(Arrays.asList(AzureLocation.SWITZERLAND_NORTH, - AzureLocation.WEST_CENTRAL_US, AzureLocation.JAPAN_EAST, AzureLocation.JAPAN_WEST)), - new SqlPaaSTargetOptions().withComputeTier(ComputeTier.AUTOMATIC) - .withHardwareGeneration(HardwareGeneration.UNKNOWN) - .withTargetType(TargetType.AZURE_SQL_VIRTUAL_MACHINE) - .withServiceTier(AzureSqlServiceTier.BUSINESS_CRITICAL) - .withTargetLocations(Arrays.asList(AzureLocation.USGOV_ARIZONA)))) - .withReservedInstanceSqlTargets(Arrays.asList(TargetType.AZURE_SQL_VIRTUAL_MACHINE, TargetType.UNKNOWN, - TargetType.AZURE_SQL_MANAGED_INSTANCE, TargetType.RECOMMENDED)) - .withReservedInstanceSupportedLocations(Arrays.asList(AzureLocation.WEST_US, - AzureLocation.SOUTHEAST_ASIA, AzureLocation.CANADA_CENTRAL, AzureLocation.AUSTRALIA_CENTRAL2)) - .withReservedInstanceSupportedCurrencies( - Arrays.asList(AzureCurrency.USD, AzureCurrency.DKK, AzureCurrency.JPY)) - .withReservedInstanceSupportedOffers(Arrays.asList(AzureOfferCode.UNKNOWN, - AzureOfferCode.SAVINGS_PLAN3YEAR, AzureOfferCode.MSMCAZR0063P, AzureOfferCode.MSMCAZR0060P)) - .withSupportedOffers(Arrays.asList(AzureOfferCode.MSAZR0243P, AzureOfferCode.MSAZR0127P))); - model = BinaryData.fromObject(model).toObject(SqlAssessmentOptionsInner.class); - Assertions.assertEquals(AzureVmFamily.DSV3_SERIES, model.properties().savingsPlanVmFamilies().get(0)); - Assertions.assertEquals(AzureLocation.AUSTRALIA_SOUTHEAST, - model.properties().savingsPlanSupportedLocations().get(0)); - Assertions.assertEquals(AzureLocation.SOUTH_AFRICA_WEST, - model.properties().savingsPlanSupportedLocationsForPaas().get(0)); - Assertions.assertEquals(AzureLocation.WEST_EUROPE, - model.properties().reservedInstanceSupportedLocationsForIaas().get(0)); - Assertions.assertEquals(AzureOfferCode.MSAZRUSGOV0003P, model.properties().savingsPlanSupportedOffers().get(0)); - Assertions.assertEquals(ComputeTier.SERVERLESS, model.properties().sqlSkus().get(0).computeTier()); - Assertions.assertEquals(HardwareGeneration.UNKNOWN, model.properties().sqlSkus().get(0).hardwareGeneration()); - Assertions.assertEquals(TargetType.AZURE_SQL_VIRTUAL_MACHINE, model.properties().sqlSkus().get(0).targetType()); - Assertions.assertEquals(AzureSqlServiceTier.GENERAL_PURPOSE, model.properties().sqlSkus().get(0).serviceTier()); - Assertions.assertEquals(AzureLocation.SWITZERLAND_WEST, - model.properties().sqlSkus().get(0).targetLocations().get(0)); - Assertions.assertEquals(TargetType.AZURE_SQL_VIRTUAL_MACHINE, - model.properties().reservedInstanceSqlTargets().get(0)); - Assertions.assertEquals(AzureLocation.WEST_US, model.properties().reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.USD, model.properties().reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.UNKNOWN, model.properties().reservedInstanceSupportedOffers().get(0)); - Assertions.assertEquals(AzureOfferCode.MSAZR0243P, model.properties().supportedOffers().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsListResultTests.java deleted file mode 100644 index c9aa4c0e5a03..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsListResultTests.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentOptionsInner; -import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlServiceTier; -import com.azure.resourcemanager.migration.assessment.models.AzureVmFamily; -import com.azure.resourcemanager.migration.assessment.models.ComputeTier; -import com.azure.resourcemanager.migration.assessment.models.HardwareGeneration; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentOptionsListResult; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentOptionsProperties; -import com.azure.resourcemanager.migration.assessment.models.SqlPaaSTargetOptions; -import com.azure.resourcemanager.migration.assessment.models.TargetType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SqlAssessmentOptionsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlAssessmentOptionsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"vmFamilies\":[{\"familyName\":\"gzv\",\"targetLocations\":[\"jd\"],\"category\":[\"qnwsithuqolyah\",\"uqwqulsutrjbhxyk\",\"hyqezvqq\"]},{\"familyName\":\"drftbcvexreuquo\",\"targetLocations\":[\"jv\",\"whreagkhyxvrq\",\"vbczsulmdg\"],\"category\":[\"epjpfs\",\"ykgsangpszng\"]},{\"familyName\":\"p\",\"targetLocations\":[\"kvec\",\"ujcngo\"],\"category\":[\"edmzrgjfoknub\",\"oitpkpztrgdgx\"]},{\"familyName\":\"oqraswugyxpqi\",\"targetLocations\":[\"ialwv\",\"kbuhzaca\",\"ty\"],\"category\":[\"oqc\"]}],\"reservedInstanceVmFamilies\":[\"Dsv3_series\",\"Standard_A8_A11\",\"Ev5_series\"],\"premiumDiskVmFamilies\":[\"Unknown\",\"Fs_series\"],\"savingsPlanVmFamilies\":[\"Dav4_series\",\"Fs_series\"],\"savingsPlanSupportedLocations\":[\"GermanyNorth\"],\"savingsPlanSupportedLocationsForPaas\":[\"JapanEast\"],\"reservedInstanceSupportedLocationsForIaas\":[\"AustraliaCentral2\",\"CentralIndia\"],\"savingsPlanSupportedOffers\":[\"MSMCAZR0059P\",\"MSMCAZR0063P\",\"MSAZR0121P\",\"MSAZR0149P\"],\"sqlSkus\":[{\"computeTier\":\"Serverless\",\"hardwareGeneration\":\"Unknown\",\"targetType\":\"Recommended\",\"serviceTier\":\"Automatic\",\"targetLocations\":[\"UsSecWest\",\"GermanyNortheast\"]},{\"computeTier\":\"Serverless\",\"hardwareGeneration\":\"Automatic\",\"targetType\":\"AzureSqlVirtualMachine\",\"serviceTier\":\"GeneralPurpose\",\"targetLocations\":[\"WestUs\",\"ChinaNorth2\"]}],\"reservedInstanceSqlTargets\":[\"Unknown\",\"Recommended\",\"AzureSqlManagedInstance\",\"AzureVirtualMachine\"],\"reservedInstanceSupportedLocations\":[\"NorthEurope\",\"KoreaSouth\",\"WestIndia\",\"AustraliaCentral2\"],\"reservedInstanceSupportedCurrencies\":[\"BRL\",\"DKK\"],\"reservedInstanceSupportedOffers\":[\"MSAZRDE0044P\",\"MSMCAZR0044P\",\"MSMCAZR0128P\"],\"supportedOffers\":[\"MSMCAZR0044P\"]},\"id\":\"lialwcjgckbbcccg\",\"name\":\"praoxn\",\"type\":\"uffatsgftipwc\"}],\"nextLink\":\"yubhiqdx\"}") - .toObject(SqlAssessmentOptionsListResult.class); - Assertions.assertEquals(AzureVmFamily.DAV4_SERIES, - model.value().get(0).properties().savingsPlanVmFamilies().get(0)); - Assertions.assertEquals(AzureLocation.GERMANY_NORTH, - model.value().get(0).properties().savingsPlanSupportedLocations().get(0)); - Assertions.assertEquals(AzureLocation.JAPAN_EAST, - model.value().get(0).properties().savingsPlanSupportedLocationsForPaas().get(0)); - Assertions.assertEquals(AzureLocation.AUSTRALIA_CENTRAL2, - model.value().get(0).properties().reservedInstanceSupportedLocationsForIaas().get(0)); - Assertions.assertEquals(AzureOfferCode.MSMCAZR0059P, - model.value().get(0).properties().savingsPlanSupportedOffers().get(0)); - Assertions.assertEquals(ComputeTier.SERVERLESS, - model.value().get(0).properties().sqlSkus().get(0).computeTier()); - Assertions.assertEquals(HardwareGeneration.UNKNOWN, - model.value().get(0).properties().sqlSkus().get(0).hardwareGeneration()); - Assertions.assertEquals(TargetType.RECOMMENDED, - model.value().get(0).properties().sqlSkus().get(0).targetType()); - Assertions.assertEquals(AzureSqlServiceTier.AUTOMATIC, - model.value().get(0).properties().sqlSkus().get(0).serviceTier()); - Assertions.assertEquals(AzureLocation.US_SEC_WEST, - model.value().get(0).properties().sqlSkus().get(0).targetLocations().get(0)); - Assertions.assertEquals(TargetType.UNKNOWN, - model.value().get(0).properties().reservedInstanceSqlTargets().get(0)); - Assertions.assertEquals(AzureLocation.NORTH_EUROPE, - model.value().get(0).properties().reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.BRL, - model.value().get(0).properties().reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.MSAZRDE0044P, - model.value().get(0).properties().reservedInstanceSupportedOffers().get(0)); - Assertions.assertEquals(AzureOfferCode.MSMCAZR0044P, - model.value().get(0).properties().supportedOffers().get(0)); - Assertions.assertEquals("yubhiqdx", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlAssessmentOptionsListResult model = new SqlAssessmentOptionsListResult() - .withValue(Arrays.asList(new SqlAssessmentOptionsInner().withProperties(new SqlAssessmentOptionsProperties() - .withSavingsPlanVmFamilies(Arrays.asList(AzureVmFamily.DAV4_SERIES, AzureVmFamily.FS_SERIES)) - .withSavingsPlanSupportedLocations(Arrays.asList(AzureLocation.GERMANY_NORTH)) - .withSavingsPlanSupportedLocationsForPaas(Arrays.asList(AzureLocation.JAPAN_EAST)) - .withReservedInstanceSupportedLocationsForIaas( - Arrays.asList(AzureLocation.AUSTRALIA_CENTRAL2, AzureLocation.CENTRAL_INDIA)) - .withSavingsPlanSupportedOffers(Arrays.asList(AzureOfferCode.MSMCAZR0059P, AzureOfferCode.MSMCAZR0063P, - AzureOfferCode.MSAZR0121P, AzureOfferCode.MSAZR0149P)) - .withSqlSkus(Arrays.asList( - new SqlPaaSTargetOptions().withComputeTier(ComputeTier.SERVERLESS) - .withHardwareGeneration(HardwareGeneration.UNKNOWN) - .withTargetType(TargetType.RECOMMENDED) - .withServiceTier(AzureSqlServiceTier.AUTOMATIC) - .withTargetLocations(Arrays.asList(AzureLocation.US_SEC_WEST, AzureLocation.GERMANY_NORTHEAST)), - new SqlPaaSTargetOptions().withComputeTier(ComputeTier.SERVERLESS) - .withHardwareGeneration(HardwareGeneration.AUTOMATIC) - .withTargetType(TargetType.AZURE_SQL_VIRTUAL_MACHINE) - .withServiceTier(AzureSqlServiceTier.GENERAL_PURPOSE) - .withTargetLocations(Arrays.asList(AzureLocation.WEST_US, AzureLocation.CHINA_NORTH2)))) - .withReservedInstanceSqlTargets(Arrays.asList(TargetType.UNKNOWN, TargetType.RECOMMENDED, - TargetType.AZURE_SQL_MANAGED_INSTANCE, TargetType.AZURE_VIRTUAL_MACHINE)) - .withReservedInstanceSupportedLocations(Arrays.asList(AzureLocation.NORTH_EUROPE, - AzureLocation.KOREA_SOUTH, AzureLocation.WEST_INDIA, AzureLocation.AUSTRALIA_CENTRAL2)) - .withReservedInstanceSupportedCurrencies(Arrays.asList(AzureCurrency.BRL, AzureCurrency.DKK)) - .withReservedInstanceSupportedOffers(Arrays.asList(AzureOfferCode.MSAZRDE0044P, - AzureOfferCode.MSMCAZR0044P, AzureOfferCode.MSMCAZR0128P)) - .withSupportedOffers(Arrays.asList(AzureOfferCode.MSMCAZR0044P))))) - .withNextLink("yubhiqdx"); - model = BinaryData.fromObject(model).toObject(SqlAssessmentOptionsListResult.class); - Assertions.assertEquals(AzureVmFamily.DAV4_SERIES, - model.value().get(0).properties().savingsPlanVmFamilies().get(0)); - Assertions.assertEquals(AzureLocation.GERMANY_NORTH, - model.value().get(0).properties().savingsPlanSupportedLocations().get(0)); - Assertions.assertEquals(AzureLocation.JAPAN_EAST, - model.value().get(0).properties().savingsPlanSupportedLocationsForPaas().get(0)); - Assertions.assertEquals(AzureLocation.AUSTRALIA_CENTRAL2, - model.value().get(0).properties().reservedInstanceSupportedLocationsForIaas().get(0)); - Assertions.assertEquals(AzureOfferCode.MSMCAZR0059P, - model.value().get(0).properties().savingsPlanSupportedOffers().get(0)); - Assertions.assertEquals(ComputeTier.SERVERLESS, - model.value().get(0).properties().sqlSkus().get(0).computeTier()); - Assertions.assertEquals(HardwareGeneration.UNKNOWN, - model.value().get(0).properties().sqlSkus().get(0).hardwareGeneration()); - Assertions.assertEquals(TargetType.RECOMMENDED, - model.value().get(0).properties().sqlSkus().get(0).targetType()); - Assertions.assertEquals(AzureSqlServiceTier.AUTOMATIC, - model.value().get(0).properties().sqlSkus().get(0).serviceTier()); - Assertions.assertEquals(AzureLocation.US_SEC_WEST, - model.value().get(0).properties().sqlSkus().get(0).targetLocations().get(0)); - Assertions.assertEquals(TargetType.UNKNOWN, - model.value().get(0).properties().reservedInstanceSqlTargets().get(0)); - Assertions.assertEquals(AzureLocation.NORTH_EUROPE, - model.value().get(0).properties().reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.BRL, - model.value().get(0).properties().reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.MSAZRDE0044P, - model.value().get(0).properties().reservedInstanceSupportedOffers().get(0)); - Assertions.assertEquals(AzureOfferCode.MSMCAZR0044P, - model.value().get(0).properties().supportedOffers().get(0)); - Assertions.assertEquals("yubhiqdx", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsOperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsOperationsGetWithResponseMockTests.java deleted file mode 100644 index 2db413e8b7fc..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlServiceTier; -import com.azure.resourcemanager.migration.assessment.models.AzureVmFamily; -import com.azure.resourcemanager.migration.assessment.models.ComputeTier; -import com.azure.resourcemanager.migration.assessment.models.HardwareGeneration; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentOptions; -import com.azure.resourcemanager.migration.assessment.models.TargetType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SqlAssessmentOptionsOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"vmFamilies\":[{\"familyName\":\"fooy\",\"targetLocations\":[\"xdtzcqipsdudgco\",\"zomehxlantolam\"],\"category\":[\"juxkqll\"]},{\"familyName\":\"i\",\"targetLocations\":[\"dtgckzdqiqdlra\",\"rkwxo\",\"uwxsuykznhrfgsl\",\"lhpryjfzihuio\"],\"category\":[\"cpajtfe\",\"vkbdgddkrhdccxbe\"]}],\"reservedInstanceVmFamilies\":[\"Dasv5_series\",\"M_series\",\"Esv3_series\",\"Fs_series\"],\"premiumDiskVmFamilies\":[\"Esv5_series\",\"F_series\"],\"savingsPlanVmFamilies\":[\"Dasv4_series\",\"M_series\"],\"savingsPlanSupportedLocations\":[\"SouthIndia\",\"AustraliaCentral\",\"WestUs\",\"UsNatWest\"],\"savingsPlanSupportedLocationsForPaas\":[\"ChinaEast2\",\"UAECentral\",\"AustraliaEast\"],\"reservedInstanceSupportedLocationsForIaas\":[\"SwitzerlandWest\",\"UsSecWest\",\"KoreaCentral\"],\"savingsPlanSupportedOffers\":[\"MSMCAZR0060P\",\"MSAZR0060P\",\"MSAZR0025P\"],\"sqlSkus\":[{\"computeTier\":\"Serverless\",\"hardwareGeneration\":\"Unknown\",\"targetType\":\"AzureSqlVirtualMachine\",\"serviceTier\":\"Unknown\",\"targetLocations\":[\"QatarCentral\",\"AustraliaCentral2\",\"UkWest\",\"FranceSouth\"]},{\"computeTier\":\"Unknown\",\"hardwareGeneration\":\"Fsv2_series\",\"targetType\":\"Recommended\",\"serviceTier\":\"GeneralPurpose\",\"targetLocations\":[\"WestCentralUs\",\"USGovVirginia\",\"CentralIndia\"]}],\"reservedInstanceSqlTargets\":[\"AzureSqlDatabase\"],\"reservedInstanceSupportedLocations\":[\"KoreaSouth\",\"JapanEast\",\"USGovArizona\"],\"reservedInstanceSupportedCurrencies\":[\"BRL\",\"KRW\"],\"reservedInstanceSupportedOffers\":[\"MSMCAZR0060P\",\"MSAZR0111P\",\"MSAZRUSGOV0003P\",\"MSAZR0243P\"],\"supportedOffers\":[\"MSAZR0243P\"]},\"id\":\"rptvcshtkutzcttb\",\"name\":\"gdirda\",\"type\":\"m\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - SqlAssessmentOptions response = manager.sqlAssessmentOptionsOperations() - .getWithResponse("eiwtczkdd", "vovbooqbmdqrx", "glaetscflwtjd", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AzureVmFamily.DASV4_SERIES, response.properties().savingsPlanVmFamilies().get(0)); - Assertions.assertEquals(AzureLocation.SOUTH_INDIA, - response.properties().savingsPlanSupportedLocations().get(0)); - Assertions.assertEquals(AzureLocation.CHINA_EAST2, - response.properties().savingsPlanSupportedLocationsForPaas().get(0)); - Assertions.assertEquals(AzureLocation.SWITZERLAND_WEST, - response.properties().reservedInstanceSupportedLocationsForIaas().get(0)); - Assertions.assertEquals(AzureOfferCode.MSMCAZR0060P, response.properties().savingsPlanSupportedOffers().get(0)); - Assertions.assertEquals(ComputeTier.SERVERLESS, response.properties().sqlSkus().get(0).computeTier()); - Assertions.assertEquals(HardwareGeneration.UNKNOWN, - response.properties().sqlSkus().get(0).hardwareGeneration()); - Assertions.assertEquals(TargetType.AZURE_SQL_VIRTUAL_MACHINE, - response.properties().sqlSkus().get(0).targetType()); - Assertions.assertEquals(AzureSqlServiceTier.UNKNOWN, response.properties().sqlSkus().get(0).serviceTier()); - Assertions.assertEquals(AzureLocation.QATAR_CENTRAL, - response.properties().sqlSkus().get(0).targetLocations().get(0)); - Assertions.assertEquals(TargetType.AZURE_SQL_DATABASE, - response.properties().reservedInstanceSqlTargets().get(0)); - Assertions.assertEquals(AzureLocation.KOREA_SOUTH, - response.properties().reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.BRL, response.properties().reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.MSMCAZR0060P, - response.properties().reservedInstanceSupportedOffers().get(0)); - Assertions.assertEquals(AzureOfferCode.MSAZR0243P, response.properties().supportedOffers().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsOperationsListByAssessmentProjectMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsOperationsListByAssessmentProjectMockTests.java deleted file mode 100644 index c7b55fb034d4..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsOperationsListByAssessmentProjectMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlServiceTier; -import com.azure.resourcemanager.migration.assessment.models.AzureVmFamily; -import com.azure.resourcemanager.migration.assessment.models.ComputeTier; -import com.azure.resourcemanager.migration.assessment.models.HardwareGeneration; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentOptions; -import com.azure.resourcemanager.migration.assessment.models.TargetType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SqlAssessmentOptionsOperationsListByAssessmentProjectMockTests { - @Test - public void testListByAssessmentProject() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"vmFamilies\":[{\"familyName\":\"ofuworimmovzwde\",\"targetLocations\":[\"mvhzfovanyrvaprt\",\"elgwewi\"],\"category\":[\"aq\",\"ndmymnqoqjumov\",\"fbpbvzopaxmfmvsm\",\"woxfaxdtnqifbsa\"]},{\"familyName\":\"oiauesugmocpcj\",\"targetLocations\":[\"oelrgttwfl\"],\"category\":[\"uorinikcedpk\",\"riwmmtmqrxrzqv\",\"yczyayubtgm\"]}],\"reservedInstanceVmFamilies\":[\"Eav4_series\",\"Dv3_series\",\"Unknown\"],\"premiumDiskVmFamilies\":[\"Unknown\"],\"savingsPlanVmFamilies\":[\"Ev4_series\",\"Dv5_series\"],\"savingsPlanSupportedLocations\":[\"BrazilSouth\",\"UsSecEast\",\"ChinaNorth\"],\"savingsPlanSupportedLocationsForPaas\":[\"NorwayWest\"],\"reservedInstanceSupportedLocationsForIaas\":[\"WestCentralUs\",\"SwitzerlandWest\",\"ChinaNorth\"],\"savingsPlanSupportedOffers\":[\"MSAZR0122P\"],\"sqlSkus\":[{\"computeTier\":\"Unknown\",\"hardwareGeneration\":\"DC_series\",\"targetType\":\"AzureVirtualMachine\",\"serviceTier\":\"Unknown\",\"targetLocations\":[\"USGovIowa\",\"QatarCentral\"]},{\"computeTier\":\"Serverless\",\"hardwareGeneration\":\"Gen5\",\"targetType\":\"AzureSqlVirtualMachine\",\"serviceTier\":\"BusinessCritical\",\"targetLocations\":[\"USGovVirginia\",\"AustraliaSoutheast\",\"WestUs2\",\"SwitzerlandNorth\"]}],\"reservedInstanceSqlTargets\":[\"AzureVirtualMachine\",\"AzureVirtualMachine\"],\"reservedInstanceSupportedLocations\":[\"FranceSouth\",\"UsSecEast\",\"EastUs\"],\"reservedInstanceSupportedCurrencies\":[\"NZD\",\"BRL\"],\"reservedInstanceSupportedOffers\":[\"MSAZR0063P\",\"MSAZR0149P\",\"MSAZR0063P\"],\"supportedOffers\":[\"MSAZR0124P\",\"MSAZR0127P\"]},\"id\":\"faryrvjlg\",\"name\":\"ezvjq\",\"type\":\"ahoyiyaxqvj\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.sqlAssessmentOptionsOperations() - .listByAssessmentProject("dvatlzmgschn", "rsbkkzovlzdmnfmf", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AzureVmFamily.EV4_SERIES, - response.iterator().next().properties().savingsPlanVmFamilies().get(0)); - Assertions.assertEquals(AzureLocation.BRAZIL_SOUTH, - response.iterator().next().properties().savingsPlanSupportedLocations().get(0)); - Assertions.assertEquals(AzureLocation.NORWAY_WEST, - response.iterator().next().properties().savingsPlanSupportedLocationsForPaas().get(0)); - Assertions.assertEquals(AzureLocation.WEST_CENTRAL_US, - response.iterator().next().properties().reservedInstanceSupportedLocationsForIaas().get(0)); - Assertions.assertEquals(AzureOfferCode.MSAZR0122P, - response.iterator().next().properties().savingsPlanSupportedOffers().get(0)); - Assertions.assertEquals(ComputeTier.UNKNOWN, - response.iterator().next().properties().sqlSkus().get(0).computeTier()); - Assertions.assertEquals(HardwareGeneration.DC_SERIES, - response.iterator().next().properties().sqlSkus().get(0).hardwareGeneration()); - Assertions.assertEquals(TargetType.AZURE_VIRTUAL_MACHINE, - response.iterator().next().properties().sqlSkus().get(0).targetType()); - Assertions.assertEquals(AzureSqlServiceTier.UNKNOWN, - response.iterator().next().properties().sqlSkus().get(0).serviceTier()); - Assertions.assertEquals(AzureLocation.USGOV_IOWA, - response.iterator().next().properties().sqlSkus().get(0).targetLocations().get(0)); - Assertions.assertEquals(TargetType.AZURE_VIRTUAL_MACHINE, - response.iterator().next().properties().reservedInstanceSqlTargets().get(0)); - Assertions.assertEquals(AzureLocation.FRANCE_SOUTH, - response.iterator().next().properties().reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.NZD, - response.iterator().next().properties().reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.MSAZR0063P, - response.iterator().next().properties().reservedInstanceSupportedOffers().get(0)); - Assertions.assertEquals(AzureOfferCode.MSAZR0124P, - response.iterator().next().properties().supportedOffers().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsPropertiesTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsPropertiesTests.java deleted file mode 100644 index 21bef70e7578..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentOptionsPropertiesTests.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AzureCurrency; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import com.azure.resourcemanager.migration.assessment.models.AzureOfferCode; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlServiceTier; -import com.azure.resourcemanager.migration.assessment.models.AzureVmFamily; -import com.azure.resourcemanager.migration.assessment.models.ComputeTier; -import com.azure.resourcemanager.migration.assessment.models.HardwareGeneration; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentOptionsProperties; -import com.azure.resourcemanager.migration.assessment.models.SqlPaaSTargetOptions; -import com.azure.resourcemanager.migration.assessment.models.TargetType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SqlAssessmentOptionsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlAssessmentOptionsProperties model = BinaryData.fromString( - "{\"vmFamilies\":[{\"familyName\":\"ottaw\",\"targetLocations\":[\"sxwwhnhjtf\"],\"category\":[\"dpmiljpn\"]},{\"familyName\":\"nudqllz\",\"targetLocations\":[\"zp\",\"lxeehuxiq\",\"zlrayme\"],\"category\":[\"skihmxrfd\",\"ajrednwyyshtuw\",\"mevuafpwzy\",\"frkgwltxeq\"]}],\"reservedInstanceVmFamilies\":[\"Eadsv5_series\",\"Dasv4_series\",\"Ebdsv5_series\",\"Standard_A8_A11\"],\"premiumDiskVmFamilies\":[\"GS_series\",\"Ev3_series\",\"Easv4_series\"],\"savingsPlanVmFamilies\":[\"Ls_series\",\"Dadsv5_series\",\"Ddsv5_series\"],\"savingsPlanSupportedLocations\":[\"CentralUs\"],\"savingsPlanSupportedLocationsForPaas\":[\"GermanyWestCentral\"],\"reservedInstanceSupportedLocationsForIaas\":[\"KoreaSouth\"],\"savingsPlanSupportedOffers\":[\"MSMCAZR0120P\",\"MSAZRUSGOV0003P\",\"MSAZR0036P\",\"MSAZR0122P\"],\"sqlSkus\":[{\"computeTier\":\"Provisioned\",\"hardwareGeneration\":\"Unknown\",\"targetType\":\"AzureSqlVirtualMachine\",\"serviceTier\":\"BusinessCritical\",\"targetLocations\":[\"JapanWest\",\"AustraliaCentral\",\"SwitzerlandNorth\",\"FranceSouth\"]},{\"computeTier\":\"Provisioned\",\"hardwareGeneration\":\"Fsv2_series\",\"targetType\":\"Unknown\",\"serviceTier\":\"Unknown\",\"targetLocations\":[\"ChinaEast2\",\"CanadaEast\",\"SouthCentralUs\",\"AustraliaCentral2\"]},{\"computeTier\":\"Serverless\",\"hardwareGeneration\":\"Unknown\",\"targetType\":\"Unknown\",\"serviceTier\":\"BusinessCritical\",\"targetLocations\":[\"UAENorth\"]},{\"computeTier\":\"Serverless\",\"hardwareGeneration\":\"DC_series\",\"targetType\":\"AzureVirtualMachine\",\"serviceTier\":\"BusinessCritical\",\"targetLocations\":[\"ChinaEast2\",\"GermanyWestCentral\"]}],\"reservedInstanceSqlTargets\":[\"AzureSqlDatabase\",\"AzureSqlManagedInstance\"],\"reservedInstanceSupportedLocations\":[\"SouthIndia\",\"JapanEast\"],\"reservedInstanceSupportedCurrencies\":[\"MYR\"],\"reservedInstanceSupportedOffers\":[\"MSAZR0128P\",\"MSAZR0025P\"],\"supportedOffers\":[\"MSMCAZR0044P\",\"MSMCAZR0059P\",\"MSMCAZR0044P\",\"MSAZR0148P\"]}") - .toObject(SqlAssessmentOptionsProperties.class); - Assertions.assertEquals(AzureVmFamily.LS_SERIES, model.savingsPlanVmFamilies().get(0)); - Assertions.assertEquals(AzureLocation.CENTRAL_US, model.savingsPlanSupportedLocations().get(0)); - Assertions.assertEquals(AzureLocation.GERMANY_WEST_CENTRAL, - model.savingsPlanSupportedLocationsForPaas().get(0)); - Assertions.assertEquals(AzureLocation.KOREA_SOUTH, model.reservedInstanceSupportedLocationsForIaas().get(0)); - Assertions.assertEquals(AzureOfferCode.MSMCAZR0120P, model.savingsPlanSupportedOffers().get(0)); - Assertions.assertEquals(ComputeTier.PROVISIONED, model.sqlSkus().get(0).computeTier()); - Assertions.assertEquals(HardwareGeneration.UNKNOWN, model.sqlSkus().get(0).hardwareGeneration()); - Assertions.assertEquals(TargetType.AZURE_SQL_VIRTUAL_MACHINE, model.sqlSkus().get(0).targetType()); - Assertions.assertEquals(AzureSqlServiceTier.BUSINESS_CRITICAL, model.sqlSkus().get(0).serviceTier()); - Assertions.assertEquals(AzureLocation.JAPAN_WEST, model.sqlSkus().get(0).targetLocations().get(0)); - Assertions.assertEquals(TargetType.AZURE_SQL_DATABASE, model.reservedInstanceSqlTargets().get(0)); - Assertions.assertEquals(AzureLocation.SOUTH_INDIA, model.reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.MYR, model.reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.MSAZR0128P, model.reservedInstanceSupportedOffers().get(0)); - Assertions.assertEquals(AzureOfferCode.MSMCAZR0044P, model.supportedOffers().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlAssessmentOptionsProperties model = new SqlAssessmentOptionsProperties() - .withSavingsPlanVmFamilies( - Arrays.asList(AzureVmFamily.LS_SERIES, AzureVmFamily.DADSV5_SERIES, AzureVmFamily.DDSV5_SERIES)) - .withSavingsPlanSupportedLocations(Arrays.asList(AzureLocation.CENTRAL_US)) - .withSavingsPlanSupportedLocationsForPaas(Arrays.asList(AzureLocation.GERMANY_WEST_CENTRAL)) - .withReservedInstanceSupportedLocationsForIaas(Arrays.asList(AzureLocation.KOREA_SOUTH)) - .withSavingsPlanSupportedOffers(Arrays.asList(AzureOfferCode.MSMCAZR0120P, AzureOfferCode.MSAZRUSGOV0003P, - AzureOfferCode.MSAZR0036P, AzureOfferCode.MSAZR0122P)) - .withSqlSkus(Arrays.asList( - new SqlPaaSTargetOptions().withComputeTier(ComputeTier.PROVISIONED) - .withHardwareGeneration(HardwareGeneration.UNKNOWN) - .withTargetType(TargetType.AZURE_SQL_VIRTUAL_MACHINE) - .withServiceTier(AzureSqlServiceTier.BUSINESS_CRITICAL) - .withTargetLocations(Arrays.asList(AzureLocation.JAPAN_WEST, AzureLocation.AUSTRALIA_CENTRAL, - AzureLocation.SWITZERLAND_NORTH, AzureLocation.FRANCE_SOUTH)), - new SqlPaaSTargetOptions().withComputeTier(ComputeTier.PROVISIONED) - .withHardwareGeneration(HardwareGeneration.FSV2_SERIES) - .withTargetType(TargetType.UNKNOWN) - .withServiceTier(AzureSqlServiceTier.UNKNOWN) - .withTargetLocations(Arrays.asList(AzureLocation.CHINA_EAST2, AzureLocation.CANADA_EAST, - AzureLocation.SOUTH_CENTRAL_US, AzureLocation.AUSTRALIA_CENTRAL2)), - new SqlPaaSTargetOptions().withComputeTier(ComputeTier.SERVERLESS) - .withHardwareGeneration(HardwareGeneration.UNKNOWN) - .withTargetType(TargetType.UNKNOWN) - .withServiceTier(AzureSqlServiceTier.BUSINESS_CRITICAL) - .withTargetLocations(Arrays.asList(AzureLocation.UAENORTH)), - new SqlPaaSTargetOptions().withComputeTier(ComputeTier.SERVERLESS) - .withHardwareGeneration(HardwareGeneration.DC_SERIES) - .withTargetType(TargetType.AZURE_VIRTUAL_MACHINE) - .withServiceTier(AzureSqlServiceTier.BUSINESS_CRITICAL) - .withTargetLocations(Arrays.asList(AzureLocation.CHINA_EAST2, AzureLocation.GERMANY_WEST_CENTRAL)))) - .withReservedInstanceSqlTargets( - Arrays.asList(TargetType.AZURE_SQL_DATABASE, TargetType.AZURE_SQL_MANAGED_INSTANCE)) - .withReservedInstanceSupportedLocations(Arrays.asList(AzureLocation.SOUTH_INDIA, AzureLocation.JAPAN_EAST)) - .withReservedInstanceSupportedCurrencies(Arrays.asList(AzureCurrency.MYR)) - .withReservedInstanceSupportedOffers(Arrays.asList(AzureOfferCode.MSAZR0128P, AzureOfferCode.MSAZR0025P)) - .withSupportedOffers(Arrays.asList(AzureOfferCode.MSMCAZR0044P, AzureOfferCode.MSMCAZR0059P, - AzureOfferCode.MSMCAZR0044P, AzureOfferCode.MSAZR0148P)); - model = BinaryData.fromObject(model).toObject(SqlAssessmentOptionsProperties.class); - Assertions.assertEquals(AzureVmFamily.LS_SERIES, model.savingsPlanVmFamilies().get(0)); - Assertions.assertEquals(AzureLocation.CENTRAL_US, model.savingsPlanSupportedLocations().get(0)); - Assertions.assertEquals(AzureLocation.GERMANY_WEST_CENTRAL, - model.savingsPlanSupportedLocationsForPaas().get(0)); - Assertions.assertEquals(AzureLocation.KOREA_SOUTH, model.reservedInstanceSupportedLocationsForIaas().get(0)); - Assertions.assertEquals(AzureOfferCode.MSMCAZR0120P, model.savingsPlanSupportedOffers().get(0)); - Assertions.assertEquals(ComputeTier.PROVISIONED, model.sqlSkus().get(0).computeTier()); - Assertions.assertEquals(HardwareGeneration.UNKNOWN, model.sqlSkus().get(0).hardwareGeneration()); - Assertions.assertEquals(TargetType.AZURE_SQL_VIRTUAL_MACHINE, model.sqlSkus().get(0).targetType()); - Assertions.assertEquals(AzureSqlServiceTier.BUSINESS_CRITICAL, model.sqlSkus().get(0).serviceTier()); - Assertions.assertEquals(AzureLocation.JAPAN_WEST, model.sqlSkus().get(0).targetLocations().get(0)); - Assertions.assertEquals(TargetType.AZURE_SQL_DATABASE, model.reservedInstanceSqlTargets().get(0)); - Assertions.assertEquals(AzureLocation.SOUTH_INDIA, model.reservedInstanceSupportedLocations().get(0)); - Assertions.assertEquals(AzureCurrency.MYR, model.reservedInstanceSupportedCurrencies().get(0)); - Assertions.assertEquals(AzureOfferCode.MSAZR0128P, model.reservedInstanceSupportedOffers().get(0)); - Assertions.assertEquals(AzureOfferCode.MSMCAZR0044P, model.supportedOffers().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsDeleteWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsDeleteWithResponseMockTests.java deleted file mode 100644 index 8b6431fba894..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SqlAssessmentV2OperationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.sqlAssessmentV2Operations() - .deleteWithResponse("cirtn", "emmjauwcg", "efnoh", "itranizerwguda", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsDownloadUrlMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsDownloadUrlMockTests.java deleted file mode 100644 index 65551c5234c9..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2OperationsDownloadUrlMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.DownloadUrl; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SqlAssessmentV2OperationsDownloadUrlMockTests { - @Test - public void testDownloadUrl() throws Exception { - String responseStr - = "{\"assessmentReportUrl\":\"tmojhvrztnvgyshq\",\"expirationTime\":\"2021-01-12T06:13:47Z\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - DownloadUrl response = manager.sqlAssessmentV2Operations() - .downloadUrl("mxubvfbngfcoce", "hpriylfm", "ztraud", "vhl", "datadculregp", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryDataTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryDataTests.java deleted file mode 100644 index 518ec9dfe196..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryDataTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2SummaryData; - -public final class SqlAssessmentV2SummaryDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlAssessmentV2SummaryData model = BinaryData.fromString( - "{\"suitabilitySummary\":{\"ydrtc\":1327503976},\"monthlyComputeCost\":58.1101,\"monthlyStorageCost\":80.28519,\"monthlyLicenseCost\":8.106685,\"confidenceScore\":93.98728,\"monthlySecurityCost\":78.215355}") - .toObject(SqlAssessmentV2SummaryData.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlAssessmentV2SummaryData model = new SqlAssessmentV2SummaryData(); - model = BinaryData.fromObject(model).toObject(SqlAssessmentV2SummaryData.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryInnerTests.java deleted file mode 100644 index 55c6b0510a91..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV2SummaryInner; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2SummaryProperties; - -public final class SqlAssessmentV2SummaryInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlAssessmentV2SummaryInner model = BinaryData.fromString( - "{\"properties\":{\"assessmentSummary\":{\"gbgatzuuvbxn\":{\"suitabilitySummary\":{\"zqddtjwfljhzn\":1142415725,\"tuatmzwcj\":1931902052},\"monthlyComputeCost\":38.441837,\"monthlyStorageCost\":26.924026,\"monthlyLicenseCost\":2.3001134,\"confidenceScore\":18.954992,\"monthlySecurityCost\":84.98299},\"buocnjr\":{\"suitabilitySummary\":{\"wggahttzlswvaj\":2004295081,\"utlxjoqzasunwqrj\":505799405},\"monthlyComputeCost\":10.120636,\"monthlyStorageCost\":9.708929,\"monthlyLicenseCost\":59.0353,\"confidenceScore\":93.65819,\"monthlySecurityCost\":76.53575}},\"distributionBySupportStatus\":{\"py\":947492752,\"xameblydyvkfkm\":345056538,\"cxneh\":1201286902,\"mtodl\":400790615},\"distributionByServicePackInsight\":{\"pucygvoavyunss\":1892666564,\"ghiee\":2011344942,\"lgvvpaseksgbu\":230828821},\"distributionBySqlVersion\":{\"uygdhgaqipirp\":435496231,\"rqofulopmjnlexwh\":779964189,\"jpib\":811615068,\"phuuuerctato\":151309152},\"distributionBySqlEdition\":{\"qpbrlc\":1997384455,\"duczkgof\":1276551040},\"instanceDistributionBySizingCriterion\":{\"rucvcrrpcjttbs\":1320256014,\"jeaq\":2056089114},\"databaseDistributionBySizingCriterion\":{\"vfkoxml\":719536452,\"ktuidvrm\":508390105},\"numberOfMachines\":1771864251,\"numberOfSqlInstances\":1980965874,\"numberOfSuccessfullyDiscoveredSqlInstances\":621685940,\"numberOfSqlDatabases\":1574301649,\"numberOfFciInstances\":475011080,\"numberOfSqlAvailabilityGroups\":2021473351},\"id\":\"azipbhpwvqsg\",\"name\":\"yy\",\"type\":\"uzivensrpmeyyvp\"}") - .toObject(SqlAssessmentV2SummaryInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlAssessmentV2SummaryInner model - = new SqlAssessmentV2SummaryInner().withProperties(new SqlAssessmentV2SummaryProperties()); - model = BinaryData.fromObject(model).toObject(SqlAssessmentV2SummaryInner.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryListResultTests.java deleted file mode 100644 index 8c065a0b298a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryListResultTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlAssessmentV2SummaryInner; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2SummaryListResult; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2SummaryProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SqlAssessmentV2SummaryListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlAssessmentV2SummaryListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"assessmentSummary\":{\"nbkkjanurnnq\":{\"suitabilitySummary\":{\"xzji\":360585194,\"vuaurk\":179847946,\"ci\":781335273},\"monthlyComputeCost\":42.100155,\"monthlyStorageCost\":6.386435,\"monthlyLicenseCost\":59.72503,\"confidenceScore\":4.9952865,\"monthlySecurityCost\":36.149452},\"vctafsrb\":{\"suitabilitySummary\":{\"pizxqltgrdogyp\":535354048},\"monthlyComputeCost\":4.0882587,\"monthlyStorageCost\":25.938343,\"monthlyLicenseCost\":96.1939,\"confidenceScore\":15.696883,\"monthlySecurityCost\":30.422241},\"wqagnepzwa\":{\"suitabilitySummary\":{\"m\":1897800975},\"monthlyComputeCost\":26.815706,\"monthlyStorageCost\":52.668564,\"monthlyLicenseCost\":76.475235,\"confidenceScore\":3.0665696,\"monthlySecurityCost\":61.442966},\"zisglrrczezkhh\":{\"suitabilitySummary\":{\"sbq\":2052489280},\"monthlyComputeCost\":53.993744,\"monthlyStorageCost\":74.66148,\"monthlyLicenseCost\":91.80716,\"confidenceScore\":9.611225,\"monthlySecurityCost\":10.501474}},\"distributionBySupportStatus\":{\"adhqoa\":244052018},\"distributionByServicePackInsight\":{\"yueayfbpcmsp\":1275493501,\"yrrueqth\":152044099,\"gnmbscbbxigdhx\":479605196,\"d\":909175637},\"distributionBySqlVersion\":{\"dbwdpyqyybxubmdn\":904820675,\"cbq\":935812516,\"e\":949316725},\"distributionBySqlEdition\":{\"aqacigeleohd\":434183344},\"instanceDistributionBySizingCriterion\":{\"wzkjopwbeonrlkw\":1335444948,\"qybxceakxcp\":1224778046,\"oqfyiaseqch\":1877879239,\"ttzrazisgyki\":1352449329},\"databaseDistributionBySizingCriterion\":{\"anbwzohmnrxxbso\":1663489412,\"linhmdptysprqs\":1529419314},\"numberOfMachines\":205223358,\"numberOfSqlInstances\":1772909914,\"numberOfSuccessfullyDiscoveredSqlInstances\":1747064559,\"numberOfSqlDatabases\":70597241,\"numberOfFciInstances\":990938401,\"numberOfSqlAvailabilityGroups\":252558767},\"id\":\"liufiqwoyxq\",\"name\":\"apcohhouc\",\"type\":\"pqojxcx\"}],\"nextLink\":\"zdcgdzbenr\"}") - .toObject(SqlAssessmentV2SummaryListResult.class); - Assertions.assertEquals("zdcgdzbenr", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlAssessmentV2SummaryListResult model = new SqlAssessmentV2SummaryListResult() - .withValue( - Arrays.asList(new SqlAssessmentV2SummaryInner().withProperties(new SqlAssessmentV2SummaryProperties()))) - .withNextLink("zdcgdzbenr"); - model = BinaryData.fromObject(model).toObject(SqlAssessmentV2SummaryListResult.class); - Assertions.assertEquals("zdcgdzbenr", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryOperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryOperationsGetWithResponseMockTests.java deleted file mode 100644 index 575575c28379..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2Summary; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SqlAssessmentV2SummaryOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"assessmentSummary\":{\"uoorssatfybipufd\":{\"suitabilitySummary\":{\"jobzrfp\":1468320932,\"zdcqhyftcvb\":478729922},\"monthlyComputeCost\":56.466736,\"monthlyStorageCost\":1.3600409,\"monthlyLicenseCost\":11.365062,\"confidenceScore\":87.35244,\"monthlySecurityCost\":36.231476},\"pbtsixhgvbhxmnd\":{\"suitabilitySummary\":{\"bd\":1239120549,\"as\":1806172168},\"monthlyComputeCost\":81.84618,\"monthlyStorageCost\":4.6119747,\"monthlyLicenseCost\":68.0381,\"confidenceScore\":87.68802,\"monthlySecurityCost\":58.643806},\"ynosugkfhaxt\":{\"suitabilitySummary\":{\"q\":1653739504,\"yqmarxneib\":2044971910,\"brhbjdqknhqn\":1864849199,\"tpuwnnohmmzngocf\":1072575893},\"monthlyComputeCost\":79.477905,\"monthlyStorageCost\":60.40357,\"monthlyLicenseCost\":48.387802,\"confidenceScore\":97.191414,\"monthlySecurityCost\":22.06496}},\"distributionBySupportStatus\":{\"mwgsghq\":1634063639},\"distributionByServicePackInsight\":{\"lddauqmllfe\":982301337,\"hxuarig\":1031526761,\"dlj\":973089478,\"q\":2017658706},\"distributionBySqlVersion\":{\"bzkuastaxklpr\":618485084,\"l\":73703412},\"distributionBySqlEdition\":{\"oizwxvs\":208213223},\"instanceDistributionBySizingCriterion\":{\"fyy\":1134538169},\"databaseDistributionBySizingCriterion\":{\"kgaf\":1229970273,\"z\":1442778266},\"numberOfMachines\":241765250,\"numberOfSqlInstances\":1019734668,\"numberOfSuccessfullyDiscoveredSqlInstances\":327817901,\"numberOfSqlDatabases\":1900107834,\"numberOfFciInstances\":699440843,\"numberOfSqlAvailabilityGroups\":1580992750},\"id\":\"eszr\",\"name\":\"lhpdhwynctaczcnj\",\"type\":\"mbbfnv\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - SqlAssessmentV2Summary response = manager.sqlAssessmentV2SummaryOperations() - .getWithResponse("abdxfkuzb", "jecooyvhtu", "bpelniibncgagd", "cdqhftz", "pyfaofdfp", - com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryOperationsListBySqlAssessmentV2MockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryOperationsListBySqlAssessmentV2MockTests.java deleted file mode 100644 index c9f8bf867427..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryOperationsListBySqlAssessmentV2MockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2Summary; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SqlAssessmentV2SummaryOperationsListBySqlAssessmentV2MockTests { - @Test - public void testListBySqlAssessmentV2() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"assessmentSummary\":{\"ghnysvlpyeuu\":{\"suitabilitySummary\":{\"fk\":375029538,\"utibhlen\":1683631682,\"rvrk\":41830882},\"monthlyComputeCost\":21.447247,\"monthlyStorageCost\":1.8556774,\"monthlyLicenseCost\":51.31923,\"confidenceScore\":38.36888,\"monthlySecurityCost\":54.251736}},\"distributionBySupportStatus\":{\"ixqbolxvhhyqqeg\":1357963026,\"xgrzn\":1380260544,\"inmtsdixchwkibm\":540272069},\"distributionByServicePackInsight\":{\"ncjcag\":844595957,\"rwcqzo\":1766031205},\"distributionBySqlVersion\":{\"qjsvep\":1973070159,\"htleberpyljek\":303598295},\"distributionBySqlEdition\":{\"wjjqxowkdnjrx\":84522132,\"rhw\":1710147308},\"instanceDistributionBySizingCriterion\":{\"cpnowaw\":1916974086,\"oehrguqlhfwafbj\":1220851428,\"pyrgu\":377008762,\"azbkocbygvthrmxk\":1867492168},\"databaseDistributionBySizingCriterion\":{\"wdxomrawp\":349878823},\"numberOfMachines\":1860244201,\"numberOfSqlInstances\":691230543,\"numberOfSuccessfullyDiscoveredSqlInstances\":371950285,\"numberOfSqlDatabases\":53530423,\"numberOfFciInstances\":1435608560,\"numberOfSqlAvailabilityGroups\":1885342737},\"id\":\"aeda\",\"name\":\"i\",\"type\":\"clmgdtw\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.sqlAssessmentV2SummaryOperations() - .listBySqlAssessmentV2("jeuxsphlo", "fpmijpdvzvfbhwbd", "ufvcgnrgl", "qrwyambh", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryPropertiesTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryPropertiesTests.java deleted file mode 100644 index 45bd156e8fab..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAssessmentV2SummaryPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.SqlAssessmentV2SummaryProperties; - -public final class SqlAssessmentV2SummaryPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlAssessmentV2SummaryProperties model = BinaryData.fromString( - "{\"assessmentSummary\":{\"ajlfnthiqfyu\":{\"suitabilitySummary\":{\"ijp\":806090947,\"sksrfhfvolmknbn\":1945803494,\"cdommpvfqaw\":1021190323,\"gbrt\":1577393635},\"monthlyComputeCost\":13.88855,\"monthlyStorageCost\":62.33673,\"monthlyLicenseCost\":82.40468,\"confidenceScore\":49.691647,\"monthlySecurityCost\":31.652159}},\"distributionBySupportStatus\":{\"ygbpvnwswmt\":1631679355,\"yctww\":187719631,\"wxjlmec\":1491153884,\"gygzyvn\":510904775},\"distributionByServicePackInsight\":{\"ifgh\":772641091,\"oqqtl\":1019718195,\"hzbkrkjj\":1376045590,\"vfqnvhnqoewdo\":2022925418},\"distributionBySqlVersion\":{\"tesypvidbztjh\":2090110021,\"fbov\":74741921},\"distributionBySqlEdition\":{\"bwetnjuhpsp\":1612160914},\"instanceDistributionBySizingCriterion\":{\"aupia\":1546479219,\"xnafbw\":1005928957},\"databaseDistributionBySizingCriterion\":{\"htuov\":979206753,\"onurjtumghihpv\":339434421,\"mslclblyjxlt\":1685318113,\"juscvsfx\":1682487538},\"numberOfMachines\":1616664129,\"numberOfSqlInstances\":1008970730,\"numberOfSuccessfullyDiscoveredSqlInstances\":495815281,\"numberOfSqlDatabases\":1067127377,\"numberOfFciInstances\":45764322,\"numberOfSqlAvailabilityGroups\":272878773}") - .toObject(SqlAssessmentV2SummaryProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlAssessmentV2SummaryProperties model = new SqlAssessmentV2SummaryProperties(); - model = BinaryData.fromObject(model).toObject(SqlAssessmentV2SummaryProperties.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAvailabilityGroupDataOverviewTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAvailabilityGroupDataOverviewTests.java deleted file mode 100644 index 92a206994d68..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAvailabilityGroupDataOverviewTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.SqlAvailabilityGroupDataOverview; -import org.junit.jupiter.api.Assertions; - -public final class SqlAvailabilityGroupDataOverviewTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlAvailabilityGroupDataOverview model = BinaryData.fromString( - "{\"availabilityGroupId\":\"ypsxjvfoim\",\"availabilityGroupName\":\"slirciz\",\"sqlAvailabilityGroupSdsArmId\":\"vydfceacvlhvygdy\",\"sqlAvailabilityGroupEntityId\":\"umrtwnawjsl\",\"sqlAvailabilityReplicaId\":\"wkojgcyztsfmzn\"}") - .toObject(SqlAvailabilityGroupDataOverview.class); - Assertions.assertEquals("ypsxjvfoim", model.availabilityGroupId()); - Assertions.assertEquals("slirciz", model.availabilityGroupName()); - Assertions.assertEquals("vydfceacvlhvygdy", model.sqlAvailabilityGroupSdsArmId()); - Assertions.assertEquals("umrtwnawjsl", model.sqlAvailabilityGroupEntityId()); - Assertions.assertEquals("wkojgcyztsfmzn", model.sqlAvailabilityReplicaId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlAvailabilityGroupDataOverview model - = new SqlAvailabilityGroupDataOverview().withAvailabilityGroupId("ypsxjvfoim") - .withAvailabilityGroupName("slirciz") - .withSqlAvailabilityGroupSdsArmId("vydfceacvlhvygdy") - .withSqlAvailabilityGroupEntityId("umrtwnawjsl") - .withSqlAvailabilityReplicaId("wkojgcyztsfmzn"); - model = BinaryData.fromObject(model).toObject(SqlAvailabilityGroupDataOverview.class); - Assertions.assertEquals("ypsxjvfoim", model.availabilityGroupId()); - Assertions.assertEquals("slirciz", model.availabilityGroupName()); - Assertions.assertEquals("vydfceacvlhvygdy", model.sqlAvailabilityGroupSdsArmId()); - Assertions.assertEquals("umrtwnawjsl", model.sqlAvailabilityGroupEntityId()); - Assertions.assertEquals("wkojgcyztsfmzn", model.sqlAvailabilityReplicaId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAvailabilityReplicaSummaryTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAvailabilityReplicaSummaryTests.java deleted file mode 100644 index 0a514cd02963..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlAvailabilityReplicaSummaryTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.SqlAvailabilityReplicaSummary; -import org.junit.jupiter.api.Assertions; - -public final class SqlAvailabilityReplicaSummaryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlAvailabilityReplicaSummary model = BinaryData.fromString( - "{\"numberOfSynchronousReadReplicas\":1052982888,\"numberOfSynchronousNonReadReplicas\":837668712,\"numberOfAsynchronousReadReplicas\":1792442027,\"numberOfAsynchronousNonReadReplicas\":296401749,\"numberOfPrimaryReplicas\":396816762}") - .toObject(SqlAvailabilityReplicaSummary.class); - Assertions.assertEquals(1052982888, model.numberOfSynchronousReadReplicas()); - Assertions.assertEquals(837668712, model.numberOfSynchronousNonReadReplicas()); - Assertions.assertEquals(1792442027, model.numberOfAsynchronousReadReplicas()); - Assertions.assertEquals(296401749, model.numberOfAsynchronousNonReadReplicas()); - Assertions.assertEquals(396816762, model.numberOfPrimaryReplicas()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlAvailabilityReplicaSummary model - = new SqlAvailabilityReplicaSummary().withNumberOfSynchronousReadReplicas(1052982888) - .withNumberOfSynchronousNonReadReplicas(837668712) - .withNumberOfAsynchronousReadReplicas(1792442027) - .withNumberOfAsynchronousNonReadReplicas(296401749) - .withNumberOfPrimaryReplicas(396816762); - model = BinaryData.fromObject(model).toObject(SqlAvailabilityReplicaSummary.class); - Assertions.assertEquals(1052982888, model.numberOfSynchronousReadReplicas()); - Assertions.assertEquals(837668712, model.numberOfSynchronousNonReadReplicas()); - Assertions.assertEquals(1792442027, model.numberOfAsynchronousReadReplicas()); - Assertions.assertEquals(296401749, model.numberOfAsynchronousNonReadReplicas()); - Assertions.assertEquals(396816762, model.numberOfPrimaryReplicas()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorInnerTests.java deleted file mode 100644 index 40e81302ac8b..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorInnerTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlCollectorInner; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class SqlCollectorInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlCollectorInner model = BinaryData.fromString( - "{\"properties\":{\"agentProperties\":{\"id\":\"nfwmyymvqdbpb\",\"version\":\"ckdvez\",\"lastHeartbeatUtc\":\"2021-09-07T23:55:15Z\",\"spnDetails\":{\"authority\":\"bzhdd\",\"applicationId\":\"bnqfblhk\",\"audience\":\"ehpavawugiqjtiog\",\"objectId\":\"dminic\",\"tenantId\":\"eajohiyg\"}},\"discoverySiteId\":\"n\",\"createdTimestamp\":\"2021-01-10T08:24:54Z\",\"updatedTimestamp\":\"2021-06-30T15:37:59Z\",\"provisioningState\":\"Accepted\"},\"id\":\"kmktpvwxqcseh\",\"name\":\"hkhufm\",\"type\":\"qumq\"}") - .toObject(SqlCollectorInner.class); - Assertions.assertEquals(ProvisioningState.ACCEPTED, model.properties().provisioningState()); - Assertions.assertEquals("nfwmyymvqdbpb", model.properties().agentProperties().id()); - Assertions.assertEquals("ckdvez", model.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-07T23:55:15Z"), - model.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("bzhdd", model.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("bnqfblhk", model.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("ehpavawugiqjtiog", model.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("dminic", model.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("eajohiyg", model.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("n", model.properties().discoverySiteId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlCollectorInner model = new SqlCollectorInner() - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.ACCEPTED) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("nfwmyymvqdbpb") - .withVersion("ckdvez") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-09-07T23:55:15Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("bzhdd") - .withApplicationId("bnqfblhk") - .withAudience("ehpavawugiqjtiog") - .withObjectId("dminic") - .withTenantId("eajohiyg"))) - .withDiscoverySiteId("n")); - model = BinaryData.fromObject(model).toObject(SqlCollectorInner.class); - Assertions.assertEquals(ProvisioningState.ACCEPTED, model.properties().provisioningState()); - Assertions.assertEquals("nfwmyymvqdbpb", model.properties().agentProperties().id()); - Assertions.assertEquals("ckdvez", model.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-07T23:55:15Z"), - model.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("bzhdd", model.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("bnqfblhk", model.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("ehpavawugiqjtiog", model.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("dminic", model.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("eajohiyg", model.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("n", model.properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorListResultTests.java deleted file mode 100644 index 876647e0bfcf..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorListResultTests.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.SqlCollectorInner; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.SqlCollectorListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SqlCollectorListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlCollectorListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"agentProperties\":{\"id\":\"zlfytoit\",\"version\":\"ygvfltgvdihoyn\",\"lastHeartbeatUtc\":\"2021-07-12T20:14:31Z\",\"spnDetails\":{\"authority\":\"twk\",\"applicationId\":\"cy\",\"audience\":\"cpcunnuzdqum\",\"objectId\":\"nod\",\"tenantId\":\"ienhqhskndnelq\"}},\"discoverySiteId\":\"adlknwfoanni\",\"createdTimestamp\":\"2021-11-08T07:08:24Z\",\"updatedTimestamp\":\"2020-12-23T05:37:02Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"cnrly\",\"name\":\"nucaephblkwqpat\",\"type\":\"bqsdtcjbctvi\"},{\"properties\":{\"agentProperties\":{\"id\":\"y\",\"version\":\"uo\",\"lastHeartbeatUtc\":\"2021-06-01T02:15:38Z\",\"spnDetails\":{\"authority\":\"it\",\"applicationId\":\"hzvb\",\"audience\":\"cdb\",\"objectId\":\"fzndscxmxeatkd\",\"tenantId\":\"wnrdjyibqbnaom\"}},\"discoverySiteId\":\"rmkuh\",\"createdTimestamp\":\"2021-02-02T00:53:22Z\",\"updatedTimestamp\":\"2021-01-24T19:55:15Z\",\"provisioningState\":\"Failed\"},\"id\":\"i\",\"name\":\"cjmobcanc\",\"type\":\"exxqcwg\"},{\"properties\":{\"agentProperties\":{\"id\":\"vaknokzwjj\",\"version\":\"ltixldzyyfytpq\",\"lastHeartbeatUtc\":\"2021-04-28T14:44Z\",\"spnDetails\":{\"authority\":\"m\",\"applicationId\":\"jivyqlkjuv\",\"audience\":\"bmslzoyov\",\"objectId\":\"dbpqvybefgvm\",\"tenantId\":\"okcvtlubses\"}},\"discoverySiteId\":\"cua\",\"createdTimestamp\":\"2021-11-09T04:41:13Z\",\"updatedTimestamp\":\"2021-06-28T06:17:55Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"iryky\",\"name\":\"ndzfqivjreuyk\",\"type\":\"bmnwa\"}],\"nextLink\":\"tbxoee\"}") - .toObject(SqlCollectorListResult.class); - Assertions.assertEquals(ProvisioningState.PROVISIONING, model.value().get(0).properties().provisioningState()); - Assertions.assertEquals("zlfytoit", model.value().get(0).properties().agentProperties().id()); - Assertions.assertEquals("ygvfltgvdihoyn", model.value().get(0).properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-12T20:14:31Z"), - model.value().get(0).properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("twk", model.value().get(0).properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("cy", model.value().get(0).properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("cpcunnuzdqum", - model.value().get(0).properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("nod", model.value().get(0).properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("ienhqhskndnelq", - model.value().get(0).properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("adlknwfoanni", model.value().get(0).properties().discoverySiteId()); - Assertions.assertEquals("tbxoee", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlCollectorListResult model = new SqlCollectorListResult().withValue(Arrays.asList( - new SqlCollectorInner().withProperties( - new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.PROVISIONING) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("zlfytoit") - .withVersion("ygvfltgvdihoyn") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-07-12T20:14:31Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("twk") - .withApplicationId("cy") - .withAudience("cpcunnuzdqum") - .withObjectId("nod") - .withTenantId("ienhqhskndnelq"))) - .withDiscoverySiteId("adlknwfoanni")), - new SqlCollectorInner() - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.FAILED) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("y") - .withVersion("uo") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-06-01T02:15:38Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("it") - .withApplicationId("hzvb") - .withAudience("cdb") - .withObjectId("fzndscxmxeatkd") - .withTenantId("wnrdjyibqbnaom"))) - .withDiscoverySiteId("rmkuh")), - new SqlCollectorInner().withProperties( - new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.SUCCEEDED) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("vaknokzwjj") - .withVersion("ltixldzyyfytpq") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-04-28T14:44Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("m") - .withApplicationId("jivyqlkjuv") - .withAudience("bmslzoyov") - .withObjectId("dbpqvybefgvm") - .withTenantId("okcvtlubses"))) - .withDiscoverySiteId("cua")))) - .withNextLink("tbxoee"); - model = BinaryData.fromObject(model).toObject(SqlCollectorListResult.class); - Assertions.assertEquals(ProvisioningState.PROVISIONING, model.value().get(0).properties().provisioningState()); - Assertions.assertEquals("zlfytoit", model.value().get(0).properties().agentProperties().id()); - Assertions.assertEquals("ygvfltgvdihoyn", model.value().get(0).properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-12T20:14:31Z"), - model.value().get(0).properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("twk", model.value().get(0).properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("cy", model.value().get(0).properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("cpcunnuzdqum", - model.value().get(0).properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("nod", model.value().get(0).properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("ienhqhskndnelq", - model.value().get(0).properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("adlknwfoanni", model.value().get(0).properties().discoverySiteId()); - Assertions.assertEquals("tbxoee", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsCreateMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsCreateMockTests.java deleted file mode 100644 index be0e486c7d40..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsCreateMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.SqlCollector; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SqlCollectorOperationsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"agentProperties\":{\"id\":\"oanpohrvm\",\"version\":\"qr\",\"lastHeartbeatUtc\":\"2021-07-03T12:21:15Z\",\"spnDetails\":{\"authority\":\"vznllaslkskhjqj\",\"applicationId\":\"baihxjtgzg\",\"audience\":\"iywbqgro\",\"objectId\":\"bsfsgsae\",\"tenantId\":\"ldfmhljq\"}},\"discoverySiteId\":\"spmrjct\",\"createdTimestamp\":\"2021-11-03T18:45:02Z\",\"updatedTimestamp\":\"2021-11-06T12:27:19Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"uhsx\",\"name\":\"znmgsdaluyckhefr\",\"type\":\"hs\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - SqlCollector response = manager.sqlCollectorOperations() - .define("glqjoxtdahneaoov") - .withExistingAssessmentProject("vxcgdhyhgoqgs", "yqyxyjrcbqpbis") - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.UPDATING) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("tivfwjlo") - .withVersion("ekfsrm") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-10-04T04:38:24Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("jvcfoczh") - .withApplicationId("ejov") - .withAudience("wxn") - .withObjectId("hhnoyrzaaoee") - .withTenantId("mjenvjeatea"))) - .withDiscoverySiteId("crxoxdj")) - .create(); - - Assertions.assertEquals(ProvisioningState.SUCCEEDED, response.properties().provisioningState()); - Assertions.assertEquals("oanpohrvm", response.properties().agentProperties().id()); - Assertions.assertEquals("qr", response.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-03T12:21:15Z"), - response.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("vznllaslkskhjqj", response.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("baihxjtgzg", response.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("iywbqgro", response.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("bsfsgsae", response.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("ldfmhljq", response.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("spmrjct", response.properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsDeleteWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsDeleteWithResponseMockTests.java deleted file mode 100644 index f51223eaefc8..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SqlCollectorOperationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.sqlCollectorOperations().deleteWithResponse("ses", "fga", "qiy", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsGetWithResponseMockTests.java deleted file mode 100644 index bd137b53de38..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.SqlCollector; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SqlCollectorOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"agentProperties\":{\"id\":\"u\",\"version\":\"vcp\",\"lastHeartbeatUtc\":\"2021-02-02T04:48:03Z\",\"spnDetails\":{\"authority\":\"uckclbtxluevsolz\",\"applicationId\":\"lfngojfsqebuuxj\",\"audience\":\"fxfjwp\",\"objectId\":\"ktpmbmxb\",\"tenantId\":\"rwgzzxl\"}},\"discoverySiteId\":\"khxsdplaumy\",\"createdTimestamp\":\"2021-05-01T04:57:26Z\",\"updatedTimestamp\":\"2021-11-22T20:04:20Z\",\"provisioningState\":\"Deleting\"},\"id\":\"yxyd\",\"name\":\"tokvqbvwglgwz\",\"type\":\"vxakglh\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - SqlCollector response = manager.sqlCollectorOperations() - .getWithResponse("squnycwztlv", "wsnmrkkyjt", "epwpwfk", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ProvisioningState.DELETING, response.properties().provisioningState()); - Assertions.assertEquals("u", response.properties().agentProperties().id()); - Assertions.assertEquals("vcp", response.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-02T04:48:03Z"), - response.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("uckclbtxluevsolz", response.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("lfngojfsqebuuxj", - response.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("fxfjwp", response.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("ktpmbmxb", response.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("rwgzzxl", response.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("khxsdplaumy", response.properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsListByAssessmentProjectMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsListByAssessmentProjectMockTests.java deleted file mode 100644 index 5da7c680cfa5..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlCollectorOperationsListByAssessmentProjectMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.SqlCollector; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SqlCollectorOperationsListByAssessmentProjectMockTests { - @Test - public void testListByAssessmentProject() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"agentProperties\":{\"id\":\"ofgeoagf\",\"version\":\"ftnxodwxmdajwiy\",\"lastHeartbeatUtc\":\"2021-06-10T16:01:40Z\",\"spnDetails\":{\"authority\":\"vmdmzenlr\",\"applicationId\":\"gfc\",\"audience\":\"j\",\"objectId\":\"cidt\",\"tenantId\":\"amyyznmrgcdogcv\"}},\"discoverySiteId\":\"gytoxuwhtt\",\"createdTimestamp\":\"2021-04-20T14:48:23Z\",\"updatedTimestamp\":\"2021-05-03T18:57:50Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"bgszplusdek\",\"name\":\"dzzmssgpgv\",\"type\":\"kyejidbdq\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.sqlCollectorOperations() - .listByAssessmentProject("zjgcfjfx", "bwjjirmuydgf", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ProvisioningState.PROVISIONING, - response.iterator().next().properties().provisioningState()); - Assertions.assertEquals("ofgeoagf", response.iterator().next().properties().agentProperties().id()); - Assertions.assertEquals("ftnxodwxmdajwiy", response.iterator().next().properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T16:01:40Z"), - response.iterator().next().properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("vmdmzenlr", - response.iterator().next().properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("gfc", - response.iterator().next().properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("j", response.iterator().next().properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("cidt", - response.iterator().next().properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("amyyznmrgcdogcv", - response.iterator().next().properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("gytoxuwhtt", response.iterator().next().properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlDbSettingsTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlDbSettingsTests.java deleted file mode 100644 index caeb67b7f0c1..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlDbSettingsTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlDataBaseType; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlPurchaseModel; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlServiceTier; -import com.azure.resourcemanager.migration.assessment.models.ComputeTier; -import com.azure.resourcemanager.migration.assessment.models.SqlDbSettings; -import org.junit.jupiter.api.Assertions; - -public final class SqlDbSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlDbSettings model = BinaryData.fromString( - "{\"azureSqlServiceTier\":\"Unknown\",\"azureSqlDataBaseType\":\"ElasticPool\",\"azureSqlComputeTier\":\"Provisioned\",\"azureSqlPurchaseModel\":\"Unknown\"}") - .toObject(SqlDbSettings.class); - Assertions.assertEquals(AzureSqlServiceTier.UNKNOWN, model.azureSqlServiceTier()); - Assertions.assertEquals(AzureSqlDataBaseType.ELASTIC_POOL, model.azureSqlDataBaseType()); - Assertions.assertEquals(ComputeTier.PROVISIONED, model.azureSqlComputeTier()); - Assertions.assertEquals(AzureSqlPurchaseModel.UNKNOWN, model.azureSqlPurchaseModel()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlDbSettings model = new SqlDbSettings().withAzureSqlServiceTier(AzureSqlServiceTier.UNKNOWN) - .withAzureSqlDataBaseType(AzureSqlDataBaseType.ELASTIC_POOL) - .withAzureSqlComputeTier(ComputeTier.PROVISIONED) - .withAzureSqlPurchaseModel(AzureSqlPurchaseModel.UNKNOWN); - model = BinaryData.fromObject(model).toObject(SqlDbSettings.class); - Assertions.assertEquals(AzureSqlServiceTier.UNKNOWN, model.azureSqlServiceTier()); - Assertions.assertEquals(AzureSqlDataBaseType.ELASTIC_POOL, model.azureSqlDataBaseType()); - Assertions.assertEquals(ComputeTier.PROVISIONED, model.azureSqlComputeTier()); - Assertions.assertEquals(AzureSqlPurchaseModel.UNKNOWN, model.azureSqlPurchaseModel()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlFciMetadataTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlFciMetadataTests.java deleted file mode 100644 index 0b68c47753a5..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlFciMetadataTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.SqlFciMetadata; -import com.azure.resourcemanager.migration.assessment.models.SqlFciMetadataState; -import org.junit.jupiter.api.Assertions; - -public final class SqlFciMetadataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlFciMetadata model = BinaryData - .fromString("{\"state\":\"OnlinePending\",\"isMultiSubnet\":true,\"fciSharedDiskCount\":763875657}") - .toObject(SqlFciMetadata.class); - Assertions.assertEquals(SqlFciMetadataState.ONLINE_PENDING, model.state()); - Assertions.assertEquals(true, model.isMultiSubnet()); - Assertions.assertEquals(763875657, model.fciSharedDiskCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlFciMetadata model = new SqlFciMetadata().withState(SqlFciMetadataState.ONLINE_PENDING) - .withIsMultiSubnet(true) - .withFciSharedDiskCount(763875657); - model = BinaryData.fromObject(model).toObject(SqlFciMetadata.class); - Assertions.assertEquals(SqlFciMetadataState.ONLINE_PENDING, model.state()); - Assertions.assertEquals(true, model.isMultiSubnet()); - Assertions.assertEquals(763875657, model.fciSharedDiskCount()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlMiSettingsTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlMiSettingsTests.java deleted file mode 100644 index 122cae18f3b3..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlMiSettingsTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlInstanceType; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlServiceTier; -import com.azure.resourcemanager.migration.assessment.models.SqlMiSettings; -import org.junit.jupiter.api.Assertions; - -public final class SqlMiSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlMiSettings model - = BinaryData.fromString("{\"azureSqlServiceTier\":\"Automatic\",\"azureSqlInstanceType\":\"Automatic\"}") - .toObject(SqlMiSettings.class); - Assertions.assertEquals(AzureSqlServiceTier.AUTOMATIC, model.azureSqlServiceTier()); - Assertions.assertEquals(AzureSqlInstanceType.AUTOMATIC, model.azureSqlInstanceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlMiSettings model = new SqlMiSettings().withAzureSqlServiceTier(AzureSqlServiceTier.AUTOMATIC) - .withAzureSqlInstanceType(AzureSqlInstanceType.AUTOMATIC); - model = BinaryData.fromObject(model).toObject(SqlMiSettings.class); - Assertions.assertEquals(AzureSqlServiceTier.AUTOMATIC, model.azureSqlServiceTier()); - Assertions.assertEquals(AzureSqlInstanceType.AUTOMATIC, model.azureSqlInstanceType()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlPaaSTargetOptionsTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlPaaSTargetOptionsTests.java deleted file mode 100644 index 57ac208eb89d..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlPaaSTargetOptionsTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AzureLocation; -import com.azure.resourcemanager.migration.assessment.models.AzureSqlServiceTier; -import com.azure.resourcemanager.migration.assessment.models.ComputeTier; -import com.azure.resourcemanager.migration.assessment.models.HardwareGeneration; -import com.azure.resourcemanager.migration.assessment.models.SqlPaaSTargetOptions; -import com.azure.resourcemanager.migration.assessment.models.TargetType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SqlPaaSTargetOptionsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlPaaSTargetOptions model = BinaryData.fromString( - "{\"computeTier\":\"Unknown\",\"hardwareGeneration\":\"Automatic\",\"targetType\":\"AzureVirtualMachine\",\"serviceTier\":\"HyperScale\",\"targetLocations\":[\"USDoDEast\",\"SouthCentralUs\"]}") - .toObject(SqlPaaSTargetOptions.class); - Assertions.assertEquals(ComputeTier.UNKNOWN, model.computeTier()); - Assertions.assertEquals(HardwareGeneration.AUTOMATIC, model.hardwareGeneration()); - Assertions.assertEquals(TargetType.AZURE_VIRTUAL_MACHINE, model.targetType()); - Assertions.assertEquals(AzureSqlServiceTier.HYPER_SCALE, model.serviceTier()); - Assertions.assertEquals(AzureLocation.USDO_DEAST, model.targetLocations().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlPaaSTargetOptions model = new SqlPaaSTargetOptions().withComputeTier(ComputeTier.UNKNOWN) - .withHardwareGeneration(HardwareGeneration.AUTOMATIC) - .withTargetType(TargetType.AZURE_VIRTUAL_MACHINE) - .withServiceTier(AzureSqlServiceTier.HYPER_SCALE) - .withTargetLocations(Arrays.asList(AzureLocation.USDO_DEAST, AzureLocation.SOUTH_CENTRAL_US)); - model = BinaryData.fromObject(model).toObject(SqlPaaSTargetOptions.class); - Assertions.assertEquals(ComputeTier.UNKNOWN, model.computeTier()); - Assertions.assertEquals(HardwareGeneration.AUTOMATIC, model.hardwareGeneration()); - Assertions.assertEquals(TargetType.AZURE_VIRTUAL_MACHINE, model.targetType()); - Assertions.assertEquals(AzureSqlServiceTier.HYPER_SCALE, model.serviceTier()); - Assertions.assertEquals(AzureLocation.USDO_DEAST, model.targetLocations().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlVmSettingsTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlVmSettingsTests.java deleted file mode 100644 index 97c6d5b6c0da..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/SqlVmSettingsTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.AzureVmFamily; -import com.azure.resourcemanager.migration.assessment.models.SqlVmSettings; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SqlVmSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlVmSettings model - = BinaryData.fromString("{\"instanceSeries\":[\"Dsv4_series\"]}").toObject(SqlVmSettings.class); - Assertions.assertEquals(AzureVmFamily.DSV4_SERIES, model.instanceSeries().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlVmSettings model = new SqlVmSettings().withInstanceSeries(Arrays.asList(AzureVmFamily.DSV4_SERIES)); - model = BinaryData.fromObject(model).toObject(SqlVmSettings.class); - Assertions.assertEquals(AzureVmFamily.DSV4_SERIES, model.instanceSeries().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/UltraDiskAssessmentOptionsTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/UltraDiskAssessmentOptionsTests.java deleted file mode 100644 index 17275d48942a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/UltraDiskAssessmentOptionsTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.UltraDiskAssessmentOptions; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UltraDiskAssessmentOptionsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UltraDiskAssessmentOptions model = BinaryData - .fromString("{\"familyName\":\"knftguvriuh\",\"targetLocations\":[\"mdyvxqtayriw\",\"ro\",\"qbex\"]}") - .toObject(UltraDiskAssessmentOptions.class); - Assertions.assertEquals("knftguvriuh", model.familyName()); - Assertions.assertEquals("mdyvxqtayriw", model.targetLocations().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UltraDiskAssessmentOptions model = new UltraDiskAssessmentOptions().withFamilyName("knftguvriuh") - .withTargetLocations(Arrays.asList("mdyvxqtayriw", "ro", "qbex")); - model = BinaryData.fromObject(model).toObject(UltraDiskAssessmentOptions.class); - Assertions.assertEquals("knftguvriuh", model.familyName()); - Assertions.assertEquals("mdyvxqtayriw", model.targetLocations().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/UpdateGroupBodyTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/UpdateGroupBodyTests.java deleted file mode 100644 index e2ede4b2efa9..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/UpdateGroupBodyTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.GroupBodyProperties; -import com.azure.resourcemanager.migration.assessment.models.GroupUpdateOperation; -import com.azure.resourcemanager.migration.assessment.models.UpdateGroupBody; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateGroupBodyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateGroupBody model = BinaryData.fromString( - "{\"eTag\":\"geqmgqzgwldoych\",\"properties\":{\"operationType\":\"Remove\",\"machines\":[\"fehuwaoaguhi\",\"qllizstac\",\"jvhrweft\"]}}") - .toObject(UpdateGroupBody.class); - Assertions.assertEquals("geqmgqzgwldoych", model.etag()); - Assertions.assertEquals(GroupUpdateOperation.REMOVE, model.properties().operationType()); - Assertions.assertEquals("fehuwaoaguhi", model.properties().machines().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateGroupBody model = new UpdateGroupBody().withEtag("geqmgqzgwldoych") - .withProperties(new GroupBodyProperties().withOperationType(GroupUpdateOperation.REMOVE) - .withMachines(Arrays.asList("fehuwaoaguhi", "qllizstac", "jvhrweft"))); - model = BinaryData.fromObject(model).toObject(UpdateGroupBody.class); - Assertions.assertEquals("geqmgqzgwldoych", model.etag()); - Assertions.assertEquals(GroupUpdateOperation.REMOVE, model.properties().operationType()); - Assertions.assertEquals("fehuwaoaguhi", model.properties().machines().get(0)); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmFamilyOptionsTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmFamilyOptionsTests.java deleted file mode 100644 index 73825396cfb3..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmFamilyOptionsTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.VmFamilyOptions; - -public final class VmFamilyOptionsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VmFamilyOptions model = BinaryData.fromString( - "{\"familyName\":\"rbpbewtghfgblcg\",\"targetLocations\":[\"vlvqhjkbegi\",\"t\",\"mxiebw\",\"aloayqcgwrtzju\"],\"category\":[\"yzm\",\"txon\",\"mtsavjcbpwxqp\"]}") - .toObject(VmFamilyOptions.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VmFamilyOptions model = new VmFamilyOptions(); - model = BinaryData.fromObject(model).toObject(VmFamilyOptions.class); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmUptimeTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmUptimeTests.java deleted file mode 100644 index e2015cd210cd..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmUptimeTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.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\":171305753,\"hoursPerDay\":1847154217}").toObject(VmUptime.class); - Assertions.assertEquals(171305753, model.daysPerMonth()); - Assertions.assertEquals(1847154217, model.hoursPerDay()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VmUptime model = new VmUptime().withDaysPerMonth(171305753).withHoursPerDay(1847154217); - model = BinaryData.fromObject(model).toObject(VmUptime.class); - Assertions.assertEquals(171305753, model.daysPerMonth()); - Assertions.assertEquals(1847154217, model.hoursPerDay()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorInnerTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorInnerTests.java deleted file mode 100644 index 0466e4edd191..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorInnerTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.VmwareCollectorInner; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class VmwareCollectorInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VmwareCollectorInner model = BinaryData.fromString( - "{\"properties\":{\"agentProperties\":{\"id\":\"yd\",\"version\":\"uvvadswzsnu\",\"lastHeartbeatUtc\":\"2021-08-23T01:32:44Z\",\"spnDetails\":{\"authority\":\"wuowhlxlnwy\",\"applicationId\":\"ouvblgmo\",\"audience\":\"kltrfow\",\"objectId\":\"vrfmvlihcvjd\",\"tenantId\":\"crjidhftukv\"}},\"discoverySiteId\":\"xlwyoj\",\"createdTimestamp\":\"2021-02-13T08:09:39Z\",\"updatedTimestamp\":\"2021-03-15T14:07:07Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"jyixhaf\",\"name\":\"atqxmbjroumzzn\",\"type\":\"al\"}") - .toObject(VmwareCollectorInner.class); - Assertions.assertEquals(ProvisioningState.SUCCEEDED, model.properties().provisioningState()); - Assertions.assertEquals("yd", model.properties().agentProperties().id()); - Assertions.assertEquals("uvvadswzsnu", model.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-23T01:32:44Z"), - model.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("wuowhlxlnwy", model.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("ouvblgmo", model.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("kltrfow", model.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("vrfmvlihcvjd", model.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("crjidhftukv", model.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("xlwyoj", model.properties().discoverySiteId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VmwareCollectorInner model = new VmwareCollectorInner() - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.SUCCEEDED) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("yd") - .withVersion("uvvadswzsnu") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-08-23T01:32:44Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("wuowhlxlnwy") - .withApplicationId("ouvblgmo") - .withAudience("kltrfow") - .withObjectId("vrfmvlihcvjd") - .withTenantId("crjidhftukv"))) - .withDiscoverySiteId("xlwyoj")); - model = BinaryData.fromObject(model).toObject(VmwareCollectorInner.class); - Assertions.assertEquals(ProvisioningState.SUCCEEDED, model.properties().provisioningState()); - Assertions.assertEquals("yd", model.properties().agentProperties().id()); - Assertions.assertEquals("uvvadswzsnu", model.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-23T01:32:44Z"), - model.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("wuowhlxlnwy", model.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("ouvblgmo", model.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("kltrfow", model.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("vrfmvlihcvjd", model.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("crjidhftukv", model.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("xlwyoj", model.properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorListResultTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorListResultTests.java deleted file mode 100644 index e18177e018e7..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorListResultTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.fluent.models.VmwareCollectorInner; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.VmwareCollectorListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VmwareCollectorListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VmwareCollectorListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"agentProperties\":{\"id\":\"zulo\",\"version\":\"aeuzanh\",\"lastHeartbeatUtc\":\"2021-11-19T22:08:29Z\",\"spnDetails\":{\"authority\":\"enwphpzfngq\",\"applicationId\":\"lidftujwjj\",\"audience\":\"wbeqrkuor\",\"objectId\":\"ssruqnmdvhazcvj\",\"tenantId\":\"iqswbqer\"}},\"discoverySiteId\":\"xiytxtdgukvl\",\"createdTimestamp\":\"2021-11-18T11:20:29Z\",\"updatedTimestamp\":\"2021-02-21T00:04:27Z\",\"provisioningState\":\"Deleting\"},\"id\":\"youambewr\",\"name\":\"swmowegmmuteyxe\",\"type\":\"guqigijiitns\"},{\"properties\":{\"agentProperties\":{\"id\":\"desygrijwa\",\"version\":\"fanraybfu\",\"lastHeartbeatUtc\":\"2021-02-09T08:33:36Z\",\"spnDetails\":{\"authority\":\"jsydgrhydkygywez\",\"applicationId\":\"iecafygzmxi\",\"audience\":\"vdsmaklixq\",\"objectId\":\"hyhxa\",\"tenantId\":\"bx\"}},\"discoverySiteId\":\"oij\",\"createdTimestamp\":\"2021-04-20T04:08:14Z\",\"updatedTimestamp\":\"2021-07-15T09:06:11Z\",\"provisioningState\":\"Updating\"},\"id\":\"kkwjdjodq\",\"name\":\"ykincnremehl\",\"type\":\"izhceumoqodkadp\"}],\"nextLink\":\"ibngqladyw\"}") - .toObject(VmwareCollectorListResult.class); - Assertions.assertEquals(ProvisioningState.DELETING, model.value().get(0).properties().provisioningState()); - Assertions.assertEquals("zulo", model.value().get(0).properties().agentProperties().id()); - Assertions.assertEquals("aeuzanh", model.value().get(0).properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-19T22:08:29Z"), - model.value().get(0).properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("enwphpzfngq", - model.value().get(0).properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("lidftujwjj", - model.value().get(0).properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("wbeqrkuor", - model.value().get(0).properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("ssruqnmdvhazcvj", - model.value().get(0).properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("iqswbqer", - model.value().get(0).properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("xiytxtdgukvl", model.value().get(0).properties().discoverySiteId()); - Assertions.assertEquals("ibngqladyw", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VmwareCollectorListResult model = new VmwareCollectorListResult().withValue(Arrays.asList( - new VmwareCollectorInner() - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.DELETING) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("zulo") - .withVersion("aeuzanh") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-11-19T22:08:29Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("enwphpzfngq") - .withApplicationId("lidftujwjj") - .withAudience("wbeqrkuor") - .withObjectId("ssruqnmdvhazcvj") - .withTenantId("iqswbqer"))) - .withDiscoverySiteId("xiytxtdgukvl")), - new VmwareCollectorInner() - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.UPDATING) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("desygrijwa") - .withVersion("fanraybfu") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-02-09T08:33:36Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("jsydgrhydkygywez") - .withApplicationId("iecafygzmxi") - .withAudience("vdsmaklixq") - .withObjectId("hyhxa") - .withTenantId("bx"))) - .withDiscoverySiteId("oij")))) - .withNextLink("ibngqladyw"); - model = BinaryData.fromObject(model).toObject(VmwareCollectorListResult.class); - Assertions.assertEquals(ProvisioningState.DELETING, model.value().get(0).properties().provisioningState()); - Assertions.assertEquals("zulo", model.value().get(0).properties().agentProperties().id()); - Assertions.assertEquals("aeuzanh", model.value().get(0).properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-19T22:08:29Z"), - model.value().get(0).properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("enwphpzfngq", - model.value().get(0).properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("lidftujwjj", - model.value().get(0).properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("wbeqrkuor", - model.value().get(0).properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("ssruqnmdvhazcvj", - model.value().get(0).properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("iqswbqer", - model.value().get(0).properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("xiytxtdgukvl", model.value().get(0).properties().discoverySiteId()); - Assertions.assertEquals("ibngqladyw", model.nextLink()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsCreateMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsCreateMockTests.java deleted file mode 100644 index 2b36babced50..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsCreateMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorAgentSpnPropertiesBase; -import com.azure.resourcemanager.migration.assessment.models.CollectorPropertiesBaseWithAgent; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.VmwareCollector; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class VmwareCollectorsOperationsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"properties\":{\"agentProperties\":{\"id\":\"mcofn\",\"version\":\"lbsnosnqliw\",\"lastHeartbeatUtc\":\"2020-12-31T14:56:04Z\",\"spnDetails\":{\"authority\":\"fetya\",\"applicationId\":\"tg\",\"audience\":\"nazgbjbhrpgiq\",\"objectId\":\"tcucrcmmai\",\"tenantId\":\"qjiwifhbksldttoh\"}},\"discoverySiteId\":\"lna\",\"createdTimestamp\":\"2021-01-30T09:04:29Z\",\"updatedTimestamp\":\"2021-10-03T11:41:04Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"kvllrhtpmglxkoi\",\"name\":\"mtrawrqkza\",\"type\":\"bun\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - VmwareCollector response = manager.vmwareCollectorsOperations() - .define("ekwuyckyvn") - .withExistingAssessmentProject("z", "canzb") - .withProperties(new CollectorPropertiesBaseWithAgent().withProvisioningState(ProvisioningState.UPDATING) - .withAgentProperties(new CollectorAgentPropertiesBase().withId("uffiwjbctvbpzu") - .withVersion("jtotdxposcs") - .withLastHeartbeatUtc(OffsetDateTime.parse("2021-06-08T17:25:47Z")) - .withSpnDetails(new CollectorAgentSpnPropertiesBase().withAuthority("siecktybhj") - .withApplicationId("idhhxomild") - .withAudience("jxdugxwj") - .withObjectId("l") - .withTenantId("rslaatep"))) - .withDiscoverySiteId("ujjzgxq")) - .create(); - - Assertions.assertEquals(ProvisioningState.SUCCEEDED, response.properties().provisioningState()); - Assertions.assertEquals("mcofn", response.properties().agentProperties().id()); - Assertions.assertEquals("lbsnosnqliw", response.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-31T14:56:04Z"), - response.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("fetya", response.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("tg", response.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("nazgbjbhrpgiq", response.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("tcucrcmmai", response.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("qjiwifhbksldttoh", response.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("lna", response.properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsDeleteWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsDeleteWithResponseMockTests.java deleted file mode 100644 index 42e309a02c73..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class VmwareCollectorsOperationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.vmwareCollectorsOperations() - .deleteWithResponse("hjmbji", "egmxdbsohc", "hpyvdkgdet", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsGetWithResponseMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsGetWithResponseMockTests.java deleted file mode 100644 index 409baa8cd0e8..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.VmwareCollector; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class VmwareCollectorsOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"agentProperties\":{\"id\":\"gsoriobij\",\"version\":\"ydyeuy\",\"lastHeartbeatUtc\":\"2021-08-02T19:21:07Z\",\"spnDetails\":{\"authority\":\"ayrgwy\",\"applicationId\":\"io\",\"audience\":\"weoftnorw\",\"objectId\":\"gsioc\",\"tenantId\":\"kmv\"}},\"discoverySiteId\":\"nx\",\"createdTimestamp\":\"2021-04-14T08:01:15Z\",\"updatedTimestamp\":\"2021-05-30T09:27:09Z\",\"provisioningState\":\"Failed\"},\"id\":\"nwosstfj\",\"name\":\"tvlxxzqfcwr\",\"type\":\"iomxeezw\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - VmwareCollector response = manager.vmwareCollectorsOperations() - .getWithResponse("sqywjopacky", "ydv", "kmfngpmillxgjs", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ProvisioningState.FAILED, response.properties().provisioningState()); - Assertions.assertEquals("gsoriobij", response.properties().agentProperties().id()); - Assertions.assertEquals("ydyeuy", response.properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-02T19:21:07Z"), - response.properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("ayrgwy", response.properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("io", response.properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("weoftnorw", response.properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("gsioc", response.properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("kmv", response.properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("nx", response.properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsListByAssessmentProjectMockTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsListByAssessmentProjectMockTests.java deleted file mode 100644 index 1fbf30eb268a..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/VmwareCollectorsOperationsListByAssessmentProjectMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.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.migration.assessment.MigrationAssessmentManager; -import com.azure.resourcemanager.migration.assessment.models.ProvisioningState; -import com.azure.resourcemanager.migration.assessment.models.VmwareCollector; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class VmwareCollectorsOperationsListByAssessmentProjectMockTests { - @Test - public void testListByAssessmentProject() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"agentProperties\":{\"id\":\"jmgtnsew\",\"version\":\"x\",\"lastHeartbeatUtc\":\"2021-06-07T17:36:48Z\",\"spnDetails\":{\"authority\":\"vyljurkeposehqq\",\"applicationId\":\"mpctwjwdsdlzmk\",\"audience\":\"rxxxoteehkhowgom\",\"objectId\":\"hxow\",\"tenantId\":\"bap\"}},\"discoverySiteId\":\"x\",\"createdTimestamp\":\"2021-10-05T11:42:42Z\",\"updatedTimestamp\":\"2021-06-23T08:30:24Z\",\"provisioningState\":\"Failed\"},\"id\":\"spfeylqlocvvuje\",\"name\":\"ayglxrkgjnmzpasl\",\"type\":\"vxjfiuofpieidzlv\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MigrationAssessmentManager manager = MigrationAssessmentManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.vmwareCollectorsOperations() - .listByAssessmentProject("uerbgpxebjl", "dcaytujraxd", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ProvisioningState.FAILED, response.iterator().next().properties().provisioningState()); - Assertions.assertEquals("jmgtnsew", response.iterator().next().properties().agentProperties().id()); - Assertions.assertEquals("x", response.iterator().next().properties().agentProperties().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-07T17:36:48Z"), - response.iterator().next().properties().agentProperties().lastHeartbeatUtc()); - Assertions.assertEquals("vyljurkeposehqq", - response.iterator().next().properties().agentProperties().spnDetails().authority()); - Assertions.assertEquals("mpctwjwdsdlzmk", - response.iterator().next().properties().agentProperties().spnDetails().applicationId()); - Assertions.assertEquals("rxxxoteehkhowgom", - response.iterator().next().properties().agentProperties().spnDetails().audience()); - Assertions.assertEquals("hxow", - response.iterator().next().properties().agentProperties().spnDetails().objectId()); - Assertions.assertEquals("bap", - response.iterator().next().properties().agentProperties().spnDetails().tenantId()); - Assertions.assertEquals("x", response.iterator().next().properties().discoverySiteId()); - } -} diff --git a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/WorkloadSummaryTests.java b/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/WorkloadSummaryTests.java deleted file mode 100644 index c77df94108f6..000000000000 --- a/sdk/migration/azure-resourcemanager-migration-assessment/src/test/java/com/azure/resourcemanager/migration/assessment/generated/WorkloadSummaryTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.migration.assessment.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.migration.assessment.models.WorkloadSummary; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadSummaryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadSummary model = BinaryData.fromString("{\"oracleInstances\":1849562249,\"springApps\":364097944}") - .toObject(WorkloadSummary.class); - Assertions.assertEquals(1849562249, model.oracleInstances()); - Assertions.assertEquals(364097944, model.springApps()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadSummary model = new WorkloadSummary().withOracleInstances(1849562249).withSpringApps(364097944); - model = BinaryData.fromObject(model).toObject(WorkloadSummary.class); - Assertions.assertEquals(1849562249, model.oracleInstances()); - Assertions.assertEquals(364097944, model.springApps()); - } -}