diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/CHANGELOG.md b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/CHANGELOG.md index a41a12b5286fe..ea561f62385bb 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/CHANGELOG.md +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/CHANGELOG.md @@ -1,5 +1,6 @@ # Release History -## 1.0.0-beta.1 (2024-03-07) +## 1.0.0-beta.1 (2024-04-09) - Azure Resource Manager MigrationDiscoverySap client library for Java. This package contains Microsoft Azure SDK for MigrationDiscoverySap Management SDK. Migration Discovery SAP Client. Package tag package-preview-2023-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/SAMPLE.md b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/SAMPLE.md index ec9661494ffad..77b1e7ca0993b 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/SAMPLE.md +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/SAMPLE.md @@ -57,6 +57,7 @@ public final class OperationsListSamples { ### SapDiscoverySites_Create ```java +import com.azure.resourcemanager.migrationdiscoverysap.models.SapDiscoverySiteProperties; import java.util.HashMap; import java.util.Map; @@ -77,8 +78,10 @@ public final class SapDiscoverySitesCreateSamples { public static void createResourceForImportBasedInput( com.azure.resourcemanager.migrationdiscoverysap.MigrationDiscoverySapManager manager) { manager.sapDiscoverySites().define("SampleSite").withRegion("eastus").withExistingResourceGroup("test-rg") - .withTags(mapOf("property1", "value1", "property2", "value2")).withMasterSiteId("MasterSiteIdResourceId") - .withMigrateProjectId("MigrateProjectId").create(); + .withTags(mapOf("property1", "value1", "property2", "value2")) + .withProperties(new SapDiscoverySiteProperties().withMasterSiteId("MasterSiteIdResourceId") + .withMigrateProjectId("MigrateProjectId")) + .create(); } // Use "Map.of" if available @@ -261,6 +264,7 @@ public final class SapDiscoverySitesUpdateSamples { ### SapInstances_Create ```java +import com.azure.resourcemanager.migrationdiscoverysap.models.SapInstanceProperties; import java.util.HashMap; import java.util.Map; @@ -282,7 +286,8 @@ public final class SapInstancesCreateSamples { com.azure.resourcemanager.migrationdiscoverysap.MigrationDiscoverySapManager manager) { manager.sapInstances().define("MPP_MPP").withRegion("eastus") .withExistingSapDiscoverySite("test-rg", "SampleSite") - .withTags(mapOf("property1", "value1", "property2", "value2")).create(); + .withTags(mapOf("property1", "value1", "property2", "value2")).withProperties(new SapInstanceProperties()) + .create(); } // Use "Map.of" if available @@ -516,8 +521,8 @@ public final class ServerInstancesListBySapInstanceSamples { ### ServerInstances_Update ```java -import com.azure.resourcemanager.migrationdiscoverysap.fluent.models.ServerInstanceProperties; import com.azure.resourcemanager.migrationdiscoverysap.models.ServerInstance; +import com.azure.resourcemanager.migrationdiscoverysap.models.ServerInstanceProperties; /** * Samples for ServerInstances Update. diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/pom.xml b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/pom.xml index e1f4cc919aac6..d7a1c1c5d4bf4 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/pom.xml +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/pom.xml @@ -58,5 +58,53 @@ azure-core-management 1.13.0 + + com.azure + azure-core-test + 1.24.1 + test + + + com.azure + azure-identity + 1.12.0 + test + + + org.junit.jupiter + junit-jupiter-api + 5.9.3 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.9.3 + test + + + org.mockito + mockito-core + 4.11.0 + test + + + net.bytebuddy + byte-buddy + 1.14.12 + test + + + net.bytebuddy + byte-buddy-agent + 1.14.12 + test + + + org.slf4j + slf4j-simple + 1.7.36 + test + diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/SapDiscoverySiteInner.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/SapDiscoverySiteInner.java index 9e4b803e93933..fa7474ef91844 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/SapDiscoverySiteInner.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/SapDiscoverySiteInner.java @@ -8,8 +8,7 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.resourcemanager.migrationdiscoverysap.models.ExtendedLocation; -import com.azure.resourcemanager.migrationdiscoverysap.models.ProvisioningState; -import com.azure.resourcemanager.migrationdiscoverysap.models.SapMigrateError; +import com.azure.resourcemanager.migrationdiscoverysap.models.SapDiscoverySiteProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -22,7 +21,7 @@ public final class SapDiscoverySiteInner extends Resource { * The resource-specific properties for this resource. */ @JsonProperty(value = "properties") - private SapDiscoverySiteProperties innerProperties; + private SapDiscoverySiteProperties properties; /* * The extended location definition. @@ -43,12 +42,23 @@ public SapDiscoverySiteInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private SapDiscoverySiteProperties innerProperties() { - return this.innerProperties; + public SapDiscoverySiteProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SapDiscoverySiteInner object itself. + */ + public SapDiscoverySiteInner withProperties(SapDiscoverySiteProperties properties) { + this.properties = properties; + return this; } /** @@ -98,78 +108,14 @@ public SapDiscoverySiteInner withTags(Map tags) { return this; } - /** - * Get the masterSiteId property: The master site ID from Azure Migrate. - * - * @return the masterSiteId value. - */ - public String masterSiteId() { - return this.innerProperties() == null ? null : this.innerProperties().masterSiteId(); - } - - /** - * Set the masterSiteId property: The master site ID from Azure Migrate. - * - * @param masterSiteId the masterSiteId value to set. - * @return the SapDiscoverySiteInner object itself. - */ - public SapDiscoverySiteInner withMasterSiteId(String masterSiteId) { - if (this.innerProperties() == null) { - this.innerProperties = new SapDiscoverySiteProperties(); - } - this.innerProperties().withMasterSiteId(masterSiteId); - return this; - } - - /** - * Get the migrateProjectId property: The migrate project ID from Azure Migrate. - * - * @return the migrateProjectId value. - */ - public String migrateProjectId() { - return this.innerProperties() == null ? null : this.innerProperties().migrateProjectId(); - } - - /** - * Set the migrateProjectId property: The migrate project ID from Azure Migrate. - * - * @param migrateProjectId the migrateProjectId value to set. - * @return the SapDiscoverySiteInner object itself. - */ - public SapDiscoverySiteInner withMigrateProjectId(String migrateProjectId) { - if (this.innerProperties() == null) { - this.innerProperties = new SapDiscoverySiteProperties(); - } - this.innerProperties().withMigrateProjectId(migrateProjectId); - return this; - } - - /** - * Get the provisioningState property: Defines the provisioning states. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the errors property: Indicates any errors on the SAP Migration discovery site resource. - * - * @return the errors value. - */ - public SapMigrateError errors() { - return this.innerProperties() == null ? null : this.innerProperties().errors(); - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } if (extendedLocation() != null) { extendedLocation().validate(); diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/SapInstanceInner.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/SapInstanceInner.java index 43a9793bcb173..5fa378285447e 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/SapInstanceInner.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/SapInstanceInner.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migrationdiscoverysap.models.ProvisioningState; -import com.azure.resourcemanager.migrationdiscoverysap.models.SapInstanceEnvironment; -import com.azure.resourcemanager.migrationdiscoverysap.models.SapMigrateError; +import com.azure.resourcemanager.migrationdiscoverysap.models.SapInstanceProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -22,7 +20,7 @@ public final class SapInstanceInner extends Resource { * The resource-specific properties for this resource. */ @JsonProperty(value = "properties") - private SapInstanceProperties innerProperties; + private SapInstanceProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -37,12 +35,23 @@ public SapInstanceInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private SapInstanceProperties innerProperties() { - return this.innerProperties; + public SapInstanceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SapInstanceInner object itself. + */ + public SapInstanceInner withProperties(SapInstanceProperties properties) { + this.properties = properties; + return this; } /** @@ -72,72 +81,14 @@ public SapInstanceInner withTags(Map tags) { return this; } - /** - * Get the systemSid property: This is the SID of SAP System. Keeping this not equal to ID as different landscapes - * can have repeated System SID IDs. - * - * @return the systemSid value. - */ - public String systemSid() { - return this.innerProperties() == null ? null : this.innerProperties().systemSid(); - } - - /** - * Get the environment property: The Environment; PRD, QA, DEV, etc to which SAP system belongs to. Select from the - * list of available dropdown values. - * - * @return the environment value. - */ - public SapInstanceEnvironment environment() { - return this.innerProperties() == null ? null : this.innerProperties().environment(); - } - - /** - * Get the landscapeSid property: This is the SID of the production system in a landscape. An SAP system could - * itself be a production SID or a part of a landscape with a different Production SID. This field can be used to - * relate non-prod SIDs, other components, SID (WEBDISP) to the prod SID. Enter the value of Production SID. - * - * @return the landscapeSid value. - */ - public String landscapeSid() { - return this.innerProperties() == null ? null : this.innerProperties().landscapeSid(); - } - - /** - * Get the application property: Enter a business function/department identifier to group multiple SIDs. - * - * @return the application value. - */ - public String application() { - return this.innerProperties() == null ? null : this.innerProperties().application(); - } - - /** - * Get the provisioningState property: Defines the provisioning states. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the errors property: Defines the errors related to SAP Instance resource. - * - * @return the errors value. - */ - public SapMigrateError errors() { - return this.innerProperties() == null ? null : this.innerProperties().errors(); - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/ServerInstanceInner.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/ServerInstanceInner.java index 73285ed07f671..39fc66ecbc026 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/ServerInstanceInner.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/ServerInstanceInner.java @@ -4,27 +4,22 @@ package com.azure.resourcemanager.migrationdiscoverysap.fluent.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.migrationdiscoverysap.models.ConfigurationData; -import com.azure.resourcemanager.migrationdiscoverysap.models.OperatingSystem; -import com.azure.resourcemanager.migrationdiscoverysap.models.PerformanceData; -import com.azure.resourcemanager.migrationdiscoverysap.models.ProvisioningState; -import com.azure.resourcemanager.migrationdiscoverysap.models.SapInstanceType; -import com.azure.resourcemanager.migrationdiscoverysap.models.SapMigrateError; +import com.azure.resourcemanager.migrationdiscoverysap.models.ServerInstanceProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** * Define the Server Instance resource. */ -@Immutable +@Fluent public final class ServerInstanceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ @JsonProperty(value = "properties") - private ServerInstanceProperties innerProperties; + private ServerInstanceProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -39,115 +34,32 @@ public ServerInstanceInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private ServerInstanceProperties innerProperties() { - return this.innerProperties; + public ServerInstanceProperties properties() { + return this.properties; } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the serverName property: This is the Virtual Machine Name of the SAP system. Add all the virtual machines - * attached to an SAP system which you wish to migrate to Azure. Keeping this not equal to ID as for single tier - * all InstanceTypes would be on same server, leading to multiple resources with same servername. - * - * @return the serverName value. - */ - public String serverName() { - return this.innerProperties() == null ? null : this.innerProperties().serverName(); - } - - /** - * Get the sapInstanceType property: Defines the type SAP instance on this server instance. + * Set the properties property: The resource-specific properties for this resource. * - * @return the sapInstanceType value. + * @param properties the properties value to set. + * @return the ServerInstanceInner object itself. */ - public SapInstanceType sapInstanceType() { - return this.innerProperties() == null ? null : this.innerProperties().sapInstanceType(); + public ServerInstanceInner withProperties(ServerInstanceProperties properties) { + this.properties = properties; + return this; } /** - * Get the instanceSid property: This is the Instance SID for ASCS/AP/DB instance. An SAP system with HANA - * database for example could have a different SID for database Instance than that of ASCS instance. - * - * @return the instanceSid value. - */ - public String instanceSid() { - return this.innerProperties() == null ? null : this.innerProperties().instanceSid(); - } - - /** - * Get the sapProduct property: This is the SAP Application Component; e.g. SAP S/4HANA 2022, SAP ERP ENHANCE - * PACKAGE. - * - * @return the sapProduct value. - */ - public String sapProduct() { - return this.innerProperties() == null ? null : this.innerProperties().sapProduct(); - } - - /** - * Get the sapProductVersion property: Provide the product version of the SAP product. - * - * @return the sapProductVersion value. - */ - public String sapProductVersion() { - return this.innerProperties() == null ? null : this.innerProperties().sapProductVersion(); - } - - /** - * Get the operatingSystem property: This is Operating System on which the host server is running. - * - * @return the operatingSystem value. - */ - public OperatingSystem operatingSystem() { - return this.innerProperties() == null ? null : this.innerProperties().operatingSystem(); - } - - /** - * Get the configurationData property: Configuration data for this server instance. - * - * @return the configurationData value. - */ - public ConfigurationData configurationData() { - return this.innerProperties() == null ? null : this.innerProperties().configurationData(); - } - - /** - * Get the performanceData property: Configuration data for this server instance. - * - * @return the performanceData value. - */ - public PerformanceData performanceData() { - return this.innerProperties() == null ? null : this.innerProperties().performanceData(); - } - - /** - * Get the provisioningState property: Defines the provisioning states. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the errors property: Defines the errors related to SAP Instance resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the errors value. + * @return the systemData value. */ - public SapMigrateError errors() { - return this.innerProperties() == null ? null : this.innerProperties().errors(); + public SystemData systemData() { + return this.systemData; } /** @@ -156,8 +68,8 @@ public SapMigrateError errors() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/implementation/SapDiscoverySiteImpl.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/implementation/SapDiscoverySiteImpl.java index 427df9054187b..fbcfcb945f922 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/implementation/SapDiscoverySiteImpl.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/implementation/SapDiscoverySiteImpl.java @@ -10,10 +10,9 @@ import com.azure.resourcemanager.migrationdiscoverysap.fluent.models.SapDiscoverySiteInner; import com.azure.resourcemanager.migrationdiscoverysap.models.ExtendedLocation; import com.azure.resourcemanager.migrationdiscoverysap.models.OperationStatusResult; -import com.azure.resourcemanager.migrationdiscoverysap.models.ProvisioningState; import com.azure.resourcemanager.migrationdiscoverysap.models.SapDiscoverySite; +import com.azure.resourcemanager.migrationdiscoverysap.models.SapDiscoverySiteProperties; import com.azure.resourcemanager.migrationdiscoverysap.models.SapDiscoverySiteTagsUpdate; -import com.azure.resourcemanager.migrationdiscoverysap.models.SapMigrateError; import java.util.Collections; import java.util.Map; @@ -48,6 +47,10 @@ public Map tags() { } } + public SapDiscoverySiteProperties properties() { + return this.innerModel().properties(); + } + public ExtendedLocation extendedLocation() { return this.innerModel().extendedLocation(); } @@ -56,22 +59,6 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public String masterSiteId() { - return this.innerModel().masterSiteId(); - } - - public String migrateProjectId() { - return this.innerModel().migrateProjectId(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public SapMigrateError errors() { - return this.innerModel().errors(); - } - public Region region() { return Region.fromName(this.regionName()); } @@ -187,18 +174,13 @@ public SapDiscoverySiteImpl withTags(Map tags) { } } - public SapDiscoverySiteImpl withExtendedLocation(ExtendedLocation extendedLocation) { - this.innerModel().withExtendedLocation(extendedLocation); - return this; - } - - public SapDiscoverySiteImpl withMasterSiteId(String masterSiteId) { - this.innerModel().withMasterSiteId(masterSiteId); + public SapDiscoverySiteImpl withProperties(SapDiscoverySiteProperties properties) { + this.innerModel().withProperties(properties); return this; } - public SapDiscoverySiteImpl withMigrateProjectId(String migrateProjectId) { - this.innerModel().withMigrateProjectId(migrateProjectId); + public SapDiscoverySiteImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); return this; } diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/implementation/SapInstanceImpl.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/implementation/SapInstanceImpl.java index 66e1e4601b88a..086e15f8931f9 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/implementation/SapInstanceImpl.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/implementation/SapInstanceImpl.java @@ -8,11 +8,9 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.migrationdiscoverysap.fluent.models.SapInstanceInner; -import com.azure.resourcemanager.migrationdiscoverysap.models.ProvisioningState; import com.azure.resourcemanager.migrationdiscoverysap.models.SapInstance; -import com.azure.resourcemanager.migrationdiscoverysap.models.SapInstanceEnvironment; +import com.azure.resourcemanager.migrationdiscoverysap.models.SapInstanceProperties; import com.azure.resourcemanager.migrationdiscoverysap.models.SapInstanceTagsUpdate; -import com.azure.resourcemanager.migrationdiscoverysap.models.SapMigrateError; import java.util.Collections; import java.util.Map; @@ -46,32 +44,12 @@ public Map tags() { } } - public SystemData systemData() { - return this.innerModel().systemData(); + public SapInstanceProperties properties() { + return this.innerModel().properties(); } - public String systemSid() { - return this.innerModel().systemSid(); - } - - public SapInstanceEnvironment environment() { - return this.innerModel().environment(); - } - - public String landscapeSid() { - return this.innerModel().landscapeSid(); - } - - public String application() { - return this.innerModel().application(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public SapMigrateError errors() { - return this.innerModel().errors(); + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -186,6 +164,11 @@ public SapInstanceImpl withTags(Map tags) { } } + public SapInstanceImpl withProperties(SapInstanceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/implementation/ServerInstanceImpl.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/implementation/ServerInstanceImpl.java index 586488ca718b7..6e52c51bee166 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/implementation/ServerInstanceImpl.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/implementation/ServerInstanceImpl.java @@ -7,14 +7,8 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.migrationdiscoverysap.fluent.models.ServerInstanceInner; -import com.azure.resourcemanager.migrationdiscoverysap.fluent.models.ServerInstanceProperties; -import com.azure.resourcemanager.migrationdiscoverysap.models.ConfigurationData; -import com.azure.resourcemanager.migrationdiscoverysap.models.OperatingSystem; -import com.azure.resourcemanager.migrationdiscoverysap.models.PerformanceData; -import com.azure.resourcemanager.migrationdiscoverysap.models.ProvisioningState; -import com.azure.resourcemanager.migrationdiscoverysap.models.SapInstanceType; -import com.azure.resourcemanager.migrationdiscoverysap.models.SapMigrateError; import com.azure.resourcemanager.migrationdiscoverysap.models.ServerInstance; +import com.azure.resourcemanager.migrationdiscoverysap.models.ServerInstanceProperties; import com.azure.resourcemanager.migrationdiscoverysap.models.UpdateServerInstanceRequest; public final class ServerInstanceImpl implements ServerInstance, ServerInstance.Definition, ServerInstance.Update { @@ -34,48 +28,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String serverName() { - return this.innerModel().serverName(); + public ServerInstanceProperties properties() { + return this.innerModel().properties(); } - public SapInstanceType sapInstanceType() { - return this.innerModel().sapInstanceType(); - } - - public String instanceSid() { - return this.innerModel().instanceSid(); - } - - public String sapProduct() { - return this.innerModel().sapProduct(); - } - - public String sapProductVersion() { - return this.innerModel().sapProductVersion(); - } - - public OperatingSystem operatingSystem() { - return this.innerModel().operatingSystem(); - } - - public ConfigurationData configurationData() { - return this.innerModel().configurationData(); - } - - public PerformanceData performanceData() { - return this.innerModel().performanceData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public SapMigrateError errors() { - return this.innerModel().errors(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -169,7 +127,16 @@ public ServerInstance refresh(Context context) { } public ServerInstanceImpl withProperties(ServerInstanceProperties 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() { + return this.innerModel().id() == null; } } diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/ErrorDefinition.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/ErrorDefinition.java similarity index 96% rename from sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/ErrorDefinition.java rename to sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/ErrorDefinition.java index e963d340a3000..2bf36776a6496 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/ErrorDefinition.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/ErrorDefinition.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.migrationdiscoverysap.fluent.models; +package com.azure.resourcemanager.migrationdiscoverysap.models; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapDiscoverySite.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapDiscoverySite.java index 919a468d89d54..6849387a20cdf 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapDiscoverySite.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapDiscoverySite.java @@ -49,6 +49,13 @@ public interface SapDiscoverySite { */ Map tags(); + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SapDiscoverySiteProperties properties(); + /** * Gets the extendedLocation property: The extended location definition. * @@ -63,34 +70,6 @@ public interface SapDiscoverySite { */ SystemData systemData(); - /** - * Gets the masterSiteId property: The master site ID from Azure Migrate. - * - * @return the masterSiteId value. - */ - String masterSiteId(); - - /** - * Gets the migrateProjectId property: The migrate project ID from Azure Migrate. - * - * @return the migrateProjectId value. - */ - String migrateProjectId(); - - /** - * Gets the provisioningState property: Defines the provisioning states. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the errors property: Indicates any errors on the SAP Migration discovery site resource. - * - * @return the errors value. - */ - SapMigrateError errors(); - /** * Gets the region of the resource. * @@ -174,8 +153,8 @@ interface WithResourceGroup { * The stage of the SapDiscoverySite definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithExtendedLocation, - DefinitionStages.WithMasterSiteId, DefinitionStages.WithMigrateProjectId { + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithProperties, DefinitionStages.WithExtendedLocation { /** * Executes the create request. * @@ -206,42 +185,29 @@ interface WithTags { } /** - * The stage of the SapDiscoverySite definition allowing to specify extendedLocation. + * The stage of the SapDiscoverySite definition allowing to specify properties. */ - interface WithExtendedLocation { + interface WithProperties { /** - * Specifies the extendedLocation property: The extended location definition.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param extendedLocation The extended location definition. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + WithCreate withProperties(SapDiscoverySiteProperties properties); } /** - * The stage of the SapDiscoverySite definition allowing to specify masterSiteId. - */ - interface WithMasterSiteId { - /** - * Specifies the masterSiteId property: The master site ID from Azure Migrate.. - * - * @param masterSiteId The master site ID from Azure Migrate. - * @return the next definition stage. - */ - WithCreate withMasterSiteId(String masterSiteId); - } - - /** - * The stage of the SapDiscoverySite definition allowing to specify migrateProjectId. + * The stage of the SapDiscoverySite definition allowing to specify extendedLocation. */ - interface WithMigrateProjectId { + interface WithExtendedLocation { /** - * Specifies the migrateProjectId property: The migrate project ID from Azure Migrate.. + * Specifies the extendedLocation property: The extended location definition.. * - * @param migrateProjectId The migrate project ID from Azure Migrate. + * @param extendedLocation The extended location definition. * @return the next definition stage. */ - WithCreate withMigrateProjectId(String migrateProjectId); + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); } } diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/SapDiscoverySiteProperties.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapDiscoverySiteProperties.java similarity index 93% rename from sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/SapDiscoverySiteProperties.java rename to sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapDiscoverySiteProperties.java index 8d672c9b9e9aa..7ba95dd09b85c 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/SapDiscoverySiteProperties.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapDiscoverySiteProperties.java @@ -2,11 +2,9 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.migrationdiscoverysap.fluent.models; +package com.azure.resourcemanager.migrationdiscoverysap.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.migrationdiscoverysap.models.ProvisioningState; -import com.azure.resourcemanager.migrationdiscoverysap.models.SapMigrateError; import com.fasterxml.jackson.annotation.JsonProperty; /** diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapInstance.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapInstance.java index fb41006e3ce2d..c4715c8233c28 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapInstance.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapInstance.java @@ -50,57 +50,18 @@ public interface SapInstance { Map tags(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the systemSid property: This is the SID of SAP System. Keeping this not equal to ID as different landscapes - * can have repeated System SID IDs. - * - * @return the systemSid value. - */ - String systemSid(); - - /** - * Gets the environment property: The Environment; PRD, QA, DEV, etc to which SAP system belongs to. Select from the - * list of available dropdown values. - * - * @return the environment value. - */ - SapInstanceEnvironment environment(); - - /** - * Gets the landscapeSid property: This is the SID of the production system in a landscape. An SAP system could - * itself be a production SID or a part of a landscape with a different Production SID. This field can be used to - * relate non-prod SIDs, other components, SID (WEBDISP) to the prod SID. Enter the value of Production SID. - * - * @return the landscapeSid value. - */ - String landscapeSid(); - - /** - * Gets the application property: Enter a business function/department identifier to group multiple SIDs. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the application value. + * @return the properties value. */ - String application(); + SapInstanceProperties properties(); /** - * Gets the provisioningState property: Defines the provisioning states. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the errors property: Defines the errors related to SAP Instance resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the errors value. + * @return the systemData value. */ - SapMigrateError errors(); + SystemData systemData(); /** * Gets the region of the resource. @@ -186,7 +147,7 @@ interface WithParentResource { * The stage of the SapInstance definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { /** * Executes the create request. * @@ -215,6 +176,19 @@ interface WithTags { */ WithCreate withTags(Map tags); } + + /** + * The stage of the SapInstance 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(SapInstanceProperties properties); + } } /** diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/SapInstanceProperties.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapInstanceProperties.java similarity index 92% rename from sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/SapInstanceProperties.java rename to sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapInstanceProperties.java index ae6a03420436e..d59eead7e4d78 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/SapInstanceProperties.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapInstanceProperties.java @@ -2,12 +2,9 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.migrationdiscoverysap.fluent.models; +package com.azure.resourcemanager.migrationdiscoverysap.models; import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.migrationdiscoverysap.models.ProvisioningState; -import com.azure.resourcemanager.migrationdiscoverysap.models.SapInstanceEnvironment; -import com.azure.resourcemanager.migrationdiscoverysap.models.SapMigrateError; import com.fasterxml.jackson.annotation.JsonProperty; /** diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapMigrateError.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapMigrateError.java index 52b8aa6be6111..46f9c854cf3f5 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapMigrateError.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/SapMigrateError.java @@ -4,21 +4,19 @@ package com.azure.resourcemanager.migrationdiscoverysap.models; -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.migrationdiscoverysap.fluent.models.ErrorDefinition; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; /** * An error response from the SAP migrate resources. */ -@Immutable +@Fluent public final class SapMigrateError { /* * The SAP Discovery site resource error body. */ @JsonProperty(value = "properties") - private ErrorDefinition innerProperties; + private ErrorDefinition properties; /** * Creates an instance of SapMigrateError class. @@ -27,48 +25,23 @@ public SapMigrateError() { } /** - * Get the innerProperties property: The SAP Discovery site resource error body. + * Get the properties property: The SAP Discovery site resource error body. * - * @return the innerProperties value. + * @return the properties value. */ - private ErrorDefinition innerProperties() { - return this.innerProperties; + public ErrorDefinition properties() { + return this.properties; } /** - * Get the code property: Service specific error code which serves as the substatus for the HTTP error code. + * Set the properties property: The SAP Discovery site resource error body. * - * @return the code value. + * @param properties the properties value to set. + * @return the SapMigrateError object itself. */ - public String code() { - return this.innerProperties() == null ? null : this.innerProperties().code(); - } - - /** - * Get the message property: Description of the error. - * - * @return the message value. - */ - public String message() { - return this.innerProperties() == null ? null : this.innerProperties().message(); - } - - /** - * Get the recommendation property: Description of the recommendation. - * - * @return the recommendation value. - */ - public String recommendation() { - return this.innerProperties() == null ? null : this.innerProperties().recommendation(); - } - - /** - * Get the details property: Internal error details. - * - * @return the details value. - */ - public List details() { - return this.innerProperties() == null ? null : this.innerProperties().details(); + public SapMigrateError withProperties(ErrorDefinition properties) { + this.properties = properties; + return this; } /** @@ -77,8 +50,8 @@ public List details() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/ServerInstance.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/ServerInstance.java index 6160bcf1fb722..e7b6d455de7ff 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/ServerInstance.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/ServerInstance.java @@ -7,7 +7,6 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.migrationdiscoverysap.fluent.models.ServerInstanceInner; -import com.azure.resourcemanager.migrationdiscoverysap.fluent.models.ServerInstanceProperties; /** * An immutable client-side representation of ServerInstance. @@ -35,85 +34,18 @@ public interface ServerInstance { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the serverName property: This is the Virtual Machine Name of the SAP system. Add all the virtual machines - * attached to an SAP system which you wish to migrate to Azure. Keeping this not equal to ID as for single tier all - * InstanceTypes would be on same server, leading to multiple resources with same servername. - * - * @return the serverName value. - */ - String serverName(); - - /** - * Gets the sapInstanceType property: Defines the type SAP instance on this server instance. - * - * @return the sapInstanceType value. - */ - SapInstanceType sapInstanceType(); - - /** - * Gets the instanceSid property: This is the Instance SID for ASCS/AP/DB instance. An SAP system with HANA database - * for example could have a different SID for database Instance than that of ASCS instance. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the instanceSid value. + * @return the properties value. */ - String instanceSid(); + ServerInstanceProperties properties(); /** - * Gets the sapProduct property: This is the SAP Application Component; e.g. SAP S/4HANA 2022, SAP ERP ENHANCE - * PACKAGE. - * - * @return the sapProduct value. - */ - String sapProduct(); - - /** - * Gets the sapProductVersion property: Provide the product version of the SAP product. - * - * @return the sapProductVersion value. - */ - String sapProductVersion(); - - /** - * Gets the operatingSystem property: This is Operating System on which the host server is running. - * - * @return the operatingSystem value. - */ - OperatingSystem operatingSystem(); - - /** - * Gets the configurationData property: Configuration data for this server instance. - * - * @return the configurationData value. - */ - ConfigurationData configurationData(); - - /** - * Gets the performanceData property: Configuration data for this server instance. - * - * @return the performanceData value. - */ - PerformanceData performanceData(); - - /** - * Gets the provisioningState property: Defines the provisioning states. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the errors property: Defines the errors related to SAP Instance resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the errors value. + * @return the systemData value. */ - SapMigrateError errors(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -166,7 +98,7 @@ WithCreate withExistingSapInstance(String resourceGroupName, String sapDiscovery * The stage of the ServerInstance 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 { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -182,6 +114,19 @@ interface WithCreate { */ ServerInstance create(Context context); } + + /** + * The stage of the ServerInstance 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(ServerInstanceProperties properties); + } } /** diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/ServerInstanceProperties.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/ServerInstanceProperties.java similarity index 91% rename from sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/ServerInstanceProperties.java rename to sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/ServerInstanceProperties.java index b98b16376d736..812cdcbb3140b 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/fluent/models/ServerInstanceProperties.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/ServerInstanceProperties.java @@ -2,15 +2,9 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.migrationdiscoverysap.fluent.models; +package com.azure.resourcemanager.migrationdiscoverysap.models; import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.migrationdiscoverysap.models.ConfigurationData; -import com.azure.resourcemanager.migrationdiscoverysap.models.OperatingSystem; -import com.azure.resourcemanager.migrationdiscoverysap.models.PerformanceData; -import com.azure.resourcemanager.migrationdiscoverysap.models.ProvisioningState; -import com.azure.resourcemanager.migrationdiscoverysap.models.SapInstanceType; -import com.azure.resourcemanager.migrationdiscoverysap.models.SapMigrateError; import com.fasterxml.jackson.annotation.JsonProperty; /** diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/UpdateServerInstanceRequest.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/UpdateServerInstanceRequest.java index 9df102dcc520f..1ac6b631d4479 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/UpdateServerInstanceRequest.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/java/com/azure/resourcemanager/migrationdiscoverysap/models/UpdateServerInstanceRequest.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.migrationdiscoverysap.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.migrationdiscoverysap.fluent.models.ServerInstanceProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migrationdiscoverysap/reflect-config.json b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migrationdiscoverysap/reflect-config.json index a7c599af1283f..05b5a45a38a27 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migrationdiscoverysap/reflect-config.json +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migrationdiscoverysap/reflect-config.json @@ -9,7 +9,7 @@ "allDeclaredFields" : true, "allDeclaredMethods" : true }, { - "name" : "com.azure.resourcemanager.migrationdiscoverysap.fluent.models.SapDiscoverySiteProperties", + "name" : "com.azure.resourcemanager.migrationdiscoverysap.models.SapDiscoverySiteProperties", "allDeclaredConstructors" : true, "allDeclaredFields" : true, "allDeclaredMethods" : true @@ -19,7 +19,7 @@ "allDeclaredFields" : true, "allDeclaredMethods" : true }, { - "name" : "com.azure.resourcemanager.migrationdiscoverysap.fluent.models.ErrorDefinition", + "name" : "com.azure.resourcemanager.migrationdiscoverysap.models.ErrorDefinition", "allDeclaredConstructors" : true, "allDeclaredFields" : true, "allDeclaredMethods" : true @@ -49,7 +49,7 @@ "allDeclaredFields" : true, "allDeclaredMethods" : true }, { - "name" : "com.azure.resourcemanager.migrationdiscoverysap.fluent.models.SapInstanceProperties", + "name" : "com.azure.resourcemanager.migrationdiscoverysap.models.SapInstanceProperties", "allDeclaredConstructors" : true, "allDeclaredFields" : true, "allDeclaredMethods" : true @@ -69,7 +69,7 @@ "allDeclaredFields" : true, "allDeclaredMethods" : true }, { - "name" : "com.azure.resourcemanager.migrationdiscoverysap.fluent.models.ServerInstanceProperties", + "name" : "com.azure.resourcemanager.migrationdiscoverysap.models.ServerInstanceProperties", "allDeclaredConstructors" : true, "allDeclaredFields" : true, "allDeclaredMethods" : true diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/samples/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapDiscoverySitesCreateSamples.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/samples/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapDiscoverySitesCreateSamples.java index 779bae769c211..e1ba340135d23 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/samples/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapDiscoverySitesCreateSamples.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/samples/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapDiscoverySitesCreateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.migrationdiscoverysap.generated; +import com.azure.resourcemanager.migrationdiscoverysap.models.SapDiscoverySiteProperties; import java.util.HashMap; import java.util.Map; @@ -24,8 +25,10 @@ public final class SapDiscoverySitesCreateSamples { public static void createResourceForImportBasedInput( com.azure.resourcemanager.migrationdiscoverysap.MigrationDiscoverySapManager manager) { manager.sapDiscoverySites().define("SampleSite").withRegion("eastus").withExistingResourceGroup("test-rg") - .withTags(mapOf("property1", "value1", "property2", "value2")).withMasterSiteId("MasterSiteIdResourceId") - .withMigrateProjectId("MigrateProjectId").create(); + .withTags(mapOf("property1", "value1", "property2", "value2")) + .withProperties(new SapDiscoverySiteProperties().withMasterSiteId("MasterSiteIdResourceId") + .withMigrateProjectId("MigrateProjectId")) + .create(); } // Use "Map.of" if available diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/samples/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapInstancesCreateSamples.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/samples/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapInstancesCreateSamples.java index 57d4fd95e6b0e..5aad35b5c84ed 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/samples/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapInstancesCreateSamples.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/samples/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapInstancesCreateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.migrationdiscoverysap.generated; +import com.azure.resourcemanager.migrationdiscoverysap.models.SapInstanceProperties; import java.util.HashMap; import java.util.Map; @@ -25,7 +26,8 @@ public static void createsTheSAPInstanceResource( com.azure.resourcemanager.migrationdiscoverysap.MigrationDiscoverySapManager manager) { manager.sapInstances().define("MPP_MPP").withRegion("eastus") .withExistingSapDiscoverySite("test-rg", "SampleSite") - .withTags(mapOf("property1", "value1", "property2", "value2")).create(); + .withTags(mapOf("property1", "value1", "property2", "value2")).withProperties(new SapInstanceProperties()) + .create(); } // Use "Map.of" if available diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/samples/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ServerInstancesUpdateSamples.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/samples/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ServerInstancesUpdateSamples.java index 2c49e21ed5043..0390b4d2ba5a5 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/samples/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ServerInstancesUpdateSamples.java +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/samples/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ServerInstancesUpdateSamples.java @@ -4,8 +4,8 @@ package com.azure.resourcemanager.migrationdiscoverysap.generated; -import com.azure.resourcemanager.migrationdiscoverysap.fluent.models.ServerInstanceProperties; import com.azure.resourcemanager.migrationdiscoverysap.models.ServerInstance; +import com.azure.resourcemanager.migrationdiscoverysap.models.ServerInstanceProperties; /** * Samples for ServerInstances Update. diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ConfigurationDataTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ConfigurationDataTests.java new file mode 100644 index 0000000000000..27332acf86fed --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ConfigurationDataTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migrationdiscoverysap.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrationdiscoverysap.models.ConfigurationData; + +public final class ConfigurationDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConfigurationData model = BinaryData.fromString( + "{\"saps\":269185067,\"cpu\":1273206758,\"cpuType\":\"dxob\",\"cpuInMhz\":1455975978,\"ram\":64161547,\"hardwareManufacturer\":\"pxokajionp\",\"model\":\"ex\",\"totalDiskSizeGB\":1260380641,\"totalDiskIops\":869325543,\"databaseType\":\"SQLServer\",\"targetHanaRamSizeGB\":524649765}") + .toObject(ConfigurationData.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConfigurationData model = new ConfigurationData(); + model = BinaryData.fromObject(model).toObject(ConfigurationData.class); + } +} diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ExcelPerformanceDataTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ExcelPerformanceDataTests.java new file mode 100644 index 0000000000000..1d3c13098d2b0 --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ExcelPerformanceDataTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migrationdiscoverysap.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrationdiscoverysap.models.ExcelPerformanceData; + +public final class ExcelPerformanceDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExcelPerformanceData model = BinaryData + .fromString("{\"dataSource\":\"Excel\",\"maxCpuLoad\":1111118193,\"totalSourceDbSizeGB\":1242878165}") + .toObject(ExcelPerformanceData.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ExcelPerformanceData model = new ExcelPerformanceData(); + model = BinaryData.fromObject(model).toObject(ExcelPerformanceData.class); + } +} diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ExtendedLocationTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ExtendedLocationTests.java new file mode 100644 index 0000000000000..4ec56ecddbd48 --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ExtendedLocationTests.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.migrationdiscoverysap.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrationdiscoverysap.models.ExtendedLocation; +import org.junit.jupiter.api.Assertions; + +public final class ExtendedLocationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExtendedLocation model + = BinaryData.fromString("{\"type\":\"qes\",\"name\":\"agdfmglzlh\"}").toObject(ExtendedLocation.class); + Assertions.assertEquals("qes", model.type()); + Assertions.assertEquals("agdfmglzlh", model.name()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ExtendedLocation model = new ExtendedLocation().withType("qes").withName("agdfmglzlh"); + model = BinaryData.fromObject(model).toObject(ExtendedLocation.class); + Assertions.assertEquals("qes", model.type()); + Assertions.assertEquals("agdfmglzlh", model.name()); + } +} diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/NativePerformanceDataTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/NativePerformanceDataTests.java new file mode 100644 index 0000000000000..b176364e7448e --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/NativePerformanceDataTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migrationdiscoverysap.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrationdiscoverysap.models.NativePerformanceData; + +public final class NativePerformanceDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NativePerformanceData model + = BinaryData.fromString("{\"dataSource\":\"Native\"}").toObject(NativePerformanceData.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NativePerformanceData model = new NativePerformanceData(); + model = BinaryData.fromObject(model).toObject(NativePerformanceData.class); + } +} diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/OperationDisplayTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/OperationDisplayTests.java new file mode 100644 index 0000000000000..c99248d9b79b6 --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/OperationDisplayTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migrationdiscoverysap.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrationdiscoverysap.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"isnjampmngnz\",\"resource\":\"xaqwoochcbonqv\",\"operation\":\"vlrxnjeaseiph\",\"description\":\"f\"}") + .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/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/OperationInnerTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/OperationInnerTests.java new file mode 100644 index 0000000000000..d75bc272d8bbb --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/OperationInnerTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migrationdiscoverysap.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrationdiscoverysap.fluent.models.OperationInner; +import com.azure.resourcemanager.migrationdiscoverysap.models.OperationDisplay; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = BinaryData.fromString( + "{\"name\":\"qabcypm\",\"isDataAction\":true,\"display\":{\"provider\":\"zuvccfwnfnbacfio\",\"resource\":\"ebxetqgtzxdp\",\"operation\":\"bqqwxrj\",\"description\":\"al\"},\"origin\":\"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/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/OperationListResultTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/OperationListResultTests.java new file mode 100644 index 0000000000000..7b613812d9f42 --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/OperationListResultTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migrationdiscoverysap.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrationdiscoverysap.models.OperationListResult; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"fcyddg\",\"isDataAction\":true,\"display\":{\"provider\":\"jqkwpyeicx\",\"resource\":\"ciwqvhk\",\"operation\":\"xuigdtopbobj\",\"description\":\"hm\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"uhrzayvvt\",\"isDataAction\":false,\"display\":{\"provider\":\"giotkftutqxlngx\",\"resource\":\"fgugnxkrxdqmid\",\"operation\":\"hzrvqd\",\"description\":\"bhj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"oqfbowskanyk\",\"isDataAction\":true,\"display\":{\"provider\":\"iywgqywgndrvynh\",\"resource\":\"pphrcgynco\",\"operation\":\"ecfvmm\",\"description\":\"ofsx\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"m\"}") + .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/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/OperationStatusResultInnerTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/OperationStatusResultInnerTests.java new file mode 100644 index 0000000000000..a554f2693a7ca --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/OperationStatusResultInnerTests.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.migrationdiscoverysap.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrationdiscoverysap.fluent.models.OperationStatusResultInner; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class OperationStatusResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationStatusResultInner model = BinaryData.fromString( + "{\"id\":\"jofjd\",\"name\":\"qs\",\"status\":\"deupewnwrei\",\"percentComplete\":13.74219,\"startTime\":\"2021-11-03T04:59:44Z\",\"endTime\":\"2021-04-06T23:33:47Z\",\"operations\":[{\"id\":\"hmofc\",\"name\":\"smy\",\"status\":\"rkdtmlxh\",\"percentComplete\":72.69686,\"startTime\":\"2021-01-05T18:43:06Z\",\"endTime\":\"2021-08-30T15:32:05Z\",\"operations\":[{\"id\":\"cdm\",\"name\":\"rcryuanzwuxzdxta\",\"status\":\"rlhm\",\"percentComplete\":12.271661,\"startTime\":\"2021-05-08T11:09:41Z\",\"endTime\":\"2021-09-15T08:01:43Z\",\"operations\":[{\"status\":\"mt\"},{\"status\":\"kknryrtihf\"},{\"status\":\"tijbpzvgnwzsymgl\"}]},{\"id\":\"cyzkohdbihanuf\",\"name\":\"cbjy\",\"status\":\"a\",\"percentComplete\":10.176063,\"startTime\":\"2021-05-03T19:17:55Z\",\"endTime\":\"2021-11-04T10:26:32Z\",\"operations\":[{\"status\":\"ifpikxwczby\"},{\"status\":\"cnpqxuhivyqniwby\"},{\"status\":\"rkxvdum\"}]},{\"id\":\"tfwvukxgaudc\",\"name\":\"nhsjcnyej\",\"status\":\"kryhtnapczwlokj\",\"percentComplete\":41.759808,\"startTime\":\"2021-12-06T06:12:28Z\",\"endTime\":\"2021-05-20T15:17:09Z\",\"operations\":[{\"status\":\"joxzjnchgejspodm\"},{\"status\":\"ilzyd\"},{\"status\":\"h\"}]},{\"id\":\"yahux\",\"name\":\"pmqnja\",\"status\":\"wixjsprozvcp\",\"percentComplete\":9.539038,\"startTime\":\"2021-12-06T20:49:14Z\",\"endTime\":\"2021-10-19T17:11:59Z\",\"operations\":[{\"status\":\"datscmd\"},{\"status\":\"pjhulsuuvmkj\"}]}]},{\"id\":\"wfndiodjpsl\",\"name\":\"jdpvwryo\",\"status\":\"psoacctazakljl\",\"percentComplete\":52.05834,\"startTime\":\"2021-01-28T11:44:18Z\",\"endTime\":\"2021-05-25T21:39:12Z\",\"operations\":[{\"id\":\"dosyg\",\"name\":\"paojakhmsbzjh\",\"status\":\"rzevdphlxaol\",\"percentComplete\":96.74444,\"startTime\":\"2021-03-26T21:15:35Z\",\"endTime\":\"2021-11-21T18:08:48Z\",\"operations\":[{\"status\":\"pfzfsinzgvfc\"}]},{\"id\":\"zoxxjtf\",\"name\":\"luwfzitonpeqfpjk\",\"status\":\"lxofpdvhpfxxypin\",\"percentComplete\":99.97951,\"startTime\":\"2020-12-28T03:18:28Z\",\"endTime\":\"2021-09-05T13:56:35Z\",\"operations\":[{\"status\":\"bkpodepooginuv\"},{\"status\":\"mihe\"}]},{\"id\":\"arxzxtheot\",\"name\":\"ivyevcciqihnhun\",\"status\":\"bwjzr\",\"percentComplete\":74.57618,\"startTime\":\"2021-11-20T13:28:32Z\",\"endTime\":\"2021-05-21T15:18:02Z\",\"operations\":[{\"status\":\"emv\"},{\"status\":\"zfkufubljofx\"},{\"status\":\"eofjaeqjh\"},{\"status\":\"jbasvmsmjqulngs\"}]}]},{\"id\":\"ybkzgcwr\",\"name\":\"lxxwrljdouskc\",\"status\":\"vkocrcjdkwtn\",\"percentComplete\":98.36213,\"startTime\":\"2020-12-31T19:07:05Z\",\"endTime\":\"2021-06-03T08:58:45Z\",\"operations\":[{\"id\":\"rglssainqpj\",\"name\":\"zlljfmppeebvm\",\"status\":\"xsabkyqdu\",\"percentComplete\":48.109997,\"startTime\":\"2021-09-28T15:07:41Z\",\"endTime\":\"2021-06-27T01:31:51Z\",\"operations\":[{\"status\":\"zevndhkrwpdappds\"},{\"status\":\"dkvwrwjfe\"},{\"status\":\"snhu\"}]},{\"id\":\"ltmrldh\",\"name\":\"jzzd\",\"status\":\"tqxhocdgeab\",\"percentComplete\":22.124004,\"startTime\":\"2021-10-17T04:41:11Z\",\"endTime\":\"2021-06-24T22:10:09Z\",\"operations\":[{\"status\":\"dvkaozw\"}]},{\"id\":\"tyhxhurokft\",\"name\":\"olniwpwcukjf\",\"status\":\"giawx\",\"percentComplete\":85.357414,\"startTime\":\"2021-03-29T10:44:54Z\",\"endTime\":\"2021-07-12T14:06:09Z\",\"operations\":[{\"status\":\"basyy\"},{\"status\":\"nddhsgcbacph\"}]}]}]}") + .toObject(OperationStatusResultInner.class); + Assertions.assertEquals("jofjd", model.id()); + Assertions.assertEquals("qs", model.name()); + Assertions.assertEquals("deupewnwrei", model.status()); + Assertions.assertEquals(13.74219F, model.percentComplete()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T04:59:44Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-06T23:33:47Z"), model.endTime()); + Assertions.assertEquals("hmofc", model.operations().get(0).id()); + Assertions.assertEquals("smy", model.operations().get(0).name()); + Assertions.assertEquals("rkdtmlxh", model.operations().get(0).status()); + Assertions.assertEquals(72.69686F, model.operations().get(0).percentComplete()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-05T18:43:06Z"), model.operations().get(0).startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-30T15:32:05Z"), model.operations().get(0).endTime()); + Assertions.assertEquals("cdm", model.operations().get(0).operations().get(0).id()); + Assertions.assertEquals("rcryuanzwuxzdxta", model.operations().get(0).operations().get(0).name()); + Assertions.assertEquals("rlhm", model.operations().get(0).operations().get(0).status()); + Assertions.assertEquals(12.271661F, model.operations().get(0).operations().get(0).percentComplete()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-08T11:09:41Z"), + model.operations().get(0).operations().get(0).startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T08:01:43Z"), + model.operations().get(0).operations().get(0).endTime()); + Assertions.assertEquals("mt", model.operations().get(0).operations().get(0).operations().get(0).status()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationStatusResultInner model + = new OperationStatusResultInner().withId("jofjd").withName("qs").withStatus("deupewnwrei") + .withPercentComplete(13.74219F).withStartTime( + OffsetDateTime.parse("2021-11-03T04:59:44Z")) + .withEndTime( + OffsetDateTime.parse("2021-04-06T23:33:47Z")) + .withOperations( + Arrays + .asList( + new OperationStatusResultInner().withId("hmofc").withName("smy").withStatus("rkdtmlxh") + .withPercentComplete(72.69686F) + .withStartTime(OffsetDateTime.parse("2021-01-05T18:43:06Z")) + .withEndTime( + OffsetDateTime.parse("2021-08-30T15:32:05Z")) + .withOperations(Arrays.asList( + new OperationStatusResultInner().withId("cdm").withName("rcryuanzwuxzdxta") + .withStatus("rlhm").withPercentComplete(12.271661F) + .withStartTime(OffsetDateTime.parse("2021-05-08T11:09:41Z")) + .withEndTime(OffsetDateTime.parse("2021-09-15T08:01:43Z")) + .withOperations(Arrays.asList(new OperationStatusResultInner().withStatus("mt"), + new OperationStatusResultInner().withStatus("kknryrtihf"), + new OperationStatusResultInner().withStatus("tijbpzvgnwzsymgl"))), + new OperationStatusResultInner().withId("cyzkohdbihanuf").withName("cbjy") + .withStatus("a").withPercentComplete(10.176063F) + .withStartTime(OffsetDateTime.parse("2021-05-03T19:17:55Z")) + .withEndTime(OffsetDateTime.parse("2021-11-04T10:26:32Z")).withOperations( + Arrays.asList(new OperationStatusResultInner().withStatus("ifpikxwczby"), + new OperationStatusResultInner().withStatus("cnpqxuhivyqniwby"), + new OperationStatusResultInner().withStatus("rkxvdum"))), + new OperationStatusResultInner().withId("tfwvukxgaudc").withName("nhsjcnyej") + .withStatus("kryhtnapczwlokj").withPercentComplete(41.759808F) + .withStartTime(OffsetDateTime.parse("2021-12-06T06:12:28Z")) + .withEndTime(OffsetDateTime.parse("2021-05-20T15:17:09Z")) + .withOperations(Arrays.asList( + new OperationStatusResultInner().withStatus("joxzjnchgejspodm"), + new OperationStatusResultInner().withStatus("ilzyd"), + new OperationStatusResultInner().withStatus("h"))), + new OperationStatusResultInner().withId("yahux").withName("pmqnja") + .withStatus("wixjsprozvcp").withPercentComplete(9.539038F) + .withStartTime(OffsetDateTime.parse("2021-12-06T20:49:14Z")) + .withEndTime(OffsetDateTime.parse("2021-10-19T17:11:59Z")).withOperations( + Arrays.asList(new OperationStatusResultInner().withStatus("datscmd"), + new OperationStatusResultInner().withStatus("pjhulsuuvmkj"))))), + new OperationStatusResultInner().withId("wfndiodjpsl").withName("jdpvwryo") + .withStatus("psoacctazakljl").withPercentComplete(52.05834F) + .withStartTime(OffsetDateTime.parse("2021-01-28T11:44:18Z")) + .withEndTime(OffsetDateTime.parse("2021-05-25T21:39:12Z")).withOperations( + Arrays.asList( + new OperationStatusResultInner().withId("dosyg").withName("paojakhmsbzjh") + .withStatus("rzevdphlxaol").withPercentComplete(96.74444F) + .withStartTime(OffsetDateTime.parse("2021-03-26T21:15:35Z")) + .withEndTime(OffsetDateTime.parse("2021-11-21T18:08:48Z")) + .withOperations(Arrays + .asList(new OperationStatusResultInner().withStatus("pfzfsinzgvfc"))), + new OperationStatusResultInner().withId("zoxxjtf").withName("luwfzitonpeqfpjk") + .withStatus("lxofpdvhpfxxypin").withPercentComplete(99.97951F) + .withStartTime(OffsetDateTime.parse("2020-12-28T03:18:28Z")) + .withEndTime(OffsetDateTime.parse("2021-09-05T13:56:35Z")) + .withOperations(Arrays.asList( + new OperationStatusResultInner().withStatus("bkpodepooginuv"), + new OperationStatusResultInner().withStatus("mihe"))), + new OperationStatusResultInner().withId("arxzxtheot") + .withName("ivyevcciqihnhun").withStatus("bwjzr") + .withPercentComplete(74.57618F) + .withStartTime(OffsetDateTime.parse("2021-11-20T13:28:32Z")) + .withEndTime(OffsetDateTime.parse("2021-05-21T15:18:02Z")).withOperations( + Arrays.asList(new OperationStatusResultInner().withStatus("emv"), + new OperationStatusResultInner().withStatus("zfkufubljofx"), + new OperationStatusResultInner().withStatus("eofjaeqjh"), + new OperationStatusResultInner().withStatus("jbasvmsmjqulngs"))))), + new OperationStatusResultInner().withId("ybkzgcwr").withName("lxxwrljdouskc") + .withStatus("vkocrcjdkwtn").withPercentComplete(98.36213F) + .withStartTime(OffsetDateTime.parse("2020-12-31T19:07:05Z")) + .withEndTime(OffsetDateTime.parse("2021-06-03T08:58:45Z")).withOperations( + Arrays.asList( + new OperationStatusResultInner().withId("rglssainqpj").withName("zlljfmppeebvm") + .withStatus("xsabkyqdu").withPercentComplete(48.109997F) + .withStartTime(OffsetDateTime.parse("2021-09-28T15:07:41Z")) + .withEndTime(OffsetDateTime.parse("2021-06-27T01:31:51Z")) + .withOperations(Arrays.asList( + new OperationStatusResultInner().withStatus("zevndhkrwpdappds"), + new OperationStatusResultInner().withStatus("dkvwrwjfe"), + new OperationStatusResultInner().withStatus("snhu"))), + new OperationStatusResultInner().withId("ltmrldh").withName("jzzd") + .withStatus("tqxhocdgeab").withPercentComplete(22.124004F) + .withStartTime(OffsetDateTime.parse("2021-10-17T04:41:11Z")) + .withEndTime(OffsetDateTime.parse("2021-06-24T22:10:09Z")).withOperations( + Arrays.asList(new OperationStatusResultInner().withStatus("dvkaozw"))), + new OperationStatusResultInner().withId("tyhxhurokft").withName("olniwpwcukjf") + .withStatus("giawx").withPercentComplete(85.357414F) + .withStartTime(OffsetDateTime.parse("2021-03-29T10:44:54Z")) + .withEndTime(OffsetDateTime.parse("2021-07-12T14:06:09Z")).withOperations( + Arrays.asList(new OperationStatusResultInner().withStatus("basyy"), + new OperationStatusResultInner().withStatus("nddhsgcbacph"))))))); + model = BinaryData.fromObject(model).toObject(OperationStatusResultInner.class); + Assertions.assertEquals("jofjd", model.id()); + Assertions.assertEquals("qs", model.name()); + Assertions.assertEquals("deupewnwrei", model.status()); + Assertions.assertEquals(13.74219F, model.percentComplete()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T04:59:44Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-06T23:33:47Z"), model.endTime()); + Assertions.assertEquals("hmofc", model.operations().get(0).id()); + Assertions.assertEquals("smy", model.operations().get(0).name()); + Assertions.assertEquals("rkdtmlxh", model.operations().get(0).status()); + Assertions.assertEquals(72.69686F, model.operations().get(0).percentComplete()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-05T18:43:06Z"), model.operations().get(0).startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-30T15:32:05Z"), model.operations().get(0).endTime()); + Assertions.assertEquals("cdm", model.operations().get(0).operations().get(0).id()); + Assertions.assertEquals("rcryuanzwuxzdxta", model.operations().get(0).operations().get(0).name()); + Assertions.assertEquals("rlhm", model.operations().get(0).operations().get(0).status()); + Assertions.assertEquals(12.271661F, model.operations().get(0).operations().get(0).percentComplete()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-08T11:09:41Z"), + model.operations().get(0).operations().get(0).startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T08:01:43Z"), + model.operations().get(0).operations().get(0).endTime()); + Assertions.assertEquals("mt", model.operations().get(0).operations().get(0).operations().get(0).status()); + } +} diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/OperationsListMockTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/OperationsListMockTests.java new file mode 100644 index 0000000000000..44995f747337c --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/OperationsListMockTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migrationdiscoverysap.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.migrationdiscoverysap.MigrationDiscoverySapManager; +import com.azure.resourcemanager.migrationdiscoverysap.models.Operation; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"value\":[{\"name\":\"rbpbewtghfgblcg\",\"isDataAction\":true,\"display\":{\"provider\":\"v\",\"resource\":\"jkbegibtnmxiebww\",\"operation\":\"oayqc\",\"description\":\"rtzju\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + MigrationDiscoverySapManager manager = MigrationDiscoverySapManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/PerformanceDataTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/PerformanceDataTests.java new file mode 100644 index 0000000000000..a4b1137fe2bb3 --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/PerformanceDataTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migrationdiscoverysap.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrationdiscoverysap.models.PerformanceData; + +public final class PerformanceDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PerformanceData model + = BinaryData.fromString("{\"dataSource\":\"PerformanceData\"}").toObject(PerformanceData.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PerformanceData model = new PerformanceData(); + model = BinaryData.fromObject(model).toObject(PerformanceData.class); + } +} diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapDiscoverySiteTagsUpdateTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapDiscoverySiteTagsUpdateTests.java new file mode 100644 index 0000000000000..ebb34be3877e8 --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapDiscoverySiteTagsUpdateTests.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.migrationdiscoverysap.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrationdiscoverysap.models.SapDiscoverySiteTagsUpdate; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class SapDiscoverySiteTagsUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SapDiscoverySiteTagsUpdate model + = BinaryData.fromString("{\"tags\":{\"pa\":\"ifkwmrvktsizntoc\",\"poyfdkfogkn\":\"uajpsquc\"}}") + .toObject(SapDiscoverySiteTagsUpdate.class); + Assertions.assertEquals("ifkwmrvktsizntoc", model.tags().get("pa")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SapDiscoverySiteTagsUpdate model + = new SapDiscoverySiteTagsUpdate().withTags(mapOf("pa", "ifkwmrvktsizntoc", "poyfdkfogkn", "uajpsquc")); + model = BinaryData.fromObject(model).toObject(SapDiscoverySiteTagsUpdate.class); + Assertions.assertEquals("ifkwmrvktsizntoc", model.tags().get("pa")); + } + + // 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/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapDiscoverySitesDeleteMockTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapDiscoverySitesDeleteMockTests.java new file mode 100644 index 0000000000000..5551adeac5513 --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapDiscoverySitesDeleteMockTests.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.migrationdiscoverysap.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.migrationdiscoverysap.MigrationDiscoverySapManager; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class SapDiscoverySitesDeleteMockTests { + @Test + public void testDelete() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + MigrationDiscoverySapManager manager = MigrationDiscoverySapManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.sapDiscoverySites().delete("nvowgujju", "wdkcglhsl", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapDiscoverySitesImportEntitiesMockTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapDiscoverySitesImportEntitiesMockTests.java new file mode 100644 index 0000000000000..33bc68d267a55 --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapDiscoverySitesImportEntitiesMockTests.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.migrationdiscoverysap.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.migrationdiscoverysap.MigrationDiscoverySapManager; +import com.azure.resourcemanager.migrationdiscoverysap.models.OperationStatusResult; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class SapDiscoverySitesImportEntitiesMockTests { + @Test + public void testImportEntities() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"id\":\"uofqwe\",\"name\":\"hmenevfyexfwhybc\",\"status\":\"bvyvdcsity\",\"percentComplete\":40.747864,\"startTime\":\"2021-01-25T02:11:12Z\",\"endTime\":\"2021-03-17T15:40:41Z\",\"operations\":[{\"id\":\"hfiqscjeypvhe\",\"name\":\"kgqhcjrefovg\",\"status\":\"kqsleyyvxy\",\"percentComplete\":16.411882,\"startTime\":\"2021-03-22T06:48:14Z\",\"endTime\":\"2021-04-09T05:45:58Z\",\"operations\":[{\"id\":\"gjcrcczsqpjhvm\",\"name\":\"jvnysounqe\",\"status\":\"a\",\"percentComplete\":9.069002,\"startTime\":\"2021-02-26T09:02:26Z\",\"endTime\":\"2021-10-06T07:30:47Z\",\"operations\":[{\"status\":\"hltrpmopjmcmatuo\"},{\"status\":\"thfuiuaodsfcpkvx\"},{\"status\":\"dpuozmyz\"},{\"status\":\"dagfuaxbezyiuok\"}]},{\"id\":\"hrdxwzywqsmbs\",\"name\":\"exim\",\"status\":\"ryocfsfksymdd\",\"percentComplete\":15.521979,\"startTime\":\"2021-06-14T21:05:42Z\",\"endTime\":\"2021-01-05T19:47:06Z\",\"operations\":[{\"status\":\"qyud\"},{\"status\":\"o\"},{\"status\":\"rq\"},{\"status\":\"b\"}]},{\"id\":\"zvyifqrvkdvj\",\"name\":\"lrmv\",\"status\":\"d\",\"percentComplete\":32.38682,\"startTime\":\"2021-08-07T11:35:41Z\",\"endTime\":\"2021-05-03T17:45:11Z\",\"operations\":[{\"status\":\"lexxbczwtru\"},{\"status\":\"iqzbq\"},{\"status\":\"vsovmyokac\"}]},{\"id\":\"w\",\"name\":\"zdobpxjmflbvvnch\",\"status\":\"kcciwwzjuqkhr\",\"percentComplete\":93.71816,\"startTime\":\"2021-10-14T07:23:56Z\",\"endTime\":\"2021-10-13T04:47:14Z\",\"operations\":[{\"status\":\"oskg\"},{\"status\":\"sauuimj\"},{\"status\":\"vxieduugidyj\"},{\"status\":\"rfbyaosvexcso\"}]}]},{\"id\":\"hocohslkev\",\"name\":\"ggzfbu\",\"status\":\"fmvfaxkffeiit\",\"percentComplete\":31.103909,\"startTime\":\"2021-03-03T15:08:10Z\",\"endTime\":\"2021-02-27T12:32:19Z\",\"operations\":[{\"id\":\"xmzsbbzogg\",\"name\":\"rxwburv\",\"status\":\"xxjnspydptk\",\"percentComplete\":34.515266,\"startTime\":\"2021-12-09T16:13:48Z\",\"endTime\":\"2021-04-27T14:18:48Z\",\"operations\":[{\"status\":\"udwtiukbl\"},{\"status\":\"ngkpocipazy\"},{\"status\":\"o\"},{\"status\":\"gukgjnpiucgygevq\"}]},{\"id\":\"yp\",\"name\":\"bpizcdrqjsdpydn\",\"status\":\"yhxdeoejzicwi\",\"percentComplete\":36.28927,\"startTime\":\"2021-09-22T07:17:11Z\",\"endTime\":\"2021-05-15T05:25:36Z\",\"operations\":[{\"status\":\"ishc\"},{\"status\":\"khaj\"},{\"status\":\"eyeam\"},{\"status\":\"p\"}]},{\"id\":\"alpbuxwgipwhon\",\"name\":\"kgshwa\",\"status\":\"kix\",\"percentComplete\":27.76388,\"startTime\":\"2021-01-11T20:58:11Z\",\"endTime\":\"2021-12-05T01:31:14Z\",\"operations\":[{\"status\":\"tmryw\"},{\"status\":\"uzoqft\"},{\"status\":\"yqzrnkcqvyxlw\"}]},{\"id\":\"sicohoqqnwvlry\",\"name\":\"w\",\"status\":\"heun\",\"percentComplete\":93.34921,\"startTime\":\"2021-10-16T07:10:15Z\",\"endTime\":\"2021-07-05T11:46:20Z\",\"operations\":[{\"status\":\"onocukok\"},{\"status\":\"yaxuconuqszfkb\"}]}]},{\"id\":\"wrmjmwvvjektc\",\"name\":\"enhwlrs\",\"status\":\"frzpwvlqdqgb\",\"percentComplete\":64.65002,\"startTime\":\"2021-02-23T11:21:53Z\",\"endTime\":\"2021-05-04T00:16:05Z\",\"operations\":[{\"id\":\"cktvfcivfsnkymuc\",\"name\":\"hjfbebrjcxe\",\"status\":\"fuwutttxf\",\"percentComplete\":44.331276,\"startTime\":\"2021-07-03T14:23:35Z\",\"endTime\":\"2021-05-23T19:20:57Z\",\"operations\":[{\"status\":\"epcyvahfnlj\"},{\"status\":\"yq\"},{\"status\":\"j\"}]},{\"id\":\"j\",\"name\":\"idokgjlj\",\"status\":\"oxgvclt\",\"percentComplete\":68.50667,\"startTime\":\"2021-04-14T10:54:43Z\",\"endTime\":\"2021-09-18T15:38:18Z\",\"operations\":[{\"status\":\"esz\"},{\"status\":\"hbijhtxfvgxb\"},{\"status\":\"smx\"},{\"status\":\"eh\"}]},{\"id\":\"ec\",\"name\":\"odebfqkkrbmpu\",\"status\":\"gr\",\"percentComplete\":17.81757,\"startTime\":\"2021-02-02T06:18:35Z\",\"endTime\":\"2021-07-31T18:29:57Z\",\"operations\":[{\"status\":\"zpuzycisp\"},{\"status\":\"qzahmgkbrp\"},{\"status\":\"y\"}]},{\"id\":\"bnuqqkpik\",\"name\":\"rgvtqag\",\"status\":\"buynhijggm\",\"percentComplete\":50.53692,\"startTime\":\"2021-01-01T18:17:26Z\",\"endTime\":\"2021-09-16T13:37:10Z\",\"operations\":[{\"status\":\"trcvpnazzmh\"}]}]},{\"id\":\"mpxttdbhrbnlankx\",\"name\":\"skpbhenbtkcxywn\",\"status\":\"tnrsyn\",\"percentComplete\":52.88253,\"startTime\":\"2021-03-29T15:40:05Z\",\"endTime\":\"2021-06-30T12:37:43Z\",\"operations\":[{\"id\":\"fclhaaxdbabphlwr\",\"name\":\"fkts\",\"status\":\"hsucoc\",\"percentComplete\":47.56353,\"startTime\":\"2021-07-24T19:44:14Z\",\"endTime\":\"2021-07-01T18:19:25Z\",\"operations\":[{\"status\":\"twwrqp\"}]}]}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + MigrationDiscoverySapManager manager = MigrationDiscoverySapManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + OperationStatusResult response + = manager.sapDiscoverySites().importEntities("zj", "yggdtjixh", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("uofqwe", response.id()); + Assertions.assertEquals("hmenevfyexfwhybc", response.name()); + Assertions.assertEquals("bvyvdcsity", response.status()); + Assertions.assertEquals(40.747864F, response.percentComplete()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-25T02:11:12Z"), response.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-17T15:40:41Z"), response.endTime()); + Assertions.assertEquals("hfiqscjeypvhe", response.operations().get(0).id()); + Assertions.assertEquals("kgqhcjrefovg", response.operations().get(0).name()); + Assertions.assertEquals("kqsleyyvxy", response.operations().get(0).status()); + Assertions.assertEquals(16.411882F, response.operations().get(0).percentComplete()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-22T06:48:14Z"), response.operations().get(0).startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-09T05:45:58Z"), response.operations().get(0).endTime()); + Assertions.assertEquals("gjcrcczsqpjhvm", response.operations().get(0).operations().get(0).id()); + Assertions.assertEquals("jvnysounqe", response.operations().get(0).operations().get(0).name()); + Assertions.assertEquals("a", response.operations().get(0).operations().get(0).status()); + Assertions.assertEquals(9.069002F, response.operations().get(0).operations().get(0).percentComplete()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-26T09:02:26Z"), + response.operations().get(0).operations().get(0).startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-06T07:30:47Z"), + response.operations().get(0).operations().get(0).endTime()); + Assertions.assertEquals("hltrpmopjmcmatuo", + response.operations().get(0).operations().get(0).operations().get(0).status()); + } +} diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapInstanceTagsUpdateTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapInstanceTagsUpdateTests.java new file mode 100644 index 0000000000000..0ae625bfdc8c6 --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapInstanceTagsUpdateTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migrationdiscoverysap.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrationdiscoverysap.models.SapInstanceTagsUpdate; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class SapInstanceTagsUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SapInstanceTagsUpdate model = BinaryData.fromString("{\"tags\":{\"juvf\":\"jysvl\",\"jkcpr\":\"awrlyx\"}}") + .toObject(SapInstanceTagsUpdate.class); + Assertions.assertEquals("jysvl", model.tags().get("juvf")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SapInstanceTagsUpdate model = new SapInstanceTagsUpdate().withTags(mapOf("juvf", "jysvl", "jkcpr", "awrlyx")); + model = BinaryData.fromObject(model).toObject(SapInstanceTagsUpdate.class); + Assertions.assertEquals("jysvl", model.tags().get("juvf")); + } + + // 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/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapInstancesDeleteMockTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapInstancesDeleteMockTests.java new file mode 100644 index 0000000000000..dab825ea743ca --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/SapInstancesDeleteMockTests.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.migrationdiscoverysap.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.migrationdiscoverysap.MigrationDiscoverySapManager; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class SapInstancesDeleteMockTests { + @Test + public void testDelete() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + MigrationDiscoverySapManager manager = MigrationDiscoverySapManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.sapInstances().delete("m", "yqupedeojnabckh", "mtxpsiebtfh", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ServerInstancesDeleteMockTests.java b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ServerInstancesDeleteMockTests.java new file mode 100644 index 0000000000000..a0b65959d6cf2 --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/java/com/azure/resourcemanager/migrationdiscoverysap/generated/ServerInstancesDeleteMockTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.migrationdiscoverysap.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.migrationdiscoverysap.MigrationDiscoverySapManager; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class ServerInstancesDeleteMockTests { + @Test + public void testDelete() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + MigrationDiscoverySapManager manager = MigrationDiscoverySapManager.configure().withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.serverInstances().delete("xosow", "xcug", "cjooxdjebwpucwwf", "ovbvmeueciv", + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 0000000000000..1f0955d450f0d --- /dev/null +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline